Sh Kb Csrf logo

Sh Kb Csrf

Community
dmdhrumilmistry
sh-kb-csrf

Knowledge base for finding Cross-Site Request Forgery - state-changing requests that rely only on ambient credentials (cookies) with no anti-CSRF token or SameSite protection. Use when hunting CSRF. CWE-352, OWASP A01:2021-Broken Access Control.

Overview

Publisherdmdhrumilmistry
Repositorysecurity-harness
Skill namesh-kb-csrf
Stars
42
Forks
11
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dmdhrumilmistry on GitHub. Read the source before you install it.

Installation

Install the Sh Kb Csrf AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-csrf
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmdhrumilmistry/security-harness.git /tmp/security-harness
mkdir -p .claude/skills
cp -r /tmp/security-harness/plugins/security-harness/skills/sh-kb-csrf .claude/skills/sh-kb-csrf
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sh Kb Csrf in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sh Kb Csrf on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sh Kb Csrf is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Cross-Site Request Forgery (CSRF) - Hunter Knowledge Base

A logged-in victim's browser is tricked into sending a state-changing request; the app trusts the ambient cookie and performs the action as the victim. Requires cookie-based auth and a missing anti-CSRF control.

Preconditions to confirm first

  1. The endpoint performs a state change (create/update/delete/transfer/settings).
  2. Auth is via ambient credentials (session cookie / HTTP Basic), not a per-request header token that JS must attach (Authorization: Bearer) - pure Bearer-in-header APIs are generally not CSRF-able.
  3. There is no effective anti-CSRF defense on that route.

Sinks / patterns (grep targets)

State-changing route handlers (POST/PUT/PATCH/DELETE, or GET that mutates) that:

  • lack CSRF middleware/decorator, or explicitly disable it: csrf_exempt, @csrf.exempt, skip_before_action :verify_authenticity_token, csrf: false, Spring .csrf().disable(), Express without csurf, SameSite=None/absent on the session cookie.
  • Grep: csrf_exempt|verify_authenticity_token|csrf().disable|csurf|SameSite|@csrf.

Detection recipe

  1. From codebase-map.json, list state-changing endpoints and their auth mechanism.
  2. Check the global CSRF posture: is protection enabled framework-wide? Then find per-route exemptions.
  3. Check cookie flags: SameSite=Lax/Strict blocks most cross-site POSTs; SameSite=None re-opens it.
  4. Confirm the endpoint doesn't already require a non-ambient token or a custom header (which forces a preflight and blocks simple cross-site requests).

Payloads / PoC

  • Auto-submitting form: an HTML page with <form action="https://target/settings" method="POST"> and hidden inputs, plus <script>document.forms[0].submit()</script>; victim visiting it triggers the action.
  • For JSON endpoints that accept text/plain or don't check content-type: a form with enctype="text/plain" crafting a JSON-ish body.
  • GET-based state change: <img src="https://target/delete?id=5">.
  • PoC = the victim, while logged in, loads the attacker page and the state change occurs.

False-positive filters

  • Anti-CSRF token required and validated (synchronizer token, double-submit cookie) on the route.
  • SameSite=Lax (default in modern browsers) or Strict on the session cookie - mitigates most CSRF; note residual risk for top-level GET navigations under Lax.
  • Auth is a header token the browser won't auto-attach cross-site (Bearer), not a cookie.
  • Endpoint requires a custom header (forces CORS preflight) and CORS is not permissive.

CWE / OWASP / severity

CWE-352. OWASP A01:2021. Severity by action impact: account/email/password change or money transfer -> high; low-value toggles -> medium/low.

Chaining hints

CSRF + xss (steal token then forge) ; CSRF to change email/password -> account takeover; CSRF to add an attacker OAuth/app -> persistence; often combined with access-control to hit privileged actions.

Mitigation

Enable framework CSRF protection on all state-changing routes (don't blanket-exempt); require a synchronizer or double-submit token; set session cookies SameSite=Lax/Strict + Secure; prefer non-ambient auth for APIs; require a custom header for JSON APIs and lock down CORS.

Frequently asked questions

What does the Sh Kb Csrf AI skill do?

Knowledge base for finding Cross-Site Request Forgery - state-changing requests that rely only on ambient credentials (cookies) with no anti-CSRF token or SameSite protection. Use when hunting CSRF. CWE-352, OWASP A01:2021-Broken Access Control.

Why use Sh Kb Csrf on TypingMind?

Because you install it once and use it with any model. Sh Kb Csrf is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sh Kb Csrf in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-csrf. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sh Kb Csrf?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sh Kb Csrf?

As many as you like. As long as a model supports skills, you can use Sh Kb Csrf with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sh Kb Csrf AI skill free?

Yes. It is published on GitHub by dmdhrumilmistry under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