@aegis-scan/skills 0.1.1

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.
Files changed (69) hide show
  1. package/ATTRIBUTION.md +75 -0
  2. package/CHANGELOG.md +129 -0
  3. package/LICENSE +21 -0
  4. package/README.md +123 -0
  5. package/dist/bin.d.ts +3 -0
  6. package/dist/bin.d.ts.map +1 -0
  7. package/dist/bin.js +122 -0
  8. package/dist/bin.js.map +1 -0
  9. package/dist/commands/info.d.ts +5 -0
  10. package/dist/commands/info.d.ts.map +1 -0
  11. package/dist/commands/info.js +75 -0
  12. package/dist/commands/info.js.map +1 -0
  13. package/dist/commands/install.d.ts +7 -0
  14. package/dist/commands/install.d.ts.map +1 -0
  15. package/dist/commands/install.js +87 -0
  16. package/dist/commands/install.js.map +1 -0
  17. package/dist/commands/list.d.ts +7 -0
  18. package/dist/commands/list.d.ts.map +1 -0
  19. package/dist/commands/list.js +82 -0
  20. package/dist/commands/list.js.map +1 -0
  21. package/dist/index.d.ts +13 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +13 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/skills-loader.d.ts +23 -0
  26. package/dist/skills-loader.d.ts.map +1 -0
  27. package/dist/skills-loader.js +213 -0
  28. package/dist/skills-loader.js.map +1 -0
  29. package/package.json +63 -0
  30. package/skills/defensive/README.md +9 -0
  31. package/skills/mitre-mapped/README.md +10 -0
  32. package/skills/offensive/snailsploit-fork/advanced-redteam/SKILL.md +148 -0
  33. package/skills/offensive/snailsploit-fork/ai-security/SKILL.md +592 -0
  34. package/skills/offensive/snailsploit-fork/basic-exploitation/SKILL.md +10783 -0
  35. package/skills/offensive/snailsploit-fork/bug-identification/SKILL.md +1256 -0
  36. package/skills/offensive/snailsploit-fork/crash-analysis/SKILL.md +12466 -0
  37. package/skills/offensive/snailsploit-fork/deserialization/SKILL.md +185 -0
  38. package/skills/offensive/snailsploit-fork/edr-evasion/SKILL.md +1806 -0
  39. package/skills/offensive/snailsploit-fork/exploit-dev-course/SKILL.md +428 -0
  40. package/skills/offensive/snailsploit-fork/exploit-development/SKILL.md +699 -0
  41. package/skills/offensive/snailsploit-fork/fast-checking/SKILL.md +487 -0
  42. package/skills/offensive/snailsploit-fork/file-upload/SKILL.md +822 -0
  43. package/skills/offensive/snailsploit-fork/fuzzing/SKILL.md +340 -0
  44. package/skills/offensive/snailsploit-fork/fuzzing-course/SKILL.md +2105 -0
  45. package/skills/offensive/snailsploit-fork/graphql/SKILL.md +209 -0
  46. package/skills/offensive/snailsploit-fork/idor/SKILL.md +608 -0
  47. package/skills/offensive/snailsploit-fork/initial-access/SKILL.md +1528 -0
  48. package/skills/offensive/snailsploit-fork/jwt/SKILL.md +276 -0
  49. package/skills/offensive/snailsploit-fork/keylogger-arch/SKILL.md +197 -0
  50. package/skills/offensive/snailsploit-fork/mitigations/SKILL.md +1351 -0
  51. package/skills/offensive/snailsploit-fork/oauth/SKILL.md +366 -0
  52. package/skills/offensive/snailsploit-fork/open-redirect/SKILL.md +487 -0
  53. package/skills/offensive/snailsploit-fork/osint/SKILL.md +399 -0
  54. package/skills/offensive/snailsploit-fork/osint-methodology/SKILL.md +434 -0
  55. package/skills/offensive/snailsploit-fork/parameter-pollution/SKILL.md +595 -0
  56. package/skills/offensive/snailsploit-fork/race-condition/SKILL.md +881 -0
  57. package/skills/offensive/snailsploit-fork/rce/SKILL.md +1069 -0
  58. package/skills/offensive/snailsploit-fork/request-smuggling/SKILL.md +773 -0
  59. package/skills/offensive/snailsploit-fork/shellcode/SKILL.md +477 -0
  60. package/skills/offensive/snailsploit-fork/sqli/SKILL.md +372 -0
  61. package/skills/offensive/snailsploit-fork/ssrf/SKILL.md +830 -0
  62. package/skills/offensive/snailsploit-fork/ssti/SKILL.md +349 -0
  63. package/skills/offensive/snailsploit-fork/vuln-classes/SKILL.md +1229 -0
  64. package/skills/offensive/snailsploit-fork/waf-bypass/SKILL.md +820 -0
  65. package/skills/offensive/snailsploit-fork/windows-boundaries/SKILL.md +15153 -0
  66. package/skills/offensive/snailsploit-fork/windows-mitigations/SKILL.md +14546 -0
  67. package/skills/offensive/snailsploit-fork/xss/SKILL.md +784 -0
  68. package/skills/offensive/snailsploit-fork/xxe/SKILL.md +996 -0
  69. package/skills/ops/README.md +6 -0
