Skip to content
Access control Disclosed report Advanced

Arbitrary file read from Cloudflare Pages build environment

A vulnerability in Cloudflare Pages' redirects and headers feature allowed an attacker to escalate privileges to root during the build process, enabling them to read filesystem files they would otherwise be unable to access. The report also mentions two further vulnerabilities found through this one, which allowed reading files of other projects or tampering with other projects.

ryotak Follow with digitalrane and esswhy

Originally disclosed on HackerOne

  • Triaged in 22 hours
  • Fixed in 23 days
  • Paid in 23 days
  • Disclosed after 21 months

Summary by the program

Cloudflare Pages provides users a feature to set redirects and headers in their Pages website. Due to a vulnerability in this feature, it was discovered that an attacker could escalate privileges to root during the build process, which would have enabled them to read filesystem files which he would otherwise be unable to. Cloudflare's engineering team resolved the issue by implementing more restrictive input validation on the redirects and headers feature, however it is important to note that the build environment is scoped to each Pages project, so an attacker could not arbitrarily read files of other project or users.

Summary by the researcher

Using this vulnerability, we found two more vulnerabilities, which allowed us to read files of other projects or tamper with other projects. For the details about the chains of vulnerabilities, please refer to the following articles:

The original report as published on HackerOne, by ryotak. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely insufficient input validation on the redirects and headers feature allowed privilege escalation during the build process.

Impact

An attacker could escalate privileges to root during the build process and read filesystem files, but the build environment is scoped to each Pages project, so they could not arbitrarily read files of other projects or users; however, the researchers found two more vulnerabilities that allowed reading files of other projects or tampering with other projects.

What the attacker needed

Cloudflare Pages project; ability to set redirects and headers

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Cloudflare Pages lets people build websites and set rules for redirects and headers. A flaw in how those rules were checked let an attacker gain the highest level of control (root) on the build machine, so they could read files on that machine that they should not see. The build machine is separate for each project, so other projects were not directly affected by this specific flaw.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by ryotak

View all

23 more disclosed reports, best first.

More from Cloudflare Public Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.