Skip to content
CORS Write-up Beginner

How I Found a CORS Misconfiguration that let me change user addre

The site reflected any Origin header in Access-Control-Allow-Origin while also allowing credentials, so a malicious page could make authenticated cross-origin requests. The author used this to change a logged-in user's shipping address without their knowledge.

Nuhman Jaseel A P Follow

Published on medium.com

I’m back with another write-up — this time, about a CORS (Cross-Origin Resource Sharing) misconfiguration that allowed me to exploit a user profile update feature.

Nuhman Jaseel A P, 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 server echoed whatever Origin value it received into Access-Control-Allow-Origin while also setting Access-Control-Allow-Credentials to true, instead of checking the origin against an allowlist.

Impact

A logged-in user who visited the attacker's page and clicked the button could have their shipping address changed without their knowledge; the exploit required that click.

What the attacker needed

Victim is logged in; victim visits attacker page; victim clicks a button; attacker hosts page on a public URL

The fix

The server should only return Access-Control-Allow-Origin for origins on a strict allowlist, and should not combine a reflected origin with Access-Control-Allow-Credentials.

How it was found

  1. Intercept site requests in a proxy and change the Origin header to an attacker-controlled domain.
  2. Observe the response reflecting that origin and allowing credentials.
  3. Find a sensitive endpoint, the edit shipping address function.
  4. Host an HTML page on a public tunnel URL that sends a cross-origin request to that endpoint.
  5. Get a logged-in user to visit the page and click the button, which sends their cookies with the request.
  6. The user's shipping address is changed to the attacker's value.

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.

Websites use a browser rule called CORS to decide whether a page on one site may read responses from another site. Here the server trusted every site that asked, and also allowed the visitor's login cookies to be sent. That let an attacker's page act as the logged-in user and change their saved address.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.