Site wide CSRF on a popular program
Published on fellchase.blogspot.com
The original lives on fellchase.blogspot.com
We do not hold its text, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
What the report shows
The report is titled "Site wide CSRF on a popular program" and describes a cross site request forgery issue affecting an API endpoint on the target. The researcher does not name the program, the endpoint path, or the affected feature; the action URL and path are redacted in the payload itself.
The only artefact in the report is a self-submitting HTML page. It is a form that posts to an API path on the target with application/x-www-form-urlencoded encoding, carrying two fields: primaryPhoneType and firstName. The firstName value is set to YOUREcsrfedCongratsbtw. A short script submits the form automatically as soon as the page loads.
<html>
<form id="csrf" enctype="application/x-www-form-urlencoded" method="POST" action="https://www.example.com/api/REDACTED/PATH">
<table>
<tr><td>primaryPhoneType</td><td><input type="text" value="0101101101" name="primaryPhoneType"></td></tr>
<tr><td>firstName</td><td><input type="text" value="YOUREcsrfedCongratsbtw" name="firstName"></td></tr>
</table>
<input type="submit" value="https://www.example.com/api/REDACTED/PATH">
</form>
<script type="text/javascript">
document.getElementById('csrf').submit()
</script>
</html>

The image sits at the top of the write-up, above the payload, and is not captioned or explained in the text.
The payload implies the following:
- The payload posts form-encoded parameters named
primaryPhoneTypeandfirstNameto an API path. - The page contains no token or other anti-CSRF value in the body.
- The page submits the form automatically as soon as it loads.
The report gives no bounty amount, no severity rating, no CVSS score, no disclosure date and no confirmation of a fix. The title's claim of being "site wide" is not backed by further detail in the text, so treat it as the researcher's characterisation rather than a documented finding across multiple endpoints.
Root cause
The payload carries only the two business parameters, with no token or other value tying it to a page the target served. The payload contains only the two business parameters, so nothing in the request ties it to a page the target served. If the endpoint also accepted application/x-www-form-urlencoded bodies without checking Origin or Referer, a cross-origin form post is enough to trigger it, which is exactly what the payload relies on.
Impact
If a logged-in user loaded a page like the one above, the browser would send the forged request without their knowledge. The payload only attempts to set a phone type and a first name. The title suggests the researcher believed the weakness extended across the site, but the write-up does not show other endpoints or more sensitive actions, so the wider impact is not evidenced here. The realistic worst case for this bug class depends entirely on which actions lack protection: anything from profile edits to changes of contact details that feed account recovery.
How this kind of bug works
Browsers attach a site's cookies to requests based on the destination, not on who initiated the request. If a user is logged in to target.example and visits attacker.example, any request the attacker's page makes to target.example carries the user's session cookie. The same-origin policy stops the attacker's script from reading the response, but it does not stop the request from being sent or from having its effect.
CSRF defences work by making the request carry something the attacker cannot produce. The classic approach is a synchroniser token: a random value stored in the session and embedded in forms or headers, checked server side on every state-changing request. The double-submit cookie variant compares a cookie value with a request parameter. Modern browsers also send Origin (and often Referer) headers on cross-origin requests, and servers can reject state-changing requests whose origin does not match. SameSite cookie attributes add another layer: Lax blocks cookies on cross-site POSTs, Strict blocks them on most cross-site navigation. None of these is sufficient alone; the robust pattern combines a token check with origin validation and appropriate SameSite settings.
APIs deserve particular attention because developers often assume that JSON-only endpoints are safe. That assumption holds only if the server truly rejects other content types; if it parses form-encoded bodies too, a plain HTML form can reach it.
How to test for it
- Map state-changing requests: profile updates, email or phone changes, password changes, address books, API keys, sharing settings. Use a proxy to capture them while logged in.
- For each request, note the authentication mechanism and whether any unpredictable value (token, nonce, custom header) is present in the body, query or headers.
- Remove the token or header and replay the request. If it still succeeds, the endpoint may be vulnerable.
- Build a minimal HTML page on a different origin that reproduces the request as a form post, and load it while logged in to the target. A positive result is the server applying the change, visible afterwards in the account.
- Test content-type handling: send the same parameters as
application/x-www-form-urlencodedormultipart/form-datato endpoints that expect JSON, and see whether they are parsed. - Check whether
OriginorRefereris validated by sending the request with a foreign origin and with the header removed.
Common false positives: the endpoint requires a custom header that a form cannot set (though check whether the server actually enforces it); the session cookie is SameSite=Strict or Lax, which blocks the cross-site POST in current browsers; the action is idempotent or has no security consequence; or the request only succeeds because the tester's browser sent a token automatically from a cached page. Always confirm the change took effect server side, not just that the response looked successful.
How it is fixed
- Require an unpredictable anti-CSRF token on every state-changing request, tied to the user's session, and reject requests without a valid one.
- Validate the
Originheader (falling back toReferer) against an allowlist for state-changing requests. - Set session cookies with
SameSite=LaxorStrictwhere the application flow permits, and mark themSecureandHttpOnly. - Reject unexpected content types on API endpoints rather than parsing whatever arrives.
- For sensitive actions, require re-authentication or a confirmation step.
Hunting notes
CSRF tends to hide in older parts of an application, in JSON APIs that quietly accept form encoding, in endpoints added for mobile clients, and in admin or settings panels where developers assume the user is trusted. Recon signals worth watching: endpoints that accept both JSON and form bodies, requests with no token parameter at all, cookies without SameSite attributes, and single-page apps whose API calls rely only on cookies. GraphQL endpoints and file-upload forms are also worth checking.
To get a report accepted, demonstrate a concrete state change with a marker value (as this report does with the first name), show the request working from a genuinely different origin, and state clearly which security-relevant field changed. If the only reachable action is cosmetic, say so; programs are more likely to accept a well-scoped low-impact finding than an inflated claim of site-wide compromise.
What happened, in plain words
This report is about a bug called cross site request forgery, usually shortened to CSRF. The report shows a page that would send a profile change request to a website's API from a different website. The report does not name the program, the exact endpoint, or the feature involved; the URL path is redacted in the payload.
The only thing the report gives us is a small HTML page. If a logged-in user opened that page, it would quietly send a request to the target site with two fields: a phone type and a first name. The first name is set to the value YOUREcsrfedCongratsbtw.

