csrf-cross-site-request-forgery

csrf-cross-site-request-forgery is a skill for Claude Code, Codex from SecurityTalent/bugskill-ai. It costs 44 tokens per session (4,192 once invoked), scanned D, a copy of csrf-cross-site-request-forgery, MIT.

A security testing guide for cross-site request forgery, or CSRF, where a malicious site causes a user's browser to send an unwanted request to another site. It covers protections such as request tokens, cookie rules, and OAuth state checks.

In plain words
What is it for?
It helps review state-changing web requests, login and account-linking flows, JSON and multipart requests, SameSite cookie behavior, and anti-CSRF tokens.
Why use it?
It helps find missing or incorrectly implemented checks on actions such as changing a password, email address, or account role. The problem occurs when a server trusts a browser's existing login session without confirming the user's intent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Attack: Set PROFILE_ID to ../../admin/dangerous-action.

Good fit It helps review state-changing web requests, login and account-linking flows, JSON and multipart requests, SameSite cookie behavior, and anti-CSRF tokens.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/SecurityTalent/bugskill-ai
agentmods
npx agentmods add skills/securitytalent/bugskill-ai/csrf-cross-site-request-forgery

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-cross-site-request-forgery

README.md
[![agentmods](https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/csrf-cross-site-request-forgery/github.svg)](https://agentmods.dev/skills/securitytalent/bugskill-ai/csrf-cross-site-request-forgery)
Your own site
<a href="https://agentmods.dev/skills/securitytalent/bugskill-ai/csrf-cross-site-request-forgery"><img src="https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/csrf-cross-site-request-forgery/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-cross-site-request-forgery

Your own site · 80×15
<a href="https://agentmods.dev/skills/securitytalent/bugskill-ai/csrf-cross-site-request-forgery"><img src="https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/csrf-cross-site-request-forgery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,192 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. 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.00044 $0.04192
Opus 5.5 $0.00018 $0.01677
Sonnet 5.5 $0.00009 $0.00838
Haiku 4.5 $0.00004 $0.00419

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

Security

Grade D, and why

csrf-cross-site-request-forgery scanned grade D with 2 findings 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 1mo 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.

<!-- If server accepts GET for state-changing endpoint: -->

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

fetch('https://target.com/api/v1/change-email', { method: 'POST',
Origin

This is a copy

100% identical to csrf-cross-site-request-forgery — 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-cross-site-request-forgery/SKILL.md · 527 lines

How it starts

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

SKILL: CSRF — Cross-Site Request Forgery — Expert Attack Playbook

AI LOAD INSTRUCTION: Expert CSRF techniques. Covers modern bypass vectors (SameSite gaps, custom header flaws, tokenless bypass patterns), JSON CSRF, multipart CSRF, chaining with XSS. Base models often present only basic CSRF without covering SameSite edge cases and common broken token implementations.

Also load:


1. CORE CONCEPT

CSRF exploits a victim's active session to perform state-changing requests from the attacker's origin.

Required conditions:

  1. Victim is authenticated (active session cookie)
  2. Server identifies session via cookie only (no secondary check)
  3. Attacker can predict/construct the valid request
  4. Cookie is sent cross-origin (SameSite=None or legacy behavior)

2. FINDING CSRF TARGETS

High-value state-changing endpoints:

- Password change         ← account takeover
- Email change            ← account takeover
- Add admin / change role ← privilege escalation
- Bank/payment transfer   ← financial impact
- OAuth app authorization ← hijack oauth flow
- Account deletion
- Two-factor auth disable  
- SSH key / API key addition
- Webhook configuration
- Profile/contact info update

3. TOKEN BYPASS TECHNIQUES

No Token Present

Simplest case — form simply lacks CSRF token. Check if POST /change-email has any token. If not → trivially exploitable.

Token Not Validated (most common finding!)

Token exists in request but is never verified server-side:

Remove the _csrf_token parameter entirely → does request still succeed?
→ YES → trivial bypass

Token Tied to Session but Not to User

Step 1: Log in as UserA → obtain valid CSRF token
Step 2: Log in as UserB in other browser → obtain UserB CSRF token  
Step 3: Use UserB's CSRF token in UserA's session (attacker controls UserB)
→ If server validates token exists but doesn't check if it belongs to the session → bypass

Read the full file on GitHub · 527 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. 1mo ago First seen · 527 lines · 44 tokens per session scan D b837b92b54fa

Subscribe to this mod's changes

csrf-cross-site-request-forgery is a skill published in the GitHub repository SecurityTalent/bugskill-ai (13 stars, last pushed 21d ago), licensed MIT. It adds 44 tokens to every session and 4,192 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it D with 2 findings (hidden instructions, sends data to an external url). It is 100% identical to csrf-cross-site-request-forgery, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

user-research-cookiy

End-to-end user research assistant — qualitative and quantitative. Use this skill whenever the user mentions user research, user interviews, discussion guides, interview guides, research plans, qualitative research, quantitative research, user surveys, survey design, usability studies, participant recruitment…

cookiy-ai/user-research-skill · 154 tokens

email-marketing-bible

Email marketing operating manual for AI agents, with hard send-safety gates. Use when someone plans, writes, designs, audits or sends an email campaign, newsletter, welcome series, abandoned-cart, post-purchase or win-back flow; builds a list or segment; drives Klaviyo, Mailchimp, Brevo, Kit or any ESP through MCP, an…

CosmoBlk/email-marketing-bible · 195 tokens

globalpercent

GlobalPercent — build a global-macro-probability panel for an investment research system. Merges public probability data from prediction markets (Polymarket + Kalshi), classifies every market into macro modules (monetary policy / macro economy / AI / etc.), and shows the whole market's expected-probability state at a…

simonlin1212/globalpercent · 134 tokens

ui-ux-design-pro

Senior-level UI/UX design expert for building data-driven, premium production interfaces. Use when you need to: 1. Design complex applications (dashboards, SaaS, AI tools) from scratch 2. Generate comprehensive design systems (tokens, palettes, typography) 3. Audit existing UI for quality, accessibility, and "craft"…

saifyxpro/ui-ux-design-pro-skill · 117 tokens

playwright-best-practices

Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions…

currents-dev/playwright-best-practices-skill · 214 tokens

open-map-stack

Use textual agent instructions for GIS and geospatial work: source discovery and provenance, vector/raster/point-cloud pipelines, CRS and metric analysis, spatial SQL, routing and isochrones, QGIS projects, tile generation, and web maps. Use advanced tools and formats such as OSM, Overture, STAC, Sentinel/Landsat…

jaakla/openmapstack · 173 tokens