Skip to content
Access control Write-up Intermediate

How a Locale Path Bypass Exposed 339,000 Media Objects and Multiple Cloud Backends

A locale-specific URL prefix bypassed Cloudflare rules that blocked the WordPress REST API media endpoint at the root, allowing unauthenticated enumeration of about 339,500 media objects across seven sites. The exposed metadata revealed multiple CDN and object-storage backends, and direct requests to production object storage returned files, including over 160 objects no longer served by the CDN and sensitive documents.

Tarek ElDemerdash Follow

Published on medium.com

Bug Bounty

Tarek ElDemerdash, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

Context

During an authorised bug bounty assessment of a multinational fintech company's WordPress Multisite infrastructure, Tarek ElDemerdash found a routing inconsistency that let WordPress REST API endpoints bypass Cloudflare protections through locale-specific URL prefixes. The target was a WordPress Multisite deployment behind Cloudflare, with separate localised sites exposed through URL prefixes such as /uk/, /au/ and /sg/. The finding was ultimately closed as a duplicate by the bug bounty program, and the identifying details in the write-up have been sanitised.

What began as an apparent WAF bypass turned into a broader exposure chain:

  • Unauthenticated access to a WordPress REST API media endpoint
  • Approximately 339,500 enumerable media objects across seven locales
  • Metadata disclosing internal storage infrastructure and file paths
  • Five distinct CDN/object-storage backends
  • Direct access to production object storage
  • More than 160 files no longer available through the CDN but still accessible from origin storage
  • Draft legal documents, editable Word documents, certificates and internal forms

Setup

The assessment was performed within the authorised scope of the relevant bug bounty program. The write-up does not describe specific accounts, roles, tool versions or other preconditions beyond the target being a WordPress Multisite installation behind Cloudflare with locale-prefixed sites. The media endpoint was reachable without authentication, which is what made the chain work.

Finding it

Cloudflare appeared to block sensitive WordPress paths at the root of the domain. A request to the media endpoint at the root returned a block:

HTTP
GET /wp-json/wp/v2/media → 403 Forbidden

Similar requests to administrative endpoints such as /wp-admin/, /wp-login.php and /wp-json/ were also blocked at the root.

However, the same WordPress functionality became reachable when accessed through a locale prefix:

HTTP
GET /xx/wp-json/wp/v2/media → 200 OK

The important distinction was that the locale prefix was not creating a different application endpoint. It ultimately routed the request to the same WordPress infrastructure while avoiding the Cloudflare rule that was protecting the root path. Testing the available locale prefixes revealed inconsistent routing behaviour: some prefixes returned redirects, while another routed through different infrastructure and produced a different response chain. Seven locales ultimately provided access to the WordPress API without the expected Cloudflare restriction.

The security boundary here was not simply that a particular URL returned 200. Cloudflare was protecting one representation of the endpoint while another route exposed the same backend functionality, a discrepancy between the application's routing model and the WAF's URL-based security rules.

Exploitation

Step 1: Reach the media endpoint through a locale prefix

Once the locale-based route was identified, the WordPress REST API media endpoint could be accessed without authentication:

HTTP
GET /xx/wp-json/wp/v2/media/40000

The response exposed extensive metadata associated with the media object, including:

  • Media ID
  • Upload timestamp
  • Author ID
  • MIME type
  • File dimensions
  • Custom field data
  • Original source URLs
  • CDN URLs
  • Image variants and srcset information

The endpoint also disclosed the total number of objects through the WordPress response header:

HTTP
X-WP-Total: 4682

That figure represented only one locale. Because the deployment was a WordPress Multisite installation, the same testing methodology could be applied independently to other localised sites. Across seven accessible locales, approximately 339,500 media objects were enumerable.

Step 2: Filter and correlate

The API also supported filtering mechanisms such as:

HTTP
GET /xx/wp-json/wp/v2/media?author=71&per_page=1

and:

HTTP
GET /xx/wp-json/wp/v2/media?search=contract&per_page=1

This made it possible to identify specific classes of content and correlate media objects with CMS authors without authentication.

Step 3: Establish that this was not the intended public API

A potential objection with WordPress media endpoints is that publicly uploaded media can legitimately be accessible to unauthenticated users. To determine whether this was simply intended WordPress behaviour, the researcher tested other REST API functionality through the same locale-based route. The results showed that authentication controls were already being enforced elsewhere:

Text
/xx/wp-json/ → 401 rest_auth_required
/xx/wp-json/wp/v2/plugins → 401 rest_cannot_view_plugins
/xx/wp-json/wp/v2/themes → 401 rest_cannot_view_themes
/xx/wp-json/wp/v2/users → 403
/xx/wp-admin/ → 403

