Langsung ke konten
Skillpedia
Keamanan5.4k Β· #14902

hunt-cors

Fungsinya

Skill ini menguji pengaturan CORS yang bisa membuat situs penyerang membaca respons sensitif dari akun pengguna yang sudah login. Ditujukan untuk pengujian resmi pada aplikasi web dan API.

Kapan dipakai

  • βœ“Saat sebuah API mengembalikan data pribadi dan mengirim header CORS.
  • βœ“Saat sebuah situs memantulkan origin apa pun di pengaturan CORS-nya.
  • βœ“Saat Anda ingin memastikan apakah pembacaan lintas situs mungkin terjadi di browser sungguhan.

Link skill

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-cors/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-cors/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda memeriksa apakah API kami memungkinkan situs lain membaca data akun dari browser yang sudah login dalam uji resmi kami?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengirim permintaan dari origin uji dan memeriksa header CORS. Temuan hanya dikonfirmasi jika browser benar-benar bisa membaca respons pribadi tersebut.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

HUNT-CORS β€” Cross-Origin Resource Sharing Misconfiguration

What actually pays (and what does not)

CORS pays High only when an attacker-controlled origin can perform a credentialed cross-origin read of sensitive authenticated data, and you have a browser PoC proving the response body is readable from evil.com.

Two hard browser rules that kill most "findings" β€” check these FIRST:

  • Access-Control-Allow-Origin: * CANNOT be combined with credentials. If the server returns ACAO: *, the browser refuses to send/expose the response for a credentials: include request. A wildcard-only endpoint is not credential-exploitable. It is only interesting if the data it serves is sensitive without a session (rare) β€” usually this is Informational/Low.
  • Access-Control-Allow-Credentials: true is meaningless on its own. It matters only if ACAO reflects/allows your specific attacker origin AND a cross-origin credentialed fetch actually returns a readable body. ACAC on a response that does not reflect your origin proves nothing.

If you cannot demonstrate a readable cross-origin authed body in a real browser, you do not have a High. Do not submit header-diffing alone.


Crown Jewel Targets

  • Reflect-any-origin + credentials β€” server echoes the Origin header AND sets ACAC: true β†’ any site reads authed API responses. The classic High.
  • Null-origin trust β€” ACAO: null + ACAC: true. A sandbox iframe (or a data:/redirect chain) emits Origin: null, so any page can read authed data.
  • Subdomain-regex bypass β€” trusted-origin regex with a parsing flaw. The correct payload depends on which flaw (see Phase 3 β€” this is where most skills get it wrong).
  • Subdomain takeover β†’ trusted origin β€” a dangling subdomain that the CORS policy trusts; take it over, host the PoC there (see hunt-subdomain).
  • postMessage missing/loose origin check β€” handler that processes event.data without strictly validating event.origin.

Attack Surface Signals

Any endpoint returning an Access-Control-Allow-Origin header
API endpoints:   /api/*, /v1/*, /graphql
Profile/account: /api/me, /api/profile, /api/user, /api/session
Secrets/tokens:  /api/tokens, /api/keys, /api/csrf, /api/account/settings
Financial:       /api/balance, /api/transactions
Admin/internal:  /api/admin/*, /api/internal/*

Prioritize endpoints that (a) require a session cookie and (b) return PII, tokens, CSRF tokens, or other secrets in the body.


Step-by-Step Hunting Methodology

Phase 1 β€” Discover CORS endpoints

# Probe API endpoints. Use GET (not -I): some servers only emit CORS on GET,
# and -I sends HEAD which may be handled differently.
while read url; do
  result=$(curl -s -D - -o /dev/null "$url" \
    -H "Origin: https://evil.com" \
    -H "Cookie: $SESSION_COOKIE" | grep -i "access-control")
  [ -n "$result" ] && echo "=== $url ===" && echo "$result"
done < recon/$TARGET/api-endpoints.txt

# httpx bulk check
cat recon/$TARGET/live-hosts.txt | awk '{print $1}' | \
  httpx -H "Origin: https://evil.com" -match-string "access-control-allow-origin"

Phase 2 β€” Reflect-any-origin + null origin

# Does the server reflect an arbitrary Origin back?
curl -s -D - -o /dev/null https://$TARGET/api/me \
  -H "Origin: https://evil.com" \
  -H "Cookie: $SESSION_COOKIE" | grep -i "access-control"

# Vulnerable (the High case):
#   Access-Control-Allow-Origin: https://evil.com   <- reflects attacker origin
#   Access-Control-Allow-Credentials: true          <- + credentials => readable
#
# NOT exploitable for credentialed theft:
#   Access-Control-Allow-Origin: *                   <- browser blocks creds read
#   (no ACAC, or ACAC absent)                        <- not credentialed

# Null-origin trust
curl -s -D - -o /dev/null https://$TARGET/api/me \
  -H "Origin: null" \
  -H "Cookie: $SESSION_COOKIE" | grep -i "access-control"
# Looking for:  Access-Control-Allow-Origin: null  +  ACAC: true

Phase 3 β€” Subdomain / trusted-origin regex bypass

The right payload depends on which regex flaw the server has. Identify the class first, then send the matching payload. Getting this wrong wastes the test and produces false negatives.

Server regex (intended: trust *.target.com) Flaw Bypass origin that matches Why
^https?://.*\.target\.com$ None β€” escaped dot + end-anchor. Correct. (no simple bypass) `evil.
Pertanyaan umum

Apakah origin wildcard sudah cukup sebagai temuan?

Biasanya tidak. Skill ini menyatakan origin wildcard tidak bisa dipakai bersama kredensial, sehingga sering kali tingkat keparahannya rendah.

Mengapa harus diuji di browser?

Pemeriksaan header saja bisa menyesatkan, jadi skill ini mewajibkan bukti bahwa browser benar-benar bisa membaca respons.

Apakah skill ini mencakup trik subdomain?

Ya. Skill ini mencakup pencocokan subdomain yang lemah dan kepercayaan pada origin null.

Detail

Deskripsi asli dari pembuat

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.

repo: elementalsouls/Claude-BugHunter

Popularitas

Bintang GitHub
5.4k
Peringkat
#14902
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa