# Vulnerability Chaining
> Combining individually low-value, out-of-scope or "informative" primitives into one exploit path with critical impact. It is the main way hunters turn duplicates and Lows into P1s, and the main reason triagers ask "what can you actually do with it?"
## How it works
Programs pay for demonstrated impact, and many primitives are explicitly excluded or capped when they stand alone: open redirect, self-XSS, blind SSRF to an internal port, limited XXE, a prototype-pollution gadget. A chain changes the question from "is this a bug?" to "what does the attacker end up with?" Typical patterns:
| Primitive (alone: Low/OOS) | + Link | = Impact |
|---|---|---|
| Open redirect on auth flow | Auth code / token in redirect URL | One-click ATO |
| Dangling CNAME (subdomain takeover) | OAuth client with wildcard `redirect_uri` | Zero-interaction code theft → ATO |
| Self-XSS | CSRF to plant the payload | Reflected XSS on victims |
| Stored XSS on a sibling subdomain | Cookie tossing | Forced login / session fixation |
| Out-of-scope XSS | Iframe sandwich onto in-scope origin | ATO |
| "Harmless" SSRF | Internal service SSRF + CRLF + cache deserialization | RCE |
| Limited XXE | `gopher://` to internal Redis | Session store exposure |
| IDOR on enumerable IDs | CSRF accepting placeholder token | Anonymous takeover of workflow |
| Same-origin script execution | Read CSRF token → mint API token | Cross-account compromise |
## Notable cases
- **GitHub Enterprise, 4 bugs → RCE (Orange Tsai, Best Report).**
1. Webhook SSRF. `faraday-restrict-ip-addresses` is a blocklist, bypassed with `0` = localhost.
2. A second SSRF in internal Graphite (port 8000) gives an "SSRF execution chain".
3. CRLF injection in Python `httplib` smuggles other protocols.
4. GitHub caches Ruby objects in memcached wrapped in `Marshal`, so a smuggled memcached `set` of a malicious Marshal object yields RCE. See [[Gopher Protocol SSRF]] and [[Insecure Deserialization]].
- **Basecamp Fizzy, 5 bugs → cross-account API token theft (H1 #3943339, CVSS 8.7).**
1. A pagination helper forwards all params into the Rails URL builder, including `script_name`, which bends the "page 2" URL to the Active Storage blob proxy.
2. The direct-upload content-type check misses `text/html;charset=utf-8`. It is an exact-string denylist, and only the S3 path is affected.
3. Orphaned (unattached) blobs are readable by any signed-in user.
4. The Turbo Frame renderer executes inline scripts and copies the page's CSP nonce onto them.
5. Same-origin JS reads the CSRF token and mints a write-scoped bearer token.
- **Zee Entertainment, P1 CVSS 9.0.** An open redirect in `signin?callback=` sent the browser to `evil.com/?pt=&tag=<one-time OTP auth code>`. The code was redeemable once at `/partner/getdeviceuser?token=…` for the victim's session. The researcher held the open redirect back instead of reporting a Low.
- **Stale CNAME + OAuth 2.0 wildcard ($6,000).** A forgotten marketing subdomain pointed at an expired SaaS instance. Taking it over captured authorization codes, because the IdP allowed `https://*.target.com/oauth/callback`. See [[OAuth 2.0 Vulnerabilities]].
- **XXE → Redis ($1,000 → $10,000).** An XML-RPC endpoint was found by decompiling client DLL/EXEs. Entity expansion was confirmed, internal sockets were enumerated (port 6379 seen), and then `gopher://172.x.x.x:6379/0INFO%20server%0d%0aQUIT%0d%0a`, `INFO keyspace` and `SCAN 0 COUNT 20` ran against unauthenticated Redis. The trailing `QUIT` was needed because LWP's gopher handler reads to EOF.
- **Self-XSS → reflected XSS + WAF bypass (Bugcrowd private).** The search input reflected unsafely only in the <1280 px mobile search UI. CSRF delivered it to victims.
- **Stored XSS → forced login via cookie tossing**, and **out-of-scope XSS → ATO via an "iframe sandwich"** (OWASP AppSec Days PT 2026). Both are ways to get paid for XSS on assets the program does not value.
- **Wizard Takeover (PetMemoria lab from a real report).** IDOR via enumerable IDs across a 5-step wizard, plus a backend that accepted the literal CSRF-token placeholder, gave anonymous takeover of memorial drafts.
- **GitHub Rails test secret in production ($18,000).** A leaked signing secret → signed-cookie forgery → unsafe deserialization.
- **Meta `Math.random()` secret ($66,000).** A predictable secret + a `postMessage` handler + a missing sanitization step.
- **Chrome full chain ($250,000, XBOW/Dolan-Gavitt).** Three bugs assembled in 6 days into renderer-to-sandbox-escape code execution. The submission nearly lost out as a duplicate.
- **From Shodan to an unpaid delivery.** A weak credential on an exposed device pivoted into a logistics system, ending in real-world order manipulation.
- **Self-XSS + CSRF past a single-use CAPTCHA**: a feedback form reflected the payload only to the submitter and enforced a CAPTCHA that is consumed once it is used. Generating the CSRF PoC from an intercepted request and then *dropping* it left the CAPTCHA token unconsumed, so the auto-submitting form delivered the XSS to another user ([[Cross-Site Scripting]], [[Cross-Site Request Forgery]]; [[raw/appsecwriteups.com/escalating-self-xss-by-chaining-csrf-and-analyzing-captcha-15627|writeup]]).
- **Encryption oracle + broken access control.** A public `EncodeString` endpoint encrypted any username; the ciphertext was accepted by `EncUserID?UserName=`, which returned PII, security answers and PINs. Opaque IDs protect nothing when the app mints them on request ([[raw/d0loreh4z3.medium.com/encrypted-id-s-no-problem-15808|d0loreh4z3]]).
- **Enumeration + cracked HS256 + sequential IDs → ATO (Intel/CBSE).** Login timing and reset-response differences confirmed emails; the HS256 secret `intel` fell to rockyou offline; forged tokens plus sequential user IDs reached the target account ([[raw/infosecwriteups.com/intel-inside-how-a-cracked-jwt-key-led-to-full-account-takeover-15877|InfoSec Write-ups]]). See [[JWT Secret Cracking]].
- **postMessage XSS → ATO (Chess.com).** Any-origin `SHOW_MESSAGE_MODAL` → `innerHTML` sink → a filter that restored unsanitized chess comments after DOMPurify. XSS on the authenticated origin became ATO because Google/Apple accounts can set a password without the old one ([[raw/xenops.ae/the-last-writer-wins-chess-com-account-takeover-via-postmessage-xss-15815|xenops]]).
- **Weak origin check + navigation sink.** `origin.hostname.includes(host)` accepted `redacted.com.attacker.com`; a `REDIRECT` message wrote `e.data.value.url` to `window.location.href` ([[raw/medium.com/how-a-simple-postmessage-validation-flaw-led-to-dom-xss-15816|Medium]]). See [[DOM-Based XSS]].
## Chaining heuristics
- When you find a Low, ask what it *leaks* (codes, tokens, CSRF tokens, internal sockets) and what *trusts* the asset (OAuth redirect allowlists, cookie scope, CORS, internal caches).
- Prerequisite-dependent bugs, such as prototype-pollution gadgets, get discounted in severity unless you supply the prerequisite yourself (JFrog's Axios analysis). Chain the gadget to a real source.
- Prove the chain end-to-end before reporting. Partial chains invite a downgrade (see [[Writing Bug Bounty Reports]]).
## Related
- [[Bug Bounty Hunting]] (hub)
- [[Writing Bug Bounty Reports]] · [[Bug Bounty Methodology]]
- [[Account Takeover]] · [[OAuth 2.0 Vulnerabilities]] · [[Cross-Site Request Forgery]] · [[Stored XSS]] · [[Insecure Direct Object Reference]] · [[Insecure Deserialization]]
- [[Server-Side Request Forgery]] · [[Gopher Protocol SSRF]] · [[Open Redirect to SSRF]]
See also: [[Prototype Pollution]] · [[Race Conditions]]
See also: [[Open Redirect]]
## Sources
- [[raw/blog.orange.tw/how-i-chained-4-vulnerabilities-on-github-enterprise-from-ssrf-executi-1885|How I Chained 4 vulnerabilities on GitHub Enterprise, From SSRF Execution Chain to RCE!]]
- [[raw/dev.to/cross-account-js-execution-in-basecamp-fizzy-five-chained-bugs-to-toke-12607|Cross-account JS execution in Basecamp Fizzy: five chained bugs to token theft]]
- [[raw/medium.com/chaining-an-open-redirect-into-account-takeover-p1-cvss-9-0-13937|Chaining an Open Redirect Into Account Takeover (P1 · CVSS 9.0)]]
- [[raw/medium.com/how-i-chained-a-stale-cname-record-with-oauth-2-0-wildcards-for-a-6-00-14401|How I Chained a Stale CNAME Record with OAuth 2.0 Wildcards for a $6,000 ATO]]
- [[raw/medium.com/from-1-000-to-10-000-how-i-turned-a-limited-xxe-into-a-critical-redis-14498|From $1,000 to $10,000: How I Turned a "Limited" XXE Into a Critical Redis Session Store Exposure]]
- [[raw/infosecwriteups.com/how-i-turned-self-xss-into-reflected-xss-and-bypassed-the-waf-11923|How I Turned Self-XSS into Reflected XSS (and Bypassed the WAF)]]
- [[raw/medium.com/from-stored-xss-to-forced-login-via-cookie-tossing-13545|From Stored XSS to Forced Login via Cookie Tossing]]
- [[raw/tsecurity.de/from-out-of-scope-xss-to-account-takeover-the-iframe-sandwich-owasp-ta-12449|From Out of Scope XSS to Account Takeover: The Iframe Sandwich]]
- [[raw/bblabs.es/wizard-takeover-ato-idor-csrf-lab-based-on-a-real-report-12598|Wizard Takeover ATO (IDOR + CSRF) lab based on a real report]]
- [[raw/medium.com/a-test-secret-in-production-how-a-rails-session-cookie-earned-18-000-f-15524|A Test Secret in Production: How a Rails Session Cookie Earned $18,000]]
- [[raw/medium.com/when-math-random-guards-the-door-a-66-000-meta-bug-built-on-a-predicta-15373|When Math.random() Guards the Door: A $66,000 Meta Bug]]
- [[raw/medium.com/google-paid-250-000-for-one-chrome-bug-chain-it-took-six-days-15072|Google Paid $250,000 for One Chrome Bug Chain. It Took Six Days.]]
- [[raw/medium.com/from-shodan-to-an-unpaid-delivery-how-a-chain-of-weaknesses-led-to-rea-12508|From Shodan to an Unpaid Delivery: How a Chain of Weaknesses Led to Real-World Impact]]
- [[raw/jfrog.com/where-severity-scores-go-wrong-just-add-prototype-pollution-10035|Where Severity Scores Go Wrong: "Just Add Prototype Pollution"]]
- [[raw/github.com/github-zephrfish-bugbountytemplates-a-collection-of-templates-for-bug-1051|GitHub - ZephrFish/BugBountyTemplates]]
- [[raw/appsecwriteups.com/escalating-self-xss-by-chaining-csrf-and-analyzing-captcha-15627|Escalating self-XSS by chaining CSRF and analyzing CAPTCHA]]
- [[raw/d0loreh4z3.medium.com/encrypted-id-s-no-problem-15808|Encrypted ID's ? No Problem.]]
- [[raw/infosecwriteups.com/intel-inside-how-a-cracked-jwt-key-led-to-full-account-takeover-15877|Intel Inside: How a Cracked JWT Key led to Full Account Takeover]]
- [[raw/xenops.ae/the-last-writer-wins-chess-com-account-takeover-via-postmessage-xss-15815|The Last Writer Wins: Chess.com account takeover via postMessage XSS]]
- [[raw/medium.com/how-a-simple-postmessage-validation-flaw-led-to-dom-xss-15816|How a simple postMessage validation flaw led to DOM XSS]]