Non-public post states were also tested:

Text
/xx/wp-json/wp/v2/posts?status=draft → 403
/xx/wp-json/wp/v2/posts?status=private → 403

The API was not generally configured as an anonymous WordPress API. Authentication and access controls were being applied to sensitive resources, while the media endpoint remained accessible through the locale route. The issue is therefore better characterised as an authorisation/control gap affecting the media endpoint, rather than an assumption that all WordPress media is inherently public.

Step 4: Read the storage infrastructure out of the metadata

The media objects contained direct references to the infrastructure responsible for serving the files. By analysing these references across the accessible locales, the researcher identified five distinct storage/delivery backends:

  1. Primary CDN infrastructure
  2. Secondary CDN infrastructure
  3. Legacy CDN infrastructure
  4. Production object storage
  5. UAT/staging object storage

The metadata exposed CDN URLs, origin paths, storage hostnames and file locations. The API was therefore not merely revealing information about individual files; it was also disclosing how those files were stored and delivered.

Step 5: Fetch objects directly from production storage

Further testing showed that files referenced by the media metadata could be requested directly from the production object-storage backend:

HTTP
GET https://[production-bucket].[region].[provider]/wp-content/uploads/sites/9/2025/04/example.png → 200 OK

The bucket did not provide unrestricted directory listing, but this did not prevent access to individual objects. The media API had already provided the file paths required to retrieve known objects. Disabling bucket listing does not prevent unauthorised access when another application endpoint can enumerate valid object paths: the application layer effectively supplied the object references, while the storage layer independently served the files.

Step 6: Compare CDN against origin to find orphaned files

The researcher then compared objects exposed by the storage backend with their availability through the CDN. This revealed an additional class of files:

Text
CDN → 404 Not Found
Origin storage → 200 OK

More than 160 objects were identified in this state: no longer available through the normal CDN path but still accessible directly from the underlying production storage. The objects included historical assets, internal forms, documents and other files that were no longer being served through the primary delivery layer. Removing a file from the CDN did not necessarily remove the underlying object from production storage, and these files were particularly significant because they appeared to have been removed from the normal public delivery path while remaining accessible through the origin.

Step 7: Target sensitive documents with keyword and MIME filters

The media API supported keyword and MIME-type filtering, allowing targeted testing without indiscriminately downloading the entire media library:

HTTP
GET /xx/wp-json/wp/v2/media?search=contract&per_page=100

and:

HTTP
GET /xx/wp-json/wp/v2/media?media_type=application&per_page=100

These searches identified multiple document types, including:

  • PDF documents
  • Presentation files
  • Microsoft Word documents
  • Industry certificates
  • Internal forms
  • Historical documents

Among the discovered material were draft versions of legal and financial-services documents. Some files were editable .docx documents rather than flattened PDFs. Depending on how they were created, such documents can contain additional metadata such as author information, revision information, comments, tracked changes or internal document properties. The exposure therefore extended beyond ordinary public website imagery and included documents that appeared inconsistent with the intended public-facing content.

The complete chain

The overall chain can be summarised as:

Text
Locale-specific URL prefix
↓
Cloudflare path/routing bypass
↓
Unauthenticated WordPress REST API access
↓
Authorization gap on media endpoint
↓
Enumeration across 7 WordPress sites
↓
~339,500 media objects exposed
↓
Media metadata reveals storage infrastructure
↓
Direct access to production object storage
↓
160+ objects accessible from origin after CDN removal
↓
Sensitive documents and historical files discovered

Each stage provided information necessary to reach the next. The initial WAF bypass alone would have had limited impact. The media endpoint alone could potentially have been dismissed as normal WordPress behaviour. The combination of authorisation testing, multisite enumeration, metadata analysis and origin-storage validation demonstrated a much broader confidentiality issue.

Root cause

The application's routing model and the WAF's URL-based security rules disagreed. Cloudflare rules matched the root path /wp-json/ and blocked it, but the locale-prefixed route /xx/wp-json/ reached the same WordPress backend functionality without matching the rule. The locale prefix did not create a separate endpoint; it was an alternate representation of the same one. The WAF rule matched the root path but not the locale-prefixed route that reached the same backend.

On top of that, the media endpoint's authorisation policy was weaker than the rest of the REST API. Other resources (/wp-json/, plugins, themes, users, draft and private posts) enforced authentication and returned 401 or 403, while the media endpoint remained anonymously reachable through the locale route. The write-up does not state why the media endpoint was configured this way; the evidence is the inconsistency with its neighbours.