@@ -0,0 +1,608 @@
1
+ <!-- aegis-local: forked 2026-04-23 from SnailSploit/Claude-Red@c74d53e2938b59f111572e0819265a1e73029393; attribution preserved, see ATTRIBUTION.md -->
2
+
3
+ # SKILL: Insecure Direct Object References (IDOR)
4
+
5
+ ## Metadata
6
+ - **Skill Name**: idor
7
+ - **Folder**: offensive-idor
8
+ - **Source**: https://github.com/SnailSploit/offensive-checklist/blob/main/idor.md
9
+
10
+ ## Description
11
+ IDOR (Insecure Direct Object Reference) testing checklist: object ID enumeration, horizontal/vertical privilege escalation, GUID predictability, indirect references via hashes, chained IDOR, and API endpoint IDOR. Use for web app pentests and bug bounty IDOR discovery.
12
+
13
+ ## Trigger Phrases
14
+ Use this skill when the conversation involves any of:
15
+ `IDOR, insecure direct object reference, horizontal privilege escalation, vertical privilege escalation, object enumeration, GUID, API IDOR, mass assignment, broken access control`
16
+
17
+ ## Instructions for Claude
18
+
19
+ When this skill is active:
20
+ 1. Load and apply the full methodology below as your operational checklist
21
+ 2. Follow steps in order unless the user specifies otherwise
22
+ 3. For each technique, consider applicability to the current target/context
23
+ 4. Track which checklist items have been completed
24
+ 5. Suggest next steps based on findings
25
+
26
+ ---
27
+
28
+ ## Full Methodology
29
+
30
+ # Insecure Direct Object References (IDOR)
31
+
32
+ ## Shortcut
33
+
34
+ ```mermaid
35
+ flowchart LR
36
+ A[Create Test Accounts] --> B[Discover Features]
37
+ B --> C[Intercept Traffic]
38
+ C --> D[Switch IDs in Requests]
39
+ D --> E{IDOR Found?}
40
+ E -->|Yes| F[Document Vulnerability]
41
+ E -->|No| G[Try Protection Bypass]
42
+ G --> H[Monitor Information Leaks]
43
+ ```
44
+
45
+ - Create two accounts for each application role and designate one as the attacker account and the other as the victim account.
46
+ - Discover features in the application that might lead to IDOR. Pay attention to features that return sensitive information or modify user data.
47
+ - Revisit the features you discovered in step 2. With a proxy, intercept your browser traffic while you browse through the sensitive functionalities.
48
+ - With a proxy, intercept each sensitive request and switch out the IDs that you see in the requests. If switching out IDs grants you access to other user's information or lets you change their data, this indicates an IDOR.
49
+ - Don't despair if the application seems to be immune to IDOR. Use this opportunity to try a protection bypass technique. If the application uses an encoded, hashed, or randomized ID, you can try decoding, or predicting the IDs. You can also try supplying the application with an ID when it does not ask for one. Finally, sometimes changing the request method type or file type makes all the difference.
50
+ - Monitor for information leaks in export files, email, and other text alerts. An IDOR now might lead to an information leak in the future.
51
+
52
+ ## Mechanisms
53
+
54
+ ```mermaid
55
+ flowchart TD
56
+ A[IDOR Vulnerabilities] --> B[Missing Authorization Checks]
57
+ A --> C[Client-Side ID Transmission]
58
+ A --> D[Predictable Resource Identifiers]
59
+ A --> E[Insufficient Access Control Logic]
60
+ A --> F[Improper Session Handling]
61
+ A --> G[Reliance on Obfuscation]
62
+
63
+ B --> H[Horizontal Access Control Failures]
64
+ C --> H
65
+ D --> I[Vertical Access Control Failures]
66
+ E --> I
67
+ F --> J[Context-Dependent Access Control Failures]
68
+ G --> J
69
+ ```
70
+
71
+ Insecure Direct Object References (IDOR) occur when an application exposes a reference to an internal implementation object without sufficient access control. These vulnerabilities allow attackers to manipulate these references to access unauthorized data or perform unauthorized actions.
72
+
73
+ IDOR vulnerabilities arise from flawed access control mechanisms that fail to validate whether a user should have permission to access or modify a specific resource. The core implementation issues include:
74
+
75
+ - **Missing Authorization Checks**: No validation of user permissions when accessing objects
76
+ - **Client-Side ID Transmission**: Relying on client-provided identifiers without server-side verification
77
+ - **Predictable Resource Identifiers**: Sequential or easily guessable object references
78
+ - **Insufficient Access Control Logic**: Authentication without proper authorization
79
+ - **Improper Session Handling**: Not binding resources to user sessions
80
+ - **Reliance on Obfuscation**: Using complex identifiers without actual access control
81
+
82
+ IDORs manifest in various patterns:
83
+
84
+ - **Horizontal Access Control Failures**: Accessing resources belonging to other users of the same privilege level
85
+ - **Vertical Access Control Failures**: Accessing resources requiring higher privileges
86
+ - **Context-Dependent Access Control Failures**: Access based on improper contextual states
87
+
88
+ ## Hunt
89
+
90
+ ### Identifying IDOR Vulnerabilities
91
+
92
+ #### Preparation
93
+
94
+ 1. **Create Multiple Test Accounts**:
95
+ - Set up accounts with different privilege levels (e.g., regular user, premium user)
96
+ - Create multiple accounts within the same privilege level
97
+
98
+ 2. **Establish Baseline Behavior**:
99
+ - Document normal resource access patterns
100
+ - Map all application endpoints that reference objects
101
+ - Identify resource identifiers in requests
102
+ - Evaluate caching headers (ETag/Last-Modified) that can leak existence side‑channels during enumeration
103
+
104
+ 3. **Request Capture Setup**:
105
+ - Configure a proxy (e.g., Burp Suite, OWASP ZAP)
106
+ - For mobile applications, install the proxy’s CA certificate on the device or emulator (e.g., with mitmproxy or Burp Mobile Assistant) so HTTPS traffic can be intercepted.
107
+ - Record all interactions with resource identifiers
108
+ - Create an inventory of potential IDOR test targets
109
+
110
+ #### Finding IDOR Vulnerabilities
111
+
112
+ 1. **Request Parameter Analysis**:
113
+ - Look for identifiers in URLs, request bodies, cookies, and headers
114
+ - Common parameter names:
115
+ ```
116
+ id, user_id, account_id, file, doc, document, record, item, order, number, profile,
117
+ edit, view, filename, object, num, key, userid, uuid, group, role
118
+ ```
119
+ - Watch for identifiers hidden in JWT claims (`sub`, `org_id`) or signed cookies; tamper if server fails to re‑authorize.
120
+
121
+ 2. **Parameter Manipulation Techniques**:
122
+ - **Direct Modification**: Change numerical IDs (e.g., `id=1` → `id=2`)
123
+ - **Add Missing IDs**: Try adding relevant IDs (e.g., `user_id`, `account_id`) to requests that don't initially have them (e.g., `GET /api/messages` → `GET /api/messages?user_id=<victim_uuid>`). Parameter names can often be inferred from other requests or discovered using tools like Arjun.
124
+ - **GUID/UUID Replacement**: Replace one user's GUID with another's
125
+ - **Decode and Modify**: Decode base64/hex encoded parameters before modification
126
+ - **Array/Object Manipulation**: Add or modify array elements in API requests
127
+ ```json
128
+ {"items": [{"id": 123, "owner": "victim"}]} → {"items": [{"id": 456, "owner": "attacker"}]}
129
+ ```
130
+ - **File Type Manipulation**: Try changing requested file types or appending extensions (e.g., `.json`, `.xml`, `.config`). Ruby applications might respond differently to `/resource/123` vs `/resource/123.json`.
131
+ - **Wildcard Testing**: Replace IDs with wildcards (e.g., `GET /api/users/*`). Rare, but worth trying.
132
+ - **Array-based Access**: Try wrapping IDs in arrays (e.g., `{"id":19}` → `{"id":[19]}`).
133
+ - **JSON Object Wrapping**: Try wrapping the ID in a nested JSON object (e.g., `{"id":111}` → `{"id":{"id":111}}`).
134
+ - **Numeric vs Non-Numeric IDs**: If the application uses non-numeric IDs (GUIDs, usernames), try substituting them with potential numeric equivalents (e.g., `account_id=UUID` → `account_id=123`).
135
+ - **Parameter Name Replacement**: Try alternative parameter names (e.g., album_id → account_id). Fuzz JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) bodies for cross‑user modifications.
136
+
137
+ - **Multiple Value Testing**: Supply multiple values for same parameter (e.g., `id=123&id=456`, `user_id=attacker_id&user_id=victim_id`, `user_id=attacker_id[]&user_id=victim_id[]`). See HTTP Parameter Pollution under Bypass Techniques.
138
+ - **New Feature Focus**: Pay special attention to newly added features as they may have weaker access controls; include mobile and older API versions.
139
+ - **Cache Probing**: Use CDN cache keys and `If-None-Match` probing to infer existence without full access.
140
+
141
+ 3. **Endpoint Analysis Questions**:
142
+ For each endpoint receiving an object ID, ask:
143
+ - Does this ID reference a private or sensitive resource (vs. public)?
144
+ - What are _my_ legitimate IDs for this type of resource?
145
+ - What are the different user roles interacting with this API? (user, admin, manager, etc.)
146
+
147
+ 4. **Hidden Parameter Discovery**:
148
+ - Analyze JavaScript client-side code for hidden parameters
149
+ - Check mobile app API communications
150
+ - Examine response data for additional identifiable references
151
+
152
+ 5. **Web Socket Discovery**:
153
+ - Identify how websockets are being initiated
154
+ - Check if we can manipulate it to change anything
155
+ - Make sure to test mobile/desktop applications of the target as well
156
+ - Inspect mobile deep links and intent filters that include object IDs; try cross‑app invocation.
157
+
158
+ 6. **Testing Methodology**:
159
+ 1. Access resource as User A and capture the request
160
+ 2. Note all identifiers (explicit and obfuscated)
161
+ 3. Log in as User B
162
+ 4. Replay User A's request with User B's session
163
+ 5. Modify identifiers to access resources belonging to other users
164
+ 6. Test both read and write operations(and all other application boundaries)
165
+ 7. if there are mobile applications create a unique user for that platform as well and test IDOR
166
+
167
+ ### Advanced IDOR Testing Techniques
168
+
169
+ ```mermaid
170
+ mindmap
171
+ root((IDOR Testing))
172
+ ::icon(fa fa-bug)
173
+ style root fill:#f96,stroke:#333,stroke-width:2px
174
+
175
+ id1(Blind Detection)
176
+ ::icon(fa fa-eye-slash)
177
+ style id1 fill:#bbf,stroke:#33f,stroke-width:1px
178
+ id1.1[Comparative Response Analysis]
179
+ style id1.1 fill:#ddf,stroke:#33f
180
+ id1.2[Out-of-Band Detection]
181
+ style id1.2 fill:#ddf,stroke:#33f
182
+ id1.3[Side-Channel Analysis]
183
+ style id1.3 fill:#ddf,stroke:#33f
184
+
185
+ id2(Mass Testing)
186
+ ::icon(fa fa-rocket)
187
+ style id2 fill:#fbf,stroke:#939,stroke-width:1px
188
+ id2.1[Automated Identifier Enumeration]
189
+ style id2.1 fill:#fdf,stroke:#939
190
+ id2.2[Parallel Testing with Burp]
191
+ style id2.2 fill:#fdf,stroke:#939
192
+ id2.3[Pattern Recognition]
193
+ style id2.3 fill:#fdf,stroke:#939
194
+
195
+ id3(Protection Bypass)
196
+ ::icon(fa fa-shield)
197
+ style id3 fill:#bfb,stroke:#393,stroke-width:1px
198
+ id3.1[ID Obfuscation Bypass]
199
+ style id3.1 fill:#dfd,stroke:#393
200
+ id3.2[Access Control Bypass]
201
+ style id3.2 fill:#dfd,stroke:#393
202
+ id3.3[Reference Leakage Exploitation]
203
+ style id3.3 fill:#dfd,stroke:#393
204
+ ```
205
+
206
+ #### Blind IDOR Detection
207
+
208
+ 1. **Comparative Response Analysis**:
209
+ - Compare responses between valid and invalid resource IDs
210
+ - Look for subtle differences in response times, sizes, or error messages
211
+ - Use automated tools to detect variations across multiple requests
212
+
213
+ 2. **Out-of-Band Detection**:
214
+ - Inject tracking URLs in modifiable parameters
215
+ - Monitor for callbacks when the resource is accessed
216
+ - Use server callbacks to detect successful access
217
+
218
+ 3. **Side-Channel Analysis**:
219
+ - Analyze network traffic for additional clues
220
+ - Look for timing differences or response size variations
221
+
222
+ #### Mass IDOR Testing
223
+
224
+ 1. **Automated Identifier Enumeration**:
225
+
226
+ ```python
227
+ import requests
228
+
229
+ session = requests.Session()
230
+ # Login code here...
231
+
232
+ # Test range of IDs
233
+ for id in range(1, 1000):
234
+ response = session.get(f"https://example.com/api/documents/{id}")
235
+ if response.status_code == 200:
236
+ print(f"Found accessible document: {id}")
237
+ # Log response for later analysis
238
+ ```
239
+
240
+ 2. **Parallel Testing with Burp**:
241
+ - Use number payloads for sequential IDs (test large ranges, e.g., 100-1000+).
242
+ - Use custom word lists for GUIDs/UUIDs from observed patterns
243
+ - Set up Grep Match rules to identify successful access
244
+
245
+ 3. **Pattern Recognition**:
246
+ - Analyze response patterns for common IDOR signatures
247
+ - Look for repeated or predictable access patterns
248
+
249
+ ## Bypass Techniques
250
+
251
+ ### ID Obfuscation Bypass
252
+
253
+ - **Hashed IDs**: Collect legitimate hashed IDs and map to users
254
+ - **Encoded IDs**: Decode base64/hex encodings and modify values
255
+ ```
256
+ /api/document/MjQ2 (base64 of "246") → /api/document/MjQ3 (base64 of "247")
257
+ ```
258
+ - **Encrypted IDs**: Identify encryption patterns and test related IDs
259
+
260
+ ### Access Control Bypass
261
+
262
+ - **HTTP Method Switching**: Change GET to POST or PUT
263
+ ```
264
+ GET /api/users/123 → POST /api/users/123
265
+ ```
266
+ - **Content-Type Manipulation**: Modify content-type headers
267
+ ```
268
+ Content-Type: application/json → Content-Type: application/xml
269
+ ```
270
+ - **Parameter Pollution (HTTP)**: Add duplicate parameters with different values. The server might prioritize the first or last occurrence differently.
271
+ ```
272
+ GET /api/document?id=attacker_id&id=victim_id
273
+ GET /api/users?user_id=attacker_id[]&user_id=victim_id[]
274
+ ```
275
+ - **Parameter Pollution (JSON)**: Provide duplicate keys in a JSON object. Behavior depends on the parser.
276
+ ```json
277
+ { "user_id": "attacker_id", "user_id": "victim_id" }
278
+ ```
279
+ - **Mixed-Case / Path-Normalization Bypass**: Try different capitalizations, mixed-case encodings, dot-segments (../) and URL-encoded slashes (%2F) to bypass path or router checks.
280
+ ```
281
+ GET /admin/profile → GET /ADMIN/profile
282
+ ```
283
+ - **Path Traversal Bypass**: Use path traversal sequences within parameters referencing objects.
284
+ ```
285
+ POST /users/delete/MY_ID/../VICTIM_ID
286
+ ```
287
+ - **Outdated API Version Testing**: If multiple API versions exist (e.g., /v1/, /v2/), test the IDOR on older, potentially less secure versions.
288
+ ```
289
+ GET /v3/users/123 → 403 Forbidden
290
+ GET /v1/users/123 → 200 OK
291
+ ```
292
+
293
+ ### Request Smuggling for IDOR
294
+
295
+ - **HTTP Request Smuggling**: Use CL.TE or TE.CL smuggling to inject victim IDs in backend requests
296
+
297
+ ```
298
+ POST / HTTP/1.1
299
+ Content-Length: 4
300
+ Transfer-Encoding: chunked
301
+
302
+ 1
303
+ Z
304
+ Q
305
+ ```
306
+
307
+ Front-end strips `user_id` parameter but back-end processes it from smuggled request chunk
308
+
309
+ ### Mass Assignment IDOR
310
+
311
+ - **Parameter Injection**: Add fields that weren't in original schema
312
+ ```json
313
+ { "name": "John", "role": "admin", "user_id": "victim_id", "is_admin": true }
314
+ ```
315
+ - **Case Variation Testing**: Test both camelCase and snake_case variants
316
+ ```
317
+ userId vs user_id vs UserId vs USER_ID
318
+ ```
319
+ - **Nested Object Injection**: Add authorization fields in nested objects
320
+ ```json
321
+ {
322
+ "profile": {
323
+ "name": "John",
324
+ "owner_id": "attacker_id",
325
+ "target_id": "victim_id"
326
+ }
327
+ }
328
+ ```
329
+
330
+ ### Reference Leakage Exploitation
331
+
332
+ - **Harvesting IDs from HTML/JS Sources**:
333
+ - Extract IDs from page source, JavaScript files
334
+ - Analyze AJAX requests for leaked IDs
335
+
336
+ - **API Response Analysis**:
337
+ - Check list responses for IDs of other users' resources
338
+ - Look for IDs in error messages or debugging information
339
+ - Check for endpoints that might translate identifiers (e.g., email to GUID).
340
+ - Harvest IDs via analytics beacons, logs endpoints, GraphQL error suggestions, or search/autocomplete APIs.
341
+
342
+ ## Vulnerabilities
343
+
344
+ ### Common IDOR Vulnerability Patterns
345
+
346
+ ```mermaid
347
+ graph LR
348
+ A[IDOR Patterns] --> B[API Endpoint Vulnerabilities]
349
+ A --> C[Function-Specific Vulnerabilities]
350
+
351
+ B --> D[RESTful API IDORs]
352
+ B --> E[GraphQL IDORs]
353
+ B --> F[JSON/XML Parameter IDORs]
354
+
355
+ C --> G[Account Management]
356
+ C --> H[Financial Operations]
357
+ C --> I[Content Management]
358
+ C --> J[Administrative Functions]
359
+ ```
360
+
361
+ #### API Endpoint Vulnerabilities
362
+
363
+ - **RESTful API IDORs**: Direct manipulation of resource identifiers in REST APIs
364
+
365
+ ```
366
+ GET /api/users/123/profile → GET /api/users/456/profile
367
+ ```
368
+
369
+ - **GraphQL IDORs**: Changing object identifiers in GraphQL queries
370
+
371
+ ```graphql
372
+ query {
373
+ user(id: "attacker_id") {
374
+ changePassword(newPassword: "pwned")
375
+ }
376
+ }
377
+ ```
378
+
379
+ - **JSON/XML Parameter IDORs**: Modifying nested parameters
380
+ ```json
381
+ {"user": {"id": 123, "action": "view"}} → {"user": {"id": 456, "action": "view"}}
382
+ ```
383
+
384
+ #### Function-Specific Vulnerabilities
385
+
386
+ - **Account Management IDORs**:
387
+ - Accessing another user's profile, settings, or personal information
388
+ - Modifying another user's account details
389
+
390
+ - **Financial IDORs**:
391
+ - Accessing another user's payment methods or financial records
392
+ - Modifying order details, prices, or payment information
393
+
394
+ - **Content Management IDORs**:
395
+ - Accessing private documents, media, or posts
396
+ - Modifying content ownership or permissions
397
+
398
+ - **Administrative Function IDORs**:
399
+ - Accessing administrative interfaces or functions
400
+ - Executing privileged actions through API endpoints
401
+
402
+ - **OAuth/OIDC IDORs**:
403
+ - Manipulating `state` or `code` parameters in OAuth flows
404
+ - Accessing token endpoints with other users' authorization codes
405
+ - PKCE code_verifier bypass via IDOR
406
+
407
+ - **2FA/MFA IDORs**:
408
+ - Accessing backup code generation endpoints for other users
409
+ - Retrieving TOTP secrets via `/api/users/{user_id}/totp-secret`
410
+ - Disabling 2FA for other accounts
411
+
412
+ - **Notification/Webhook IDORs**:
413
+ - Modifying notification preferences: `/api/notifications/settings/{user_id}`
414
+ - Accessing webhook configuration endpoints for other tenants
415
+ - Reading notification history of other users
416
+
417
+ - **Real-time Feature IDORs**:
418
+ - Socket.io/WebSocket room IDs as direct object references
419
+ - Live chat room access via predictable room identifiers
420
+ - Real-time dashboard data streams with user/org IDs
421
+
422
+ ### GraphQL
423
+
424
+ - Enforce authorization per-field, not just at the root resolver; test aliasing, fragments, batched and persisted queries.
425
+ - Restrict or gate introspection in production; sanitize error messages. Fuzz `__typename` switches to reach sibling object types.
426
+ - Swap out `id` arguments and nested object IDs in mutations and batch queries; verify per‑object ownership checks.
427
+
428
+ ### gRPC / Protobuf
429
+
430
+ - Microservices increasingly use gRPC; IDs live in binary messages. Test with grpcurl and fuzzers; validate authorization on every method.
431
+ - If server reflection is enabled, fetch `.proto` definitions; disable reflection in production when possible.
432
+
433
+ ### Cloud-Native Object URLs
434
+
435
+ - Presigned URLs (S3/GCS/Azure) are direct object references; require short expiries, method scoping, optional IP constraints, and backend re‑validation on GET.
436
+ - Attempt to tweak the `Key=`/object path, query params, or credentials (e.g., `X-Amz-Security-Token`) to replay others’ files; test cross‑tenant reuse.
437
+
438
+ ### Observability / OpenTelemetry Leaks
439
+
440
+ - Trace systems like Zipkin or Jaeger often expose span attributes containing user IDs.
441
+ - Query endpoints such as `/api/v2/traces` or `/v1/traces`, harvest IDs, and replay them against protected APIs.
442
+
443
+ ## Authorization-as-Code Pitfalls (OPA, Cedar)
444
+
445
+ - Organizations delegate authorization to policy engines (OPA, Cedar). Fuzz policy inputs directly (e.g., `POST /v1/data/authz/allow`).
446
+ - Verify explicit owner/tenant checks in Rego/Cedar; add unit tests for BOLA cases; deny‑by‑default at the first hop.
447
+
448
+ ## Modern Detection & CI/CD Tooling
449
+
450
+ - Use Burp (Repeater/Intruder/Turbo Intruder) and auth‑diff extensions (e.g., Autorize/AuthMatrix) for parallel testing across roles.
451
+ - Use gRPC tooling (grpcurl, gRPC Inspector) and disable reflection in production where possible.
452
+ - CI tools that generate BOLA/IDOR cases (e.g., Pynt, StackHawk, RESTler) and block merges on failures.
453
+
454
+ ## Methodologies
455
+
456
+ ### Tools
457
+
458
+ #### Automated IDOR Detection Tools
459
+
460
+ - **Burp Suite Extensions**:
461
+ - Authorize: Comparing responses between users
462
+ - Authz: Automated access control testing
463
+ - Auto Repeater: Replaying requests with modifications
464
+ - IDOR Scanner: Dedicated IDOR detection extension
465
+ - Pynt: CLI / CI scanner that auto-generates BOLA/IDOR test cases.
466
+ - StackHawk: CI-native scanner; its BOLA module blocks merges on failing IDOR checks.
467
+
468
+ - **Specialized Tools**:
469
+ - Arjun / Parameth: Useful for discovering hidden parameters often relevant in IDOR testing.
470
+ - AuthMatrix: Testing authorization in web applications
471
+ - Astra: Automated Security Testing for REST APIs
472
+ - IIS-Shortname-Scanner: Testing for path disclosure
473
+
474
+ - **Framework-Specific Tools**:
475
+ - RESTler: Stateful REST API fuzzing
476
+ - GraphQLmap: Testing GraphQL endpoints for IDORs
477
+ - Kiterunner: API endpoint discovery, finds hidden IDOR-prone endpoints
478
+
479
+ #### Manual Testing Tools
480
+
481
+ - **Proxy Tools**: Burp Suite, OWASP ZAP
482
+ - **API Testing**: Postman, Insomnia
483
+ - **Custom Scripts**: Python with requests library
484
+
485
+ ### Testing Methodologies
486
+
487
+ #### Comprehensive IDOR Testing Process
488
+
489
+ 1. **Reconnaissance Phase**:
490
+ - Map all endpoints and functionality
491
+ - Identify authentication mechanisms
492
+ - Document all object references and formats
493
+
494
+ 2. **Identification Phase**:
495
+ - Set up multiple accounts at different privilege levels
496
+ - Capture all interactions with the application
497
+ - Catalog all potential IDOR test points
498
+
499
+ 3. **Testing Phase**:
500
+ - Perform parameter tampering across all identified points
501
+ - Test for both read and write IDOR
502
+ - Try multiple bypass techniques for each endpoint
503
+ - Test indirect references (e.g., file uploads, exports)
504
+
505
+ 4. **Exploitation Phase**:
506
+ - Develop reliable proof-of-concept exploits
507
+ - Assess the impact of discovered vulnerabilities
508
+ - Determine the scope and severity
509
+
510
+ 5. **Reporting Phase**:
511
+ - Document clear reproduction steps
512
+ - Demonstrate actual/potential business impact
513
+ - Provide remediation recommendations
514
+
515
+ ### Specific Test Scenarios
516
+
517
+ #### Account Management Testing
518
+
519
+ 1. Log in as User A and access profile settings
520
+ 2. Capture requests for viewing/editing profile
521
+ 3. Log in as User B
522
+ 4. Replay User A's requests with User B's session
523
+ 5. Modify identifiers to access/edit User A's profile
524
+
525
+ #### Document Access Testing
526
+
527
+ 1. Upload documents with User A
528
+ 2. Capture document access/download requests
529
+ 3. Log in as User B
530
+ 4. Modify document identifiers to access User A's documents
531
+ 5. Test both direct access and list/search interfaces
532
+
533
+ #### API Testing
534
+
535
+ 1. Map all API endpoints and their parameters
536
+ 2. Identify endpoints that accept object identifiers
537
+ 3. Test horizontal access (between equal privilege users)
538
+ 4. Test vertical access (between different privilege levels)
539
+ 5. Test indirect references (nested objects, relationships)
540
+ 6. Check corresponding mobile API endpoints for differences or leaks.
541
+ 7. Look for parallel administrative endpoints (e.g., `/api/users/myinfo` vs `/api/admins/myinfo`).
542
+
543
+ ### High-Impact IDOR Targets
544
+
545
+ When hunting for IDORs, prioritize these high-impact endpoints:
546
+
547
+ 1. **User Profile Settings**:
548
+ - /settings/profile
549
+ - /user/profile
550
+ - /user/settings
551
+ - /account/settings
552
+ - /username
553
+ - /profile
554
+
555
+ 2. **Payment and Financial Endpoints**:
556
+ - Test create/update/delete operations on objects that might seem read-only (e.g., changing prices via PUT requests).
557
+ - Any endpoint handling payment information
558
+ - Order processing systems
559
+ - Financial record access points
560
+
561
+ 3. **Administrative Functions**:
562
+ - User management interfaces
563
+ - System configuration endpoints
564
+ - Access control settings
565
+
566
+ 4. **Authentication & MFA Endpoints**:
567
+ - /api/users/{id}/backup-codes
568
+ - /api/users/{id}/totp
569
+ - /api/users/{id}/disable-2fa
570
+ - /oauth/authorize (state parameter)
571
+ - /api/users/{id}/sessions
572
+
573
+ 5. **Notification & Communication**:
574
+ - /api/notifications/{id}
575
+ - /api/webhooks/{id}/config
576
+ - /api/users/{id}/email-preferences
577
+ - /api/alerts/{id}/settings
578
+
579
+ 6. **Real-Time & Collaboration**:
580
+ - /socket.io/?room={id}
581
+ - /api/rooms/{id}/join
582
+ - /api/live-sessions/{id}
583
+ - /api/collaborative-docs/{id}
584
+
585
+ ## Chaining and Escalation
586
+
587
+ IDOR vulnerabilities can often be chained with other issues or used to escalate privileges:
588
+
589
+ - **IDOR + Information Disclosure**: If an IDOR requires an unpredictable identifier (like a UUID), find another vulnerability (e.g., an API endpoint listing users) that leaks these identifiers. Use the leaked IDs to exploit the IDOR.
590
+ - **IDOR + Stored XSS**: If an IDOR allows modification of data viewable by other users (e.g., changing a profile name, posting a comment), inject an XSS payload. This escalates the IDOR to Stored XSS affecting other users.
591
+ - **IDOR for Feature Abuse**: Use IDOR to abuse application features, such as adding items to another user's cart, triggering actions on their behalf, or exhausting resources tied to their account.
592
+
593
+ ## Remediation Recommendations
594
+
595
+ - **Implement Proper Authorization**: Validate access rights for every resource request
596
+ - **Use Indirect References**: Replace direct references with temporary per-session tokens
597
+ - **Server-Side Validation**: Validate that the requested object belongs to the current user
598
+ - **Contextual Access Controls**: Consider context beyond just resource ownership
599
+ - **Authorization Frameworks**: Use dedicated authorization frameworks like ABAC, RBAC
600
+ - **Least Privilege Principle**: Restrict access to the minimum necessary
601
+ - **Rate Limiting**: Implement rate limiting to prevent brute-force IDOR discovery
602
+ - **Activity Logging**: Log all access attempts for sensitive resources
603
+ - **Session Binding**: Explicitly bind resources to authenticated sessions
604
+ - **Input Validation**: Validate all input parameters for type, format, and range
605
+ - **Deny-by-Default**: Authorize on object owner and tenant at the very first layer; fail closed.
606
+ - **Unit/Contract Tests**: Add authorization unit tests per endpoint/field and CI scanners that auto-generate BOLA cases.
607
+ - **Cache Partitioning**: Partition CDN caches by auth headers; avoid cacheable 200/304 for private resources.
608
+