Agent skill · security · yaklang
csrf-cross-site-request-forgery
CSRF testing playbook. Use when reviewing state-changing web flows, anti-CSRF defenses, SameSite behavior, JSON CSRF, login CSRF, and OAuth state handling.
Why this skill is useful
Adds advanced CSRF attack techniques and bypass methods that are not commonly known or documented, enhancing the AI's capability to understand and exploit CSRF vulnerabilities.
What it needs
About 8k tokens when loaded. Last updated 2026-06-16. 1,563 stars on the source repository.
What this skill does
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. 0. RELATED ROUTING Also load: cors cross origin misconfiguration when JSON endpoints become readable cross-origin oauth oidc misconfiguration when login, account linking, or callback binding relies on OAuth state --- 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: --- 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: Token Tied to Session but Not to User Token in Cookie Only When server sets CSRF token as cookie and expects it back in a header/form: Static or Predictable Token Double Submit Cookie Pattern (broken if subdomain trusted) --- 4. SAMESITE BYPASS SCENARIOS SameSite=Lax (modern browser default): cookies sent for top-level GET navigation, NOT for cross-site iframe/form POST. Bypass SameSite=Lax via GET method: Bypass via subdomain XSS (SameSite Lax/Strict): SameSite=None (legacy or explicit): cookies sent everywhere → classic CSRF applies. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills yaklang/csrf-cross-site-request-forgery