At the storage layer, production object storage served files directly without the access controls enforced by the application layer. The bucket did not provide unrestricted directory listing, but individual objects were retrievable by anyone holding a valid path, and the media API supplied those paths. Orphaned objects also remained in origin storage after being removed from the CDN, so CDN removal was not equivalent to deletion.

Impact

The primary impact was not simply the number of media objects. The more important factors were:

  • Large-scale enumeration. Approximately 339,500 media objects were accessible across seven localised WordPress sites.
  • Authorisation inconsistency. Sensitive WordPress REST endpoints required authentication, while the media endpoint remained accessible anonymously through the alternate route.
  • Infrastructure disclosure. Media metadata exposed multiple CDN and storage backends, including production and UAT infrastructure.
  • Origin exposure. Production object storage served files directly without the same access controls enforced by the application layer.
  • Persistence of removed content. More than 160 objects were found in origin storage despite no longer being available through the CDN.
  • Sensitive documents. The accessible content included documents and files that appeared inappropriate for unrestricted public access, including draft legal material and editable office documents.

All of this was reachable without authentication, under the conditions described above: a locale-prefixed route that reaches the REST API, a media endpoint with weaker authorisation than its neighbours, and an origin bucket that serves known object paths directly.

Fix

Remediation should address both the application and infrastructure layers.

Application layer

  1. Enforce the same authorisation policy on the media endpoint as other protected REST API resources.
  2. Ensure locale-specific routes cannot bypass REST API authentication controls.
  3. Review anonymous access to media enumeration and filtering.
  4. Prevent unauthorised keyword-based discovery of non-public content.
  5. Audit the entire WordPress Multisite network rather than fixing only one locale.

WAF and routing layer

  1. Normalise URL paths before applying security rules.
  2. Ensure WAF policies cover every route capable of reaching protected backend functionality.
  3. Review locale, language, versioned, rewritten and aliased paths.
  4. Test Cloudflare rules against the application's actual routing behaviour.

Storage layer

  1. Restrict production object storage to authorised delivery mechanisms.
  2. Avoid publicly accessible origin buckets where CDN-only access is intended.
  3. Review bucket/object ACLs and IAM policies.
  4. Audit legacy CDN infrastructure.
  5. Review UAT/staging storage for production or sensitive data.
  6. Remove orphaned objects that are no longer required.
  7. Implement lifecycle policies for obsolete uploads.

Variants to test

The write-up closes with a methodology that generalises well. Concrete things to try on other targets:

  1. Locale, language and versioned prefixes against path-based WAF rules. Take any path the WAF blocks at the root and retry it behind a locale prefix such as /uk/, /au/ or /sg/. A positive result is the same backend functionality returning 200 through the alternate route while the canonical path still returns 403.
  2. Compare neighbouring endpoints to prove the authorisation model. Request protected resources through the same alternate route (/wp-json/, plugins, themes, users, draft and private posts). If those return 401 or 403 while the endpoint under test returns 200, you have evidence of an inconsistent authorisation policy rather than intended public behaviour.
  3. Check enumeration headers and filters on WordPress REST endpoints. Look for X-WP-Total and try ?author=, ?search= and ?media_type= filters. A positive result is a total count plus the ability to narrow results to specific authors or content classes without authentication.
  4. Mine metadata for infrastructure. Read CDN URLs, origin paths, storage hostnames and bucket names out of media metadata. A positive result is a hostname or path that resolves to a storage backend you can query directly.
  5. Test origin storage independently of the CDN. Request a known object path directly from the bucket. A positive result is 200 from origin even where bucket listing is disabled.
  6. Diff CDN against origin for orphaned objects. For each object path, compare the CDN response with the origin response. A positive result is CDN 404 with origin 200, indicating content removed from delivery but not from storage.
  7. Repeat across every site in a multisite network. Once one locale is confirmed, apply the same tests to the other sites within the program's authorised scope. A positive result is the same weakness existing independently on other sites, multiplying the exposure.

The final lesson from the assessment: don't stop at the first 200 OK. Establish the authorisation boundary, understand the routing, trace the data flow, identify the infrastructure behind the application, and validate whether supposedly removed or restricted data remains accessible elsewhere.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 21 min read.

What happened, in plain words

A security researcher was allowed to test a large fintech company's website as part of a bug bounty programme. A bug bounty programme is a scheme where a company invites outside people to look for security problems in its systems and report them, usually for a reward. The researcher, Tarek ElDemerdash, found that a protection layer in front of the website could be walked around by adding a small piece of text to the address, and that this led to a much bigger problem: hundreds of thousands of files, and information about the servers that store them, could be reached by anyone without logging in.

