# Sh kb csrf

> Sh kb csrf is an open-source agent skill for security. Guides an agent through hunting cross-site request forgery flaws in web apps. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/dmdhrumilmistry/indra/tree/main/plugins/indra/skills/sh-kb-csrf
- **Repository:** https://github.com/dmdhrumilmistry/indra
- **GitHub stars:** 44
- **License:** MIT
- **Skill name:** sh-kb-csrf
- **Collection:** https://github.com/dmdhrumilmistry/indra
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-03

## About

This skill is a knowledge base for security testing of cookie-authenticated web applications against cross-site request forgery. It lists the conditions to confirm before reporting, such as a state-changing request relying on ambient credentials without an effective anti-CSRF control, and it gives grep targets and per-framework notes for Django, Flask and FastAPI, Express and Next.js, Spring, Laravel, Rails and ASP.NET.

The workflow walks the agent through checking the global protection posture, per-route exemptions, cookie SameSite flags, CORS behaviour and how tokens are validated. It also covers non-obvious state changes such as GET-based mutations, login CSRF and OAuth link callbacks, then describes variant hunting across sibling routes and false-positive filters. Defender-oriented detection signals and mitigations are included as well.

The skill is a Markdown reference with no bundled scripts. It expects an agent with access to a codebase map and the target's source or traffic, and the examples are plain HTML proof-of-concept forms.

## When your agent uses it

> 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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/dmdhrumilmistry/indra/tree/HEAD/plugins/indra/skills/sh-kb-csrf)
- [License: MIT](https://github.com/dmdhrumilmistry/indra/tree/HEAD/plugins/indra/skills/sh-kb-csrf)

## Features

- **Preconditions checklist:** Confirms a state change, cookie-based auth and missing anti-CSRF defenses before reporting.
- **Framework-specific grep targets:** Lists exemption patterns and protection defaults for common web frameworks.
- **Token validation review:** Checks whether anti-CSRF tokens are actually enforced, bound to the session and applied to all methods.
- **Non-obvious state changes:** Looks for GET mutations, login CSRF, OAuth callbacks and settings changes.
- **Defender detection signals:** Describes logs and behaviour patterns that reveal forged cross-site requests.
- **False-positive filters:** Explains when SameSite cookies, Bearer tokens or signed webhooks mitigate the risk.

## Good for

- Audit a Django or Flask app for views exempted from CSRF protection
- Check whether session cookies use SameSite settings that block cross-site POSTs
- Review a Spring Security config for disabled CSRF on session-login routes
- Find GET endpoints that change account state such as logout or unsubscribe
- Write a proof-of-concept auto-submitting form for a confirmed CSRF finding

## Install

### Claude Code

This skill ships in the `indra` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add dmdhrumilmistry/indra
/plugin install indra@indra
```

Or copy only this skill to `~/.claude/skills/sh-kb-csrf`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/dmdhrumilmistry/indra.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/sh-kb-csrf &&
cp -R "$tmp/plugins/indra/skills/sh-kb-csrf" ~/.claude/skills/sh-kb-csrf &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/sh-kb-csrf` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/sh-kb-csrf` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/dmdhrumilmistry/indra.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/sh-kb-csrf &&
cp -R "$tmp/plugins/indra/skills/sh-kb-csrf" ~/.agents/skills/sh-kb-csrf &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/sh-kb-csrf` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/sh-kb-csrf` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/dmdhrumilmistry/indra.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/sh-kb-csrf &&
cp -R "$tmp/plugins/indra/skills/sh-kb-csrf" ~/.cursor/skills/sh-kb-csrf &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/sh-kb-csrf` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/dmdhrumilmistry/indra.git --path plugins/indra/skills/sh-kb-csrf
```

Or copy the folder to `~/.gemini/skills/sh-kb-csrf` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/sh-kb-csrf`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/dmdhrumilmistry/indra.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/sh-kb-csrf &&
cp -R "$tmp/plugins/indra/skills/sh-kb-csrf" ~/.copilot/skills/sh-kb-csrf &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/sh-kb-csrf` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/dmdhrumilmistry/indra.git
```

Then copy `indra/plugins/indra/skills/sh-kb-csrf` into your agent's skills folder as `sh-kb-csrf`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need before Sh kb csrf can be used?

It expects the agent to read a codebase map and the target's endpoints and cookie settings, and it assumes a cookie-authenticated web application.

### When does the skill apply?

It is meant for hunting cross-site request forgery, and its description says to use it when hunting CSRF (CWE-352, OWASP A01:2021).

### Does Sh kb csrf cover APIs that use Bearer tokens?

It states that pure Bearer-in-header APIs are generally not CSRF-able and lists them as a false-positive filter.

### Does Sh kb csrf include scripts?

No scripts are bundled; the skill is a single SKILL.md reference document.

### How do I install Sh kb csrf in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/sh-kb-csrf to use it in all your projects, or to .claude/skills/sh-kb-csrf in one project. Or install the indra plugin, which includes it: /plugin marketplace add dmdhrumilmistry/indra, then /plugin install indra@indra.

### Does Sh kb csrf run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Sh kb csrf?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Sh kb csrf?

The closest alternatives to Sh kb csrf are Client side, Sh kb ssrf, Server side, Sh kb access control and Sh kb xss.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Client side](https://ai-powered.com/skills/client-side): Client side is an open-source agent skill for security.
- [Sh kb ssrf](https://ai-powered.com/skills/sh-kb-ssrf): Sh kb ssrf is an open-source agent skill for security.
- [Server side](https://ai-powered.com/skills/server-side): Server side is an open-source agent skill for security.
- [Sh kb access control](https://ai-powered.com/skills/sh-kb-access-control): Sh kb access control is an open-source agent skill for security.
- [Sh kb xss](https://ai-powered.com/skills/sh-kb-xss): Sh kb xss is an open-source agent skill for security.
- [Sh kb auth](https://ai-powered.com/skills/sh-kb-auth): Sh kb auth is an open-source agent skill for security.
- [Security review](https://ai-powered.com/skills/security-review-getsentry): Security review is an open-source agent skill for security.
- [Sh kb open redirect](https://ai-powered.com/skills/sh-kb-open-redirect): Sh kb open redirect is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/sh-kb-csrf