The image sits at the top of the write-up, above the payload, and the report does not caption or explain it.
Here is the page exactly as it appears in the report:
<html>
<form id="csrf" enctype="application/x-www-form-urlencoded" method="POST" action="https://www.example.com/api/REDACTED/PATH">
<table>
<tr><td>primaryPhoneType</td><td><input type="text" value="0101101101" name="primaryPhoneType"></td></tr>
<tr><td>firstName</td><td><input type="text" value="YOUREcsrfedCongratsbtw" name="firstName"></td></tr>
</table>
<input type="submit" value="https://www.example.com/api/REDACTED/PATH">
</form>
<script type="text/javascript">
document.getElementById('csrf').submit()
</script>
</html>
To read it, you only need a few ideas from everyday web use:
- A request is what your browser sends to a website when you click something or a page loads. It is like posting a filled-in form to a company: the envelope has an address (the URL) and the contents (the fields).
- A cookie is a small piece of data a site stores in your browser after you log in, so it can recognise you on the next request. Think of it as a wristband you get at an event: you show it at the door and you are let in without showing your ID again.
- A form is the part of a web page that collects fields and sends them to a server. The
actionattribute is the address it sends to, andmethod="POST"means the fields travel in the body of the request rather than in the URL. application/x-www-form-urlencodedis the standard way a plain HTML form encodes its fields: names and values joined with&, likefirstName=...&primaryPhoneType=....
Line by line:
<form id="csrf" ... action="https://www.example.com/api/REDACTED/PATH">creates a form with the identifiercsrf. Theactionis the API address the browser will send to. The path is redacted in the report, so we cannot see which endpoint it was.- The two
<input>rows define the fields.primaryPhoneTypecarries the value0101101101, andfirstNamecarriesYOUREcsrfedCongratsbtw. These are the two fields the request carries. - The submit button is just a button; its label happens to repeat the URL.
- The
<script>at the bottom runs as soon as the page loads.document.getElementById('csrf').submit()finds the form and submits it without anyone clicking anything. That is what makes the attack invisible: the victim does not have to press a button.
The payload implies the following:
- The payload posts form-encoded fields to an API path.
- The page contains no token or other secret value in the body.
- The page submits the form automatically as soon as it loads.
The report gives no bounty amount, no severity rating, no CVSS score, no disclosure date and no confirmation that the issue was fixed. The title says "site wide", but the text does not show other endpoints, so treat that as the researcher's description rather than a documented finding across the whole site.
In general, how this kind of bug works
Browsers attach a site's cookies to requests based on where the request is going, not on who started it. If you are logged in to a site and then visit another site, any request that other site makes to the first one carries your cookie. The browser's same-origin policy stops the other site's script from reading the response, but it does not stop the request from being sent or from having its effect. That gap is what CSRF exploits.
Defences work by making the request carry something an attacker cannot produce:
- A synchroniser token is a random value stored in your session and placed in forms or headers. The server checks it on every state-changing request. An attacker on another site cannot know it.
- The double-submit cookie variant compares a value in a cookie with a value in the request parameter.
- Browsers send
Origin(and oftenReferer) headers on cross-origin requests, and servers can reject state-changing requests whose origin does not match. - The
SameSitecookie attribute adds another layer:Laxblocks cookies on cross-site POSTs, andStrictblocks them on most cross-site navigation.
APIs deserve special attention because developers often assume that JSON-only endpoints are safe. That holds only if the server truly rejects other content types. If it also parses form-encoded bodies, a plain HTML form can reach it, which is exactly what this payload relies on.
In general, how to test for it
- Map the requests that change something: profile updates, email or phone changes, password changes, address books, API keys, sharing settings. Use a proxy to capture them while logged in.
- For each request, note how it is authenticated and whether any unpredictable value (token, nonce, custom header) is present in the body, query or headers.
- Remove the token or header and replay the request. If it still succeeds, the endpoint may be vulnerable.
- Build a minimal HTML page on a different origin that reproduces the request as a form post, and load it while logged in to the target. A positive result is the server applying the change, visible afterwards in the account.
- Test content-type handling: send the same parameters as
application/x-www-form-urlencodedormultipart/form-datato endpoints that expect JSON, and see whether they are parsed. - Check whether
OriginorRefereris validated by sending the request with a foreign origin and with the header removed.
Common false positives: the endpoint requires a custom header that a form cannot set (though check whether the server actually enforces it); the session cookie is SameSite=Strict or Lax, which blocks the cross-site POST in current browsers; the action is idempotent or has no security consequence; or the request only succeeds because the tester's browser sent a token automatically from a cached page. Always confirm the change took effect on the server, not just that the response looked successful.
In general, how it is fixed
- Require an unpredictable anti-CSRF token on every state-changing request, tied to the user's session, and reject requests without a valid one.
- Validate the
Originheader (falling back toReferer) against an allowlist for state-changing requests. - Set session cookies with
SameSite=LaxorStrictwhere the application flow permits, and mark themSecureandHttpOnly. - Reject unexpected content types on API endpoints rather than parsing whatever arrives.
- For sensitive actions, require re-authentication or a confirmation step.
In general, where to look
CSRF tends to hide in older parts of an application, in JSON APIs that quietly accept form encoding, in endpoints added for mobile clients, and in admin or settings panels where developers assume the user is trusted. Signals worth watching: endpoints that accept both JSON and form bodies, requests with no token parameter at all, cookies without SameSite attributes, and single-page apps whose API calls rely only on cookies. GraphQL endpoints and file-upload forms are also worth checking.
To get a report accepted, demonstrate a concrete state change with a marker value (as this report does with the first name), show the request working from a genuinely different origin, and state clearly which security-relevant field changed. If the only reachable action is cosmetic, say so; programs are more likely to accept a well-scoped low-impact finding than an inflated claim of site-wide compromise.
Glossary
- API: a set of addresses a website's own pages (or other software) use to read and change data, separate from the pages you see.
- Cookie: a small piece of data a site stores in your browser, often used to keep you logged in.
- Cross site request forgery (CSRF): an attack where another website makes your browser send a request to a site you are logged in to, without your intent.
- CVSS: a standard scoring system for the severity of a security bug.
- Double-submit cookie: a CSRF defence that compares a value in a cookie with a value in the request.
- Form: the part of a web page that collects fields and sends them to a server.
HttpOnly: a cookie setting that stops page scripts from reading the cookie.- Idempotent: an action that has the same effect whether it is performed once or many times.
- JSON: a text format for structured data, commonly used by APIs.
multipart/form-data: another way a form can encode its fields, often used for file uploads.- Nonce: a value used once, to make a request unique.
- Origin: the scheme, host and port a request comes from, sent by browsers in the
Originheader. Referer: a header telling the server which page the request came from.- Request: what a browser sends to a website when a page loads or you click something.
SameSite: a cookie attribute that controls whether the cookie is sent on cross-site requests.- Same-origin policy: a browser rule that stops one site's scripts from reading another site's responses.
Secure: a cookie setting that sends the cookie only over HTTPS.- Synchroniser token: a random value stored in your session and checked by the server on each state-changing request.
application/x-www-form-urlencoded: the standard encoding a plain HTML form uses for its fields.