The finding was eventually closed as a duplicate. The identifying details in the write-up have been sanitised, so the real domain names, bucket names and file paths are not shown.

Before going further, a few words that come up constantly:

  • WordPress is a popular system for building websites. It stores pages, images and documents in a database and serves them to visitors.
  • WordPress Multisite is a mode of WordPress where one installation runs many separate websites, for example one per country, all sharing the same code and database.
  • Cloudflare is a service that sits between visitors and a website. It can block suspicious requests before they reach the site. Think of it as a security guard at the door of a building: every visitor passes the guard first.
  • A WAF (web application firewall) is the part of such a service that inspects the address and contents of each request and decides whether to let it through. Cloudflare's rules here are the guard's list of forbidden doors.
  • An API is a way for software to talk to software. A website's API is a set of addresses that return raw data rather than a pretty page. Think of a restaurant: the menu is the website you see, and the API is the waiter who takes a specific order to the kitchen and brings back exactly that dish.
  • The WordPress REST API is WordPress's built-in API. Addresses beginning with /wp-json/ return data in a machine-readable format instead of a web page.
  • A locale is a language or region variant of a site. Here each locale had its own address prefix, such as /uk/, /au/ or /sg/.
  • A CDN (content delivery network) is a network of servers that cache and serve files close to visitors. Think of it as a chain of local shops that keep copies of a warehouse's goods so customers do not have to travel to the warehouse.
  • Object storage is a way of storing files in the cloud, where each file is an "object" with a unique address. Think of a giant warehouse with numbered shelves: if you know the shelf number, you can ask for that one box.
  • A bucket is the container that holds objects in object storage.
  • Origin means the original place where files really live, as opposed to the CDN copies.
  • Authentication means proving who you are, usually by logging in. Authorisation means what you are allowed to do once you are known. A staff badge gets you into the building (authentication); it may still not open the finance cupboard (authorisation).
  • A 403 response is the standard web answer meaning "forbidden". A 401 means "you are not authenticated". A 200 means "here is what you asked for". A 404 means "not found".

The setup

The target was a WordPress Multisite installation behind Cloudflare, with separate localised sites reachable through prefixes such as /uk/, /au/ and /sg/. The assessment was carried out within the authorised scope of the bug bounty programme. The write-up does not describe specific accounts, roles or tool versions. The media endpoint was reachable without logging in, which is what made the chain work. That is the whole point of the chain, so keep it in mind as you read.

Finding it

Cloudflare appeared to block sensitive WordPress addresses at the root of the domain. A request to the media endpoint at the root was refused:

HTTP
GET /wp-json/wp/v2/media → 403 Forbidden

Line by line:

  • GET is the type of request a browser makes when it simply asks for something. It is the same verb your browser uses when you type an address and press Enter.
  • /wp-json/wp/v2/media is the path being requested. wp-json says "this is the WordPress API", wp/v2 is the version of that API, and media is the part that deals with uploaded files such as images and documents.
  • → 403 Forbidden is the answer: the guard said no.

Similar requests to administrative addresses such as /wp-admin/, /wp-login.php and /wp-json/ were also blocked at the root. /wp-admin/ is the WordPress management area, /wp-login.php is the login page, and /wp-json/ is the entry point of the whole API.

However, the same WordPress functionality became reachable when accessed through a locale prefix:

HTTP
GET /xx/wp-json/wp/v2/media → 200 OK

Line by line:

  • The only difference from the blocked request is the xx at the start. xx stands for one of the locale prefixes; the real one has been sanitised.
  • The answer is now 200 OK, meaning the server returned the data.

The important distinction was that the locale prefix was not creating a different application endpoint. It ultimately routed the request to the same WordPress infrastructure while avoiding the Cloudflare rule that was protecting the root path. In the guard analogy: the guard was told to block the main entrance, but there was a side corridor with a different label that led to the same room.

Testing the available locale prefixes revealed inconsistent routing behaviour. Some prefixes returned redirects, meaning the server told the browser to go somewhere else. Another routed through different infrastructure and produced a different response chain. Seven locales ultimately provided access to the WordPress API without the expected Cloudflare restriction.

The security boundary here was not simply that a particular URL returned 200. Cloudflare was protecting one representation of the endpoint while another route exposed the same backend functionality. That is a discrepancy between the application's routing model and the WAF's URL-based security rules: the application knew many ways to reach the same room, and the firewall knew only one of them.

Exploitation

Step 1: Reach the media endpoint through a locale prefix

Once the locale-based route was identified, the WordPress REST API media endpoint could be accessed without authentication:

