csrf

A security review for cross-site request forgery, an attack where a logged-in browser sends unwanted changes to a website using its saved session cookies.

In plain words
What is it for?
It locates these actions, examines their anti-forgery protections, and records the results for review.
Why use it?
It helps find state-changing actions that another site could trigger, such as changing a password, moving money, changing roles, or deleting records.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/emre-guler/websec/csrf
Any agent
npx skills add emre-guler/websec --skill csrf
Clone the repo
git clone --depth 1 https://github.com/emre-guler/websec

Made for: Claude Code, Codex.

Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,085 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00080 $0.06085
Opus 5 $0.00040 $0.03043
Sonnet 5 $0.00016 $0.01217
Haiku 4.5 $0.00008 $0.00609

Measured 2d ago against content hash 1e7dc28a8039, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

csrf scanned grade A with 0 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/csrf/SKILL.md · 176 lines

How it starts

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

Cross-Site Request Forgery Detection

Overview

Cross-site request forgery abuses ambient authority: the browser attaches the victim's session cookies to any request aimed at the application's domain, so a request generated by an attacker's page arrives fully authenticated and indistinguishable from a real one. The attacker cannot read the response — the same-origin policy still blocks that — so the goal is purely the side effect: change the account email and then take it over through password reset, change a password directly, move money, grant a role, delete a record. The attacker is a remote third party whose only requirement is that the victim visits an attacker-controlled or attacker-influenced page while their session is alive; when the victim is an administrator, forged administrative actions can compromise the whole application. Three conditions must hold for a request to be forgeable: a worthwhile state change, cookie-based session handling, and no request parameter the attacker cannot predict. This skill locates every state-changing entry point together with whatever defence claims to protect it, checks each one in parallel, and merges results into <output_dir>/csrf-results.md.

What it is NOT

  • Cross-site scripting (/websec:xss): XSS runs attacker script inside the application's origin and can read responses — including reading a valid anti-forgery token straight out of the DOM, which defeats token defences entirely. Test: if the attacker executes JavaScript in the target's origin, it is XSS; if they can only cause a blind request from outside, it is this class. Report an XSS that trivially defeats the token under "Also observed" and let /websec:xss own it.
  • Cross-origin resource sharing misconfiguration (/websec:cors): the two are constantly conflated in both directions. A permissive response header lets an attacker read a cross-origin response; it neither creates nor prevents forgery, and forgery needs no such header because a plain HTML form suffices. Test: does the attack depend on reading the body? Then it is /websec:cors.
  • Clickjacking (/websec:clickjacking): the victim performs a real click on the authentic page inside a hidden frame, so the page supplies its own valid token. Test: does the attack require victim interaction with a framed copy of the real page? Then framing controls, not tokens, are the fix, and it belongs there.
  • Broken access control (/websec:access-control): if the action should have been refused for this caller regardless of how the request was produced, the missing control is authorisation. Forgery assumes the victim is authorised and the attacker borrows that authority.
  • Authorisation-code and state-parameter flaws (/websec:oauth): a missing state on a redirect-based authorisation flow is that skill's forgery variant, not this one.
  • Open redirection (/websec:open-redirect): being bounced to an attacker's destination after the endpoint ran is that class; arriving at the endpoint cross-site and having it act is this one. Test: is the harm that the request fired without the victim's intent (here), or that a request-supplied next decided where the browser went afterwards (there)? A state-changing GET carrying a return parameter is often both — judge each half in its own skill.
  • Cross-site socket hijacking (/websec:websockets): a handshake the attacker's page opens cross-site gives a two-way channel it can also read, and anti-forgery tokens play no part in the upgrade. Test: is the forged thing a cross-site request to an HTTP endpoint (here), or a cross-site socket handshake (there)?
  • Ambient authority decided upstream: whether a browser's cookies ever reach this service can be a property of the deployment rather than of this code — a hop may terminate the browser session and forward a bearer credential, or pass the cookie straight through. Read the "Enforced where" column and the trust-boundary section of architecture.md before concluding either way, and where the answer cannot be read, classify NEEDS MANUAL REVIEW naming that configuration rather than reporting every mutating route. What is judged here: if cookies do arrive, this service needs a check of its own — an origin rule enforced at the edge is a control to read and judge, never one to assume.
  • Not a finding: a genuinely side-effect-free GET; an endpoint that requires a secret the attacker cannot predict or obtain (a per-record nonce, a current-password field, a one-time code, a value that must be read from the current response); an action gated by re-authentication or step-up verification; a request that carries no ambient credential at all because authentication is a bearer token held in memory and attached by application code — note that a token stored in a cookie and attached automatically is ambient; an internal endpoint reachable only from a network the browser cannot address.

Read the full file on GitHub · 176 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. 2d ago First seen · 176 lines · 80 tokens per session scan A 1e7dc28a8039

Subscribe to this mod's changes

csrf is a skill published in the GitHub repository emre-guler/websec (2 stars, last pushed 5d ago), licensed MIT. It adds 80 tokens to every session and 6,085 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

vantage

Autonomous, artifact-driven SAST (Static Application Security Testing) for web AND mobile app repositories, plus optional code-level remediation. Use whenever the user asks to security-review, pentest, audit, or scan a codebase for vulnerabilities — web (SQLi, XSS, IDOR/BOLA, auth bypass, SSRF, XXE, hardcoded secrets…

tinoimammp/vantage-security-agent · 230 tokens

prowler-compliance

Creates, syncs, audits and manages Prowler compliance frameworks end-to-end. Covers the two supported JSON schemas (universal multi-provider and legacy per-provider), the SDK model tree (legacy attribute classes, universal ComplianceFramework, ConfigRequirements guardrails), output formatters (legacy per-framework +…

prowler-cloud/prowler · 227 tokens

prowler-ui

Prowler UI-specific patterns. For generic patterns, see: typescript, react-19, nextjs-16, tailwind-4. Trigger: When working inside ui/ on Prowler-specific conventions (shadcn, folder placement, actions/adapters, shared types/hooks/lib).

prowler-cloud/prowler · 64 tokens

prowler-pr

Creates Pull Requests for Prowler following the project template and conventions. Trigger: When working on pull request requirements or creation (PR template sections, PR title Conventional Commits check, changelog gate/no-changelog label), or when inspecting PR-related GitHub workflows like conventional-commit.yml…

prowler-cloud/prowler · 84 tokens

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens

prowler-ci

Helps with Prowler repository CI and PR gates (GitHub Actions workflows). Trigger: When investigating CI checks failing on a PR, PR title validation, changelog gate/no-changelog label, conflict marker checks, secret scanning, CODEOWNERS/labeler automation, or anything under .github/workflows.

prowler-cloud/prowler · 67 tokens