hunt-csrf is a skill for Claude covering CSRF in the SameSite-cookie era: a raw HTTP client satisfying a naive Origin or Referer string check without a real cross-site page, SameSite=Lax sibling-subdomain bypasses, JSON endpoints reached through a text/plain body that still parses as valid JSON, GraphQL mutations driven through a GET request, and OAuth or social-account-linking flows where a missing state parameter becomes account-takeover CSRF. It also covers mobile-app CSRF through custom-scheme deeplinks.
The skill opens with a shortcut: many CSRF defenses only check the Origin or Referer header’s string value, so setting that header directly on a raw request can confirm the bug without a real attacker page. It gives a three-question validation gate, a defense-to-bypass table, and eighteen disclosed report citations from 2016 to 2024, including CVE-2024-22424 against Argo CD and CVE-2022-23732 against GitHub Enterprise Server. It is for assets covered by a program or engagement you are authorized to test.
What You Get
- A header-spoofing shortcut for CSRF defenses that only string-check the Origin or Referer header, so a raw request alone can confirm that case
- A ten-step hunting method covering endpoint mapping, SameSite cookie review, token staticness testing, and OAuth RelayState validation
- Payload templates for form-POST CSRF and
text/plainJSON CSRF, plus a defense-to-bypass table covering SameSite, double-submit cookies, and custom headers - A dedicated Duende BFF section covering role-partitioned antiforgery gaps, SignalR hub carve-outs, and cookie-domain wildcarding in ASP.NET Core backend-for-frontend deployments
- Eighteen disclosed report citations from 2016 to 2024, including CVE-2024-22424 (Argo CD), CVE-2022-23732 (GitHub Enterprise Server), and a Stripe Dashboard middleware-disabled incident
Common Use Cases
- Testing whether a naive Origin or Referer string check on a state-changing endpoint can be satisfied by setting the header directly on a raw request
- Checking whether a JSON API endpoint accepts a
text/plainbody that a cross-origin HTML form can send without triggering a CORS preflight - Reviewing an OAuth or social-account-linking callback for a missing or reused state parameter that lets an attacker force a link onto a victim’s session
What Makes It Unique
Most CSRF checklists assume a SameSite cookie default already closes the class. This skill is built around the patterns that survive that default: sibling-subdomain bypasses, GET-converted mutations, and Content-Type bypass via a text/plain body. It also opens with a practical shortcut: a naive Origin/Referer check can be confirmed with a raw HTTP client alone, saving the step of building a real attacker page when that shortcut applies, and closes with a dedicated section on the non-standard antiforgery model in Duende BFF.
Under The Hood
The skill is a single SKILL.md of guidance with no bundled scripts. Following it, the agent sends HTTP requests with spoofed Origin and Referer headers and crafted Content-Type bodies to state-changing endpoints, compares CSRF token values across sessions, and writes small HTML proof-of-concept files that auto-submit a cross-origin form for browser-based confirmation. Use it only against assets you are authorized to test.