HTTP
GET /xx/wp-json/wp/v2/media/40000

Line by line:

  • GET asks for a resource.
  • /xx/wp-json/wp/v2/media/40000 asks for one specific media object, the one whose internal number is 40000. Media objects are the files uploaded to the site: images, PDFs, Word documents and so on.
  • No login, cookie or token is sent. A cookie is a small piece of data a website stores in your browser to remember you; a token is a similar piece of data used by software to prove it is allowed in. Neither is present here, which is what "unauthenticated" means.

The response exposed extensive metadata associated with the media object. Metadata is data about data: not the photo itself, but the details recorded about it. The response included:

  • Media ID, the internal number of the object
  • Upload timestamp, when it was uploaded
  • Author ID, the internal number of the user who uploaded it
  • MIME type, the standard label for the file's format, such as image/png
  • File dimensions, the width and height of an image
  • Custom field data, extra information the site's designers chose to store
  • Original source URLs, where the file originally came from
  • CDN URLs, the addresses where the CDN serves the file
  • Image variants and srcset information, the different sizes generated for different screens

The endpoint also disclosed the total number of objects through the WordPress response header:

HTTP
X-WP-Total: 4682

Line by line:

  • A header is a line of extra information sent alongside a web response, a bit like the label on a parcel that says how many items are inside.
  • X-WP-Total is WordPress's header for the total number of items matching the request.
  • 4682 is that count.

That figure represented only one locale. Because the deployment was a WordPress Multisite installation, the same testing methodology could be applied independently to other localised sites. Across seven accessible locales, approximately 339,500 media objects were enumerable. Enumerable means it was possible to walk through them one by one and learn what exists, even without downloading everything.

Step 2: Filter and correlate

The API also supported filtering mechanisms such as:

HTTP
GET /xx/wp-json/wp/v2/media?author=71&per_page=1

and:

HTTP
GET /xx/wp-json/wp/v2/media?search=contract&per_page=1

Line by line, for the first request:

  • Everything up to the ? is the same media endpoint as before.
  • The ? starts the query string, the part of an address that passes settings to the server. Think of it as the options you tick on an order form.
  • author=71 asks for media uploaded by the user whose internal number is 71.
  • & separates one setting from the next.
  • per_page=1 asks for one result per page, which is a way to peek at a single example without pulling a large list.

For the second request:

  • search=contract asks the server to return only media whose details contain the word "contract".
  • per_page=1 again limits the answer to one item.

This made it possible to identify specific classes of content and correlate media objects with CMS authors without authentication. A CMS, or content management system, is the software used to publish and organise a website's content; WordPress is one. Correlating here means linking a file to the person who uploaded it, using the author number in the metadata.

Step 3: Establish that this was not the intended public API

A potential objection with WordPress media endpoints is that publicly uploaded media can legitimately be accessible to unauthenticated users. In other words, maybe the site simply meant to publish these files, and there is no bug at all. To determine whether this was simply intended WordPress behaviour, the researcher tested other REST API functionality through the same locale-based route. The results showed that authentication controls were already being enforced elsewhere:

Text
/xx/wp-json/ → 401 rest_auth_required
/xx/wp-json/wp/v2/plugins → 401 rest_cannot_view_plugins
/xx/wp-json/wp/v2/themes → 401 rest_cannot_view_themes
/xx/wp-json/wp/v2/users → 403
/xx/wp-admin/ → 403

Line by line:

  • /xx/wp-json/ is the API entry point. It answered 401 rest_auth_required, meaning "you must log in first".
  • /xx/wp-json/wp/v2/plugins lists plugins, the add-on software installed on the site. It answered 401 rest_cannot_view_plugins, meaning "you are not allowed to see the plugins".
  • /xx/wp-json/wp/v2/themes lists themes, the design packages installed on the site. It answered 401 rest_cannot_view_themes, meaning "you are not allowed to see the themes".
  • /xx/wp-json/wp/v2/users lists the site's user accounts. It answered 403, meaning "forbidden".
  • /xx/wp-admin/ is the management area. It also answered 403.

Non-public post states were also tested:

Text
/xx/wp-json/wp/v2/posts?status=draft → 403
/xx/wp-json/wp/v2/posts?status=private → 403

Line by line:

  • /xx/wp-json/wp/v2/posts is the endpoint for posts, the articles on the site.
  • ?status=draft asks for posts that are still drafts, not yet published. The answer was 403, forbidden.
  • ?status=private asks for posts marked private. The answer was also 403.

