Working with a client, I came across a CSRF vulnerability in their existing web application.
The web application lacked CSRF protection on a single POST request that changed account ownership, allowing an attacker to craft a hidden form that, when visited by a victim, would transfer ownership of the victim's account to the attacker. The attacker could then become an administrator on the victim's account.
Published on medium.com
Working with a client, I came across a CSRF vulnerability in their existing web application. CSRF is a type of vulnerability where a request (POST) originates from a different domain (ORIGIN) than the target.
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 application did not validate the Origin header or use a CSRF token for state-changing requests, allowing cross-origin POST requests to be accepted.
Impact
An attacker could take over another user's account by changing its ownership, potentially gaining administrator access, though the exploit required the victim to visit a malicious page while logged in.
What the attacker needed
Victim logged in; victim visits attacker page; attacker can host a page
The fix
The client patched the issues found.
How it was found
- Create an account on the client's test environment.
- Use Burp Suite to capture the POST request that changes account ownership.
- Create a hidden HTML form with the same fields but with attacker-controlled data for the new administrator.
- Host the form on a test machine inside the client's VPN.
- Visit the test page; it loads, redirects to the main application, and submits the POST.
- The attacker is now an administrator on the test account.
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.
CSRF (Cross-Site Request Forgery) is when a malicious website tricks your browser into sending a request to another site where you are logged in, without your knowledge. Here, the application did not check that the request came from its own pages, so an attacker could make your browser change the owner of your account to them. This is like someone forging your signature on a document because the bank never verifies it.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.