Skip to content
XSS Write-up Intermediate

Why Whitelisting Root CDN Domains Breaks Your Trust Boundary

The application accepted an imageURI parameter and only checked that the URL contained the images.ctfassets.net domain, without verifying the specific tenant path. An attacker could insert their own public Contentful image link and have arbitrary assets rendered inside the user context.

medium.com

Published on medium.com

During a recent application security assessment, I mapped out an interesting vulnerability chain demonstrating how a permissive Content Security Policy (CSP) combined with weak backend validation can compromise an application’s user interface.

Alok kumar, 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.

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

How it worked

Root cause

Likely the backend validated only that the URL contained the CDN domain, not that it belonged to the organisation's specific tenant path on that multi-tenant service.

Impact

An attacker could cause arbitrary external images to be rendered inside the application's user context, potentially misleading users or bypassing the intended trust boundary for media assets.

What the attacker needed

A free Contentful account; ability to submit the imageURI parameter

The fix

The backend should validate that the URL belongs to the organisation's specific tenant path on the multi-tenant CDN, not just the domain root.

How it was found

  1. Identify the imageURI parameter that normally accepts an internal path.
  2. Check the CSP headers and note that images.ctfassets.net is whitelisted for media.
  3. Create a free Contentful account and upload an image.
  4. Submit the public Contentful image link in the imageURI parameter.
  5. Observe that the application renders the external asset inside the user context.

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 write-up has not been written yet. The Original tab links to the source.

A Content Security Policy (CSP) is a browser rule that says which websites can supply images or scripts. The app trusted any image from a shared image-hosting service, so anyone with a free account there could supply an image. The app then showed that image to users as if it were its own.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.