The API was not generally configured as an anonymous WordPress API. Authentication and access controls were being applied to sensitive resources, while the media endpoint remained accessible through the locale route. The issue is therefore better characterised as an authorisation/control gap affecting the media endpoint, rather than an assumption that all WordPress media is inherently public. In plain terms: the building locked most of its cupboards, so the one cupboard that stood open was probably a mistake rather than a policy.

Step 4: Read the storage infrastructure out of the metadata

The media objects contained direct references to the infrastructure responsible for serving the files. By analysing these references across the accessible locales, the researcher identified five distinct storage/delivery backends:

  1. Primary CDN infrastructure
  2. Secondary CDN infrastructure
  3. Legacy CDN infrastructure
  4. Production object storage
  5. UAT/staging object storage

A backend is the system behind the scenes that actually does the work. Production means the live system that real customers use. UAT stands for user acceptance testing, and staging is a rehearsal environment used before changes go live; both are supposed to be separate from production.

The metadata exposed CDN URLs, origin paths, storage hostnames and file locations. A hostname is the name of a server on the network, such as a domain name. The API was therefore not merely revealing information about individual files; it was also disclosing how those files were stored and delivered. This is like finding not just a parcel but the warehouse address printed on its label.

Step 5: Fetch objects directly from production storage

Further testing showed that files referenced by the media metadata could be requested directly from the production object-storage backend:

HTTP
GET https://[production-bucket].[region].[provider]/wp-content/uploads/sites/9/2025/04/example.png → 200 OK

Line by line:

  • GET asks for the file.
  • https:// is the secure web protocol.
  • [production-bucket].[region].[provider] is the address of the storage bucket, with the real bucket name, region and provider replaced by placeholders during sanitisation. A region is the geographic area where the cloud provider runs its servers.
  • /wp-content/uploads/sites/9/2025/04/example.png is the path of the file inside the bucket. sites/9 suggests it belongs to site number 9 in the multisite network, and 2025/04 is the year and month folder.
  • → 200 OK means the storage server handed over the file.

The bucket did not provide unrestricted directory listing, but this did not prevent access to individual objects. Directory listing is the ability to ask a server "show me everything you have". Disabling it is like removing the warehouse's index card catalogue: you can no longer browse, but if you already know a shelf number you can still walk in and take that box. The media API had already provided the file paths required to retrieve known objects.

Disabling bucket listing does not prevent unauthorised access when another application endpoint can enumerate valid object paths. The application layer effectively supplied the object references, while the storage layer independently served the files. The application layer is the website software that handles requests; the storage layer is the warehouse underneath it. Here the first handed out the addresses and the second opened the door.

Step 6: Compare CDN against origin to find orphaned files

The researcher then compared objects exposed by the storage backend with their availability through the CDN. This revealed an additional class of files:

Text
CDN → 404 Not Found
Origin storage → 200 OK

Line by line:

  • Asking the CDN for the file returned 404 Not Found, meaning the CDN had no copy to give.
  • Asking the origin storage for the same file returned 200 OK, meaning the original warehouse still had it.

More than 160 objects were identified in this state: no longer available through the normal CDN path but still accessible directly from the underlying production storage. The objects included historical assets, internal forms, documents and other files that were no longer being served through the primary delivery layer.

Removing a file from the CDN did not necessarily remove the underlying object from production storage. This is the difference between taking a book off the shop shelf and destroying the copy in the warehouse. These files were particularly significant because they appeared to have been removed from the normal public delivery path while remaining accessible through the origin. Anyone who assumed "it is gone from the website, so it is gone" would be wrong.

Step 7: Target sensitive documents with keyword and MIME filters

The media API supported keyword and MIME-type filtering, allowing targeted testing without indiscriminately downloading the entire media library:

HTTP
GET /xx/wp-json/wp/v2/media?search=contract&per_page=100

and:

HTTP
GET /xx/wp-json/wp/v2/media?media_type=application&per_page=100

Line by line, for the first request:

  • search=contract asks for media whose details contain the word "contract".
  • per_page=100 asks for up to one hundred results at a time.

For the second request:

  • media_type=application asks for files whose MIME type starts with application. MIME types group files by kind; application covers documents and other non-image formats, as opposed to image, video or audio.
  • per_page=100 again asks for up to one hundred results.

These searches identified multiple document types, including:

  • PDF documents
  • Presentation files
  • Microsoft Word documents
  • Industry certificates
  • Internal forms
  • Historical documents

Among the discovered material were draft versions of legal and financial-services documents. Some files were editable .docx documents rather than flattened PDFs. A flattened PDF is a fixed picture of a document; an editable .docx is the working file. Depending on how they were created, such documents can contain additional metadata such as author information, revision information, comments, tracked changes or internal document properties. Tracked changes record who edited what and when, which can reveal internal discussions that were never meant to be published.

