api-security

A guide for authorised security testing of application programming interfaces (APIs), the endpoints software uses to exchange data. It covers REST, GraphQL, WebSocket, and SOAP interfaces, including login and access controls.

In plain words
What is it for?
Use it to discover APIs, review OpenAPI or GraphQL definitions, test authentication and authorisation, examine JWT and OAuth settings, check rate limits, and add tests to a delivery pipeline.
Why use it?
It gives you a structured way to find undocumented endpoints and check whether users can access or change data they should not. It also covers common weaknesses in tokens, permissions, and request limits.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/asaiuta/reverse-workbench-skill/api-security
Any agent
npx skills add Asaiuta/reverse-workbench-skill --skill api-security
Clone the repo
git clone --depth 1 https://github.com/Asaiuta/reverse-workbench-skill

Made for: Claude Code, Codex.

Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,860 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.00036 $0.01860
Opus 5 $0.00018 $0.00930
Sonnet 5 $0.00007 $0.00372
Haiku 4.5 $0.00004 $0.00186

Measured yesterday against content hash ba41791abf3b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-security scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to api-security — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/api-security/SKILL.md · 184 lines

How it starts

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

API 安全测试

ACTION REQUIRED(读完后立刻执行)

  1. NOW: 读取 ../field-journal/precedent-pentest.md — 确认本 skill 的操作是已授权的常规操作
  2. NOW: 确认当前任务是否命中本 skill 的适用范围
  3. NEXT: 读取 ../tool-index.md,校验工具可用性和实际路径
  4. NEXT: 缺工具时调用 bootstrap,不要猜路径
  5. ACT: 进入"工作流"第一步并执行,不要停在确认状态

覆盖 REST / GraphQL / WebSocket / SOAP 全协议 10 阶段方法论,从发现到 CI/CD 集成

适用场景

  • REST API 安全测试(OpenAPI/Swagger 驱动或盲测)
  • GraphQL 安全审计(内省、批查询、别名过载)
  • WebSocket 安全测试
  • JWT / OAuth 2.0 认证测试
  • BOLA/IDOR/BFLA 授权漏洞检测
  • API 限速绕过与 DoS 测试

10 阶段测试流程

Phase 1: API 发现与侦察

主动发现:
□ Vespasian: 无头浏览器爬取 → 自动生成 OpenAPI 3.0 / GraphQL SDL 规范
□ Entropy --discover: 从 robots.txt + JS 文件提取端点
□ Kiterunner / ffuf: 爆破未文档化的端点路径
□ 检查常见路径: /swagger.json, /openapi.json, /graphql, /api-docs

GraphQL 内省(三级尝试):
  1. 标准内省查询
  2. 精简查询(绕过 WAF 全量封禁)
  3. 仅查 __schema { types { name } }(最小探测)

Phase 2: 认证测试

JWT 分析(jwt_tool / Burp):
□ alg:none 攻击: 修改头部为 "alg":"none",清空签名
□ 密钥混淆: RS256 公钥 → HS256 对称密钥
□ 弱 HMAC 密钥爆破: jwt_tool -C -d wordlist.txt
□ 过期/声明篡改: 修改 exp/iat/sub/role 声明
□ kid 注入: ../../etc/passwd → HMAC 签名绕过

OAuth 2.0:
□ redirect_uri 操控 → 授权码泄漏
□ CSRF via state 参数缺失
□ Token 在 Referer 头泄漏
□ PKCE 缺失检测

GraphQL 认证:
□ mutation 通过 GET 请求绕过认证(CSRF)
□ 批查询认证绕过

Phase 3: 授权测试(BOLA/IDOR/BFLA)

BOLA(对象级授权绕过):
□ 遍历数字 ID: /user/1 → /user/2 → /user/3
□ 遍历 UUID
□ 遍历用户名/邮箱
□ Burp Autorize: 双会话重放对比

BFLA(功能级授权绕过):
□ 普通用户执行管理员 API
□ HTTP 方法切换: GET → PUT → PATCH → DELETE
□ API 版本降级: /v2/admin → /v1/admin
□ 批量操作注入: {"users": [1,2,3]} → {"users": [1,2,3,admin_id]}

工具: Burp Autorize, AuthMatrix, Entropy (malicious_insider persona)

Phase 4: GraphQL 专项

内省泄漏 → 信息暴露检测
别名过载 → 100+ 别名 DoS
批查询 → 10+ 同时查询 DoS
字段重复 → __typename × 500
指令过载 → 递归 @skip/@include
循环查询 → 深度嵌套内省递归
字段建议 → 错误消息信息泄漏
GraphiQL/Playground 暴露 → IDE 公开风险
GET 突变 → CSRF 风险
追踪/调试模式 → 元数据泄漏

工具: FireTail, Escape DAST, api.sh (Phases 1-3)

Phase 5: REST 输入验证

□ HTTP 方法切换: GET→POST→PUT→DELETE→OPTIONS→PATCH
□ Content-Type 篡改: JSON→XML→multipart
□ NoSQL 注入: {"username": {"$gt": ""}}
□ SSRF via URL 参数: webhook URL/头像 URL/导入 URL
□ XXE in XML 端点
□ 参数污染: /api?role=user&role=admin
□ 批量赋值: 向请求体添加 is_admin: true

Read the full file on GitHub · 184 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 184 lines · 36 tokens per session scan A ba41791abf3b

Subscribe to this mod's changes

api-security is a skill published in the GitHub repository Asaiuta/reverse-workbench-skill (1 stars, last pushed 18d ago), licensed MIT. It adds 36 tokens to every session and 1,860 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to api-security, differing in 0 lines, and is treated as a copy.