跳到正文
FunCoding

web-auth-bypass-idor

Broken access control - IDOR, privilege escalation, JWT abuse, mass assignment, forced browsing - for web apps and APIs. Use on any multi-user or role-based app with object IDs, tokens, or admin functionality. Triggers - /api/users/<id>, /orders/<id>, ?account=/uid=/doc=, JWT (eyJ...), role/isAdmin field, admin panel, "403 Forbidden", numeric or guessable object references.

Star
1,278
许可证
MIT
最近提交
2026年11月30日

skills/web/auth-bypass-idor/SKILL.md

在 GitHub 上查看

Broken Access Control (IDOR / privesc / JWT / mass-assignment)

When this fires

Any app with per-object endpoints, user roles, tokens, or admin functions — the most common (and highest-scoring) web bug class.

Decide — which sub-class

  • Object ID in URL/param/body → IDOR (swap it).
  • JWT / signed token → JWT abuse.
  • Object accepts fields you shouldn't set (role,isAdmin,is_verified) → mass assignment.
  • Admin path returns 403 to you → forced browsing / vertical privesc.

Detect → Exploit → PROVE IMPACT

IDOR:  authenticate as user A; hit A's /api/orders/1001 → change to 1002/other IDs (incl. UUIDs seen elsewhere,
       decremented, from another account). Also flip method (GET→PUT/DELETE) and try without auth.
       PROVE: read/modify ANOTHER user's data.
Mass assignment: add {"role":"admin","isAdmin":true,"userId":<victim>} to a profile/update/signup body.
       PROVE: your account gains a privilege the UI never grants.
Forced browsing / method: request admin endpoints directly; try X-Original-URL / X-Rewrite-URL / trailing
       /./ /%2e/ ; verb tampering (HEAD/OPTIONS); 403-bypass headers (X-Forwarded-For 127.0.0.1).
       PROVE: reach an admin function as a low-priv/anon user.

JWT (drive with jwt_analyze, then forge):

alg:none      → header {"alg":"none"}, drop signature, set {"admin":true}/{"role":"admin"}
weak HMAC     → crack the secret (hashcat -m 16500 <jwt> wordlist) → re-sign with the new claims
alg confusion → RS256→HS256 signing the token with the PUBLIC key as the HMAC secret
kid / jku / x5u → path-traversal/SSRF the key source to one you control

Proof required: access to another user's data, or a forged/tampered token that authenticates you as admin and reaches a privileged action.

Tooling

jwt_analyze for token analysis; Burp/ffuf to sweep object IDs; nuclei -tags idor,jwt,exposure.

False positives / pitfalls

  • Server re-checks ownership after the swap (returns 403/empty) → not IDOR; try other IDs/methods.
  • Random UUIDs with no leak → IDOR may need an ID-disclosure primitive first.
  • "alg:none" rejected by a patched lib → move to weak-secret / confusion / kid.

2024-2025 additions

New JWT attacks

  • x5c / x5t#S256 / jwk header injection: Embed malicious JWK / X.509 cert in token header → library trusts it. kid + jwk mismatch bypass.
  • JWT crit (critical) header abuse: {"crit":["exp"],"exp":<far-future>} — some libs ignore unknown crit values, allowing exp bypass.
  • JWE (encrypted JWT) key confusion: alg: dir (direct key) + enc: A256GCM — if server uses same key for JWS and JWE, encrypt with known key.
  • OAuth 2.0 token exchange (RFC 8693): grant_type=urn:ietf:params:oauth:grant-type:token-exchange → request token for another user/resource. Check token_endpoint supports it.
  • OIDC prompt=none silent auth bypass: prompt=none&response_type=id_token — if session exists, returns ID token without consent. Combine with IDOR on sub.

IDOR at scale

  • GraphQL: __typename + id (Relay Global Object ID) → base64(Type:id) → decode → modify id → re-encode. graphql-cop / inQL for schema introspection + IDOR testing.
  • REST / API pagination: /api/users?page=1&limit=100 → iterate pages → harvest all IDs. /api/users?fields=id,email → leak PII.
  • Mobile API / GraphQL: Often less protected than web — test mobile endpoints (/api/v2/, /graphql/mobile).

Forced browsing / 403 bypass (2024)

  • Header injection: X-Original-URL: /admin, X-Rewrite-URL: /admin, X-Custom-IP-Authorization: 127.0.0.1, X-Forwarded-For: 127.0.0.1, X-Forwarded-Host: localhost.
  • Trailing path tricks: /admin/, /admin/., /admin/%2e/, /admin..;/, /admin%20/.
  • Verb tampering: HEAD /admin, OPTIONS /admin, PATCH /admin — some frameworks skip auth on non-GET/POST.
  • Protocol downgrade: HTTP/1.1 → HTTP/1.0 (Connection: close) or HTTP/2 (h2c cleartext) — some WAFs only inspect h2.

Mass assignment (2024)

  • Nested object mass assignment: {"user":{"role":"admin"}}, {"profile":{"isAdmin":true}}, {"settings":{"permissions":["*"]}}.
  • JSON patch / RFC 6902: PATCH /api/user/123 with [{"op":"replace","path":"/role","value":"admin"}] — some APIs accept JSON Patch.

Tooling

  • jwt_analyze (built-in): alg confusion, weak secret, kid/jku/x5u, x5c/jwk.
  • nuclei -tags idor,jwt,exposure (2024 templates): idor-api, jwt-alg-none, jwt-alg-confusion, jwt-weak-secret, mass-assignment.
  • jwt-hacker / jwt_tool (Python): Automated JWT attack suite.
  • graphql-cop / inQL / GraphQL Voyager: Schema + IDOR testing.
  • autoidor / idor-fuzzer: Automated IDOR discovery via ID correlation.

相似的 Skill

精选

pptx

生成、读取和修改演示文稿,也能合并拆分幻灯片。

ANanthropics/skills203k近 7 天新增 2,822 个 star

精选

docx

创建和编辑 Word 文档,支持目录、页码、页眉等排版。

ANanthropics/skills203k近 7 天新增 2,822 个 star

精选

pdf

提取文本和表格、合并拆分、填写表单,也能对扫描件做 OCR。

ANanthropics/skills203k近 7 天新增 2,822 个 star

精选

doc-coauthoring

按步骤协作撰写技术方案、提案和决策文档,逐轮修改。

ANanthropics/skills203k近 7 天新增 2,822 个 star

精选

xlsx

读写 Excel 和 CSV,处理公式、格式、图表与数据清洗。

ANanthropics/skills203k近 7 天新增 2,822 个 star

精选

canvas-design

按设计理念生成海报和视觉作品,输出 PNG 或 PDF。

ANanthropics/skills203k近 7 天新增 2,822 个 star