The exposure therefore extended beyond ordinary public website imagery and included documents that appeared inconsistent with the intended public-facing content.

The complete chain

The overall chain can be summarised as:

Text
Locale-specific URL prefix
↓
Cloudflare path/routing bypass
↓
Unauthenticated WordPress REST API access
↓
Authorization gap on media endpoint
↓
Enumeration across 7 WordPress sites
↓
~339,500 media objects exposed
↓
Media metadata reveals storage infrastructure
↓
Direct access to production object storage
↓
160+ objects accessible from origin after CDN removal
↓
Sensitive documents and historical files discovered

Read it as a staircase. Each stage provided information necessary to reach the next. The initial WAF bypass alone would have had limited impact: a blocked address that becomes reachable is interesting but not necessarily harmful. The media endpoint alone could potentially have been dismissed as normal WordPress behaviour. The combination of authorisation testing, multisite enumeration, metadata analysis and origin-storage validation demonstrated a much broader confidentiality issue. Confidentiality here means keeping data away from people who should not see it.

Root cause

The application's routing model and the WAF's URL-based security rules disagreed. Cloudflare rules matched the root path /wp-json/ and blocked it, but the locale-prefixed route /xx/wp-json/ reached the same WordPress backend functionality without matching the rule. The locale prefix did not create a separate endpoint; it was an alternate representation of the same one. The WAF rule matched the root path but not the locale-prefixed route that reached the same backend. Normalising a path means reducing every spelling of an address to one standard form before comparing it, the way a postal service treats "Main St." and "Main Street" as the same road.

On top of that, the media endpoint's authorisation policy was weaker than the rest of the REST API. Other resources (/wp-json/, plugins, themes, users, draft and private posts) enforced authentication and returned 401 or 403, while the media endpoint remained anonymously reachable through the locale route. The write-up does not state why the media endpoint was configured this way; the evidence is the inconsistency with its neighbours.

At the storage layer, production object storage served files directly without the access controls enforced by the application layer. The bucket did not provide unrestricted directory listing, but individual objects were retrievable by anyone holding a valid path, and the media API supplied those paths. Orphaned objects also remained in origin storage after being removed from the CDN, so CDN removal was not equivalent to deletion.

Impact

The primary impact was not simply the number of media objects. The more important factors were:

  • Large-scale enumeration. Approximately 339,500 media objects were accessible across seven localised WordPress sites.
  • Authorisation inconsistency. Sensitive WordPress REST endpoints required authentication, while the media endpoint remained accessible anonymously through the alternate route.
  • Infrastructure disclosure. Media metadata exposed multiple CDN and storage backends, including production and UAT infrastructure.
  • Origin exposure. Production object storage served files directly without the same access controls enforced by the application layer.
  • Persistence of removed content. More than 160 objects were found in origin storage despite no longer being available through the CDN.
  • Sensitive documents. The accessible content included documents and files that appeared inappropriate for unrestricted public access, including draft legal material and editable office documents.

All of this was reachable without authentication, under the conditions described above: a locale-prefixed route that reaches the REST API, a media endpoint with weaker authorisation than its neighbours, and an origin bucket that serves known object paths directly.

Fix

Remediation should address both the application and infrastructure layers.

Application layer

  1. Enforce the same authorisation policy on the media endpoint as other protected REST API resources.
  2. Ensure locale-specific routes cannot bypass REST API authentication controls.
  3. Review anonymous access to media enumeration and filtering.
  4. Prevent unauthorised keyword-based discovery of non-public content.
  5. Audit the entire WordPress Multisite network rather than fixing only one locale.

WAF and routing layer

  1. Normalise URL paths before applying security rules.
  2. Ensure WAF policies cover every route capable of reaching protected backend functionality.
  3. Review locale, language, versioned, rewritten and aliased paths.
  4. Test Cloudflare rules against the application's actual routing behaviour.

Storage layer

  1. Restrict production object storage to authorised delivery mechanisms.
  2. Avoid publicly accessible origin buckets where CDN-only access is intended.
  3. Review bucket/object ACLs and IAM policies. An ACL is an access control list, a per-file or per-bucket list of who may do what. IAM stands for identity and access management, the cloud provider's system for defining who is allowed to do what.
  4. Audit legacy CDN infrastructure.
  5. Review UAT/staging storage for production or sensitive data.
  6. Remove orphaned objects that are no longer required.
  7. Implement lifecycle policies for obsolete uploads. A lifecycle policy is an automatic rule that deletes or archives files after a set time.

Variants to test

The write-up closes with a methodology that generalises well. Concrete things to try on other targets:

  1. Locale, language and versioned prefixes against path-based WAF rules. Take any path the WAF blocks at the root and retry it behind a locale prefix such as /uk/, /au/ or /sg/. A positive result is the same backend functionality returning 200 through the alternate route while the canonical path still returns 403.
  2. Compare neighbouring endpoints to prove the authorisation model. Request protected resources through the same alternate route (/wp-json/, plugins, themes, users, draft and private posts). If those return 401 or 403 while the endpoint under test returns 200, you have evidence of an inconsistent authorisation policy rather than intended public behaviour.
  3. Check enumeration headers and filters on WordPress REST endpoints. Look for X-WP-Total and try ?author=, ?search= and ?media_type= filters. A positive result is a total count plus the ability to narrow results to specific authors or content classes without authentication.
  4. Mine metadata for infrastructure. Read CDN URLs, origin paths, storage hostnames and bucket names out of media metadata. A positive result is a hostname or path that resolves to a storage backend you can query directly.
  5. Test origin storage independently of the CDN. Request a known object path directly from the bucket. A positive result is 200 from origin even where bucket listing is disabled.
  6. Diff CDN against origin for orphaned objects. For each object path, compare the CDN response with the origin response. A positive result is CDN 404 with origin 200, indicating content removed from delivery but not from storage.
  7. Repeat across every site in a multisite network. Once one locale is confirmed, apply the same tests to the other sites within the program's authorised scope. A positive result is the same weakness existing independently on other sites, multiplying the exposure.

The final lesson from the assessment: don't stop at the first 200 OK. Establish the authorisation boundary, understand the routing, trace the data flow, identify the infrastructure behind the application, and validate whether supposedly removed or restricted data remains accessible elsewhere.

Glossary

  • API: a set of addresses that let software request data from another system, returning raw data rather than a web page.
  • ACL (access control list): a list attached to a file or bucket saying who may do what with it.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: what you are allowed to do once you are known.
  • Backend: the system behind the scenes that does the actual work.
  • Bucket: a container that holds files (objects) in cloud object storage.
  • Bug bounty programme: a scheme where a company invites outside researchers to find and report security problems, usually for a reward.
  • CDN (content delivery network): a network of servers that cache and serve files close to visitors.
  • Cloudflare: a service that sits between visitors and a website and can block requests before they reach the site.
  • CMS (content management system): software for publishing and organising a website's content; WordPress is one.
  • Cookie: a small piece of data a website stores in your browser to remember you.
  • Correlate: link pieces of information together, for example a file and the user who uploaded it.
  • Directory listing: the ability to ask a server to show everything it holds in a folder or bucket.
  • Duplicate: a report closed because the same issue had already been reported.
  • Enumeration: walking through items one by one to learn what exists.
  • Header: a line of extra information sent alongside a web request or response.
  • Hostname: the name of a server on the network, such as a domain name.
  • IAM (identity and access management): a cloud provider's system for defining who is allowed to do what.
  • Infrastructure: the servers, storage and networks that a service runs on.
  • Lifecycle policy: an automatic rule that deletes or archives files after a set time.
  • Locale: a language or region variant of a site, often reached through a URL prefix such as /uk/.
  • Metadata: data about data; the details recorded about a file rather than the file itself.
  • MIME type: the standard label for a file's format, such as image/png or application/pdf.
  • Multisite: a WordPress mode where one installation runs many separate websites.
  • Normalise (a path): reduce every spelling of an address to one standard form before comparing it.
  • Object storage: cloud storage where each file is an object with a unique address.
  • Origin: the original place where files really live, as opposed to CDN copies.
  • Orphaned object: a file still present in origin storage after being removed from the CDN.
  • Production: the live system that real customers use.
  • Query string: the part of an address after ? that passes settings to the server.
  • Region: the geographic area where a cloud provider runs its servers.
  • REST API: a style of API built around addresses and standard request types such as GET.
  • Sanitised: with identifying details removed or replaced.
  • Staging: a rehearsal environment used before changes go live.
  • Token: a piece of data used by software to prove it is allowed in.
  • UAT (user acceptance testing): a testing environment used to check changes before they go live.
  • Unauthenticated: without logging in or proving identity.
  • WAF (web application firewall): the part of a protection service that inspects requests and decides whether to let them through.
  • WordPress: a popular system for building websites.
  • 401: the standard web answer meaning "you are not authenticated".
  • 403: the standard web answer meaning "forbidden".
  • 404: the standard web answer meaning "not found".
  • 200: the standard web answer meaning "here is what you asked for".

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.