본문으로 건너뛰기
cccskills
무료GitHub에 공개

auditing-cors-policy

Audit CORS, the browser rules for requests between different sites, by probing API responses with varied Origin headers. Check origin validation, credential settings, preflight requests, and caching headers, then produce findings in JSON, JSONL, or Markdown.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Audit a target's CORS posture — Access-Control-Allow-Origin handling, reflected-origin bypass, credentials+wildcard mismatch, preflight OPTIONS behavior, Vary header correctness. Use when: a third-party integration is failing CORS preflight and someone proposes "just set Allow-Origin to *" as the fix, OR your bug-bounty inbox has a credential-reuse exploit chain. Threshold: any reflection of arbitrary Origin into Allow-Origin, Allow-Credentials:true with wildcard origin (browser-rejected combo but server config wrong), missing Vary:Origin on per-origin responses, preflight cached over 86400s, OR Allow-Origin trust of attacker- controlled subdomain pattern. Trigger with: "audit cors", "check cors policy", "cors bypass", "preflight check".

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Investigate failed CORS preflight requests
  • Triage reports of reflected Origin headers
  • Audit API endpoints before launch
  • Add CORS regression checks to CI

포함된 파일(4)

  • SKILL.md6.6 KB
  • references/PLAYBOOK.md6.1 KB
  • references/THEORY.md6.1 KB
  • scripts/audit_cors.py14.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Auditing CORS Policy

Overview

CORS misconfiguration is one of the most common middle-severity findings in web bug bounties. The browser-enforced rules are subtle, the failure modes are silent (the wrong cors response just works until an attacker weaponizes it), and the "fix" engineers reach for — Access-Control-Allow-Origin: * — opens the very class of attacks CORS was meant to prevent when paired with credentials.

This skill probes each common CORS misconfiguration with synthetic Origin headers and grades the response.

When the skill produces findings

FindingSeverityThresholdAffected control
Origin reflected without validationHIGHSynthetic Origin https://attacker.example echoed in Allow-OriginOWASP A05:2021
Allow-Credentials:true with wildcard Allow-OriginCRITICALBrowser rejects but server is asserting the worst comboOWASP A05:2021
Allow-Credentials:true with reflected OriginCRITICALAttacker site can read authenticated responses cross-originOWASP A05:2021, CWE-942
Subdomain wildcard pattern bypassHIGHAllow-Origin: *.example.com matches attacker.example.com.evil.comCWE-942
Missing Vary:Origin on per-origin responseMEDIUMCDN caches one origin's response for all originsRFC 7234
Preflight cache > 86400sLOWAccess-Control-Max-Age over 24h limits revocation agilityMDN best practice
Null Origin trustedHIGHAllow-Origin: null accepted (sandboxed iframes, data: URLs)CWE-942
All HTTP methods permittedMEDIUMAllow-Methods: * enables CSRF-via-CORS for state-changeOWASP A05:2021

Prerequisites

  • Python 3.9+ (requests library)
  • Authorization for non-local targets (../analyzing-tls-config/references/AUTHORIZATION.md)

Instructions

Step 1 — Confirm Authorization

"Do you have authorization to perform CORS testing on this target?
 I need confirmation before proceeding."

Step 2 — Run the scanner

python3 ${CLAUDE_PLUGIN_ROOT}/skills/auditing-cors-policy/scripts/audit_cors.py \
    https://api.example.com/endpoint \
    --authorized

Options:

Usage: audit_cors.py URL [OPTIONS]

Options:
  --authorized       Attest authorization for non-local targets (required)
  --output FILE      Write findings to FILE
  --format FMT       json | jsonl | markdown (default: markdown)
  --min-severity SEV (default: info)
  --timeout SECS     Per-probe timeout (default: 10)
  --method METHOD    HTTP method for the main probe (default: GET)

The scanner sends multiple probes per target:

  1. Baseline request with no Origin header
  2. Probe with safe Origin (https://allowed-origin.example.com)
  3. Probe with attacker Origin (https://attacker.example)
  4. Probe with subdomain-bypass Origin
  5. Probe with Origin:null
  6. OPTIONS preflight with Access-Control-Request-Headers / Method

For each, it records the response's CORS headers and grades against the threshold table above.

Step 3 — Interpret findings

CRITICAL = credential-stealing chain available; ship same-day fix. HIGH = arbitrary cross-origin read of public-but-sensitive content; ship within sprint. MEDIUM/LOW = posture hardening; backlog.

Step 4 — Cross-skill chaining

If CORS findings land alongside auth findings (skill #20 confirming- pentest-authorization would have caught the auth side at engagement scope), suggest authentication-validator plugin for full session- handling audit.

Examples

Example 1 — Reflected-origin bug bounty triage

User: "Bug bounty submission claims CORS bypass on /api/profile."

python3 ${CLAUDE_PLUGIN_ROOT}/skills/auditing-cors-policy/scripts/audit_cors.py \
    https://api.example.com/profile \
    --authorized \
    --format json | jq '.[] | select(.severity == "critical" or .severity == "high")'

If the reflected-origin probe + Allow-Credentials:true both fire, the submission is valid; pay the bounty and ship the fix from PLAYBOOK.md.

Example 2 — Pre-launch CORS sweep on a new API gateway

User: "We're rolling out a new gateway — audit every endpoint's CORS posture."

for ENDPOINT in $(cat endpoints.txt); do
  python3 ${CLAUDE_PLUGIN_ROOT}/skills/auditing-cors-policy/scripts/audit_cors.py \
      "$ENDPOINT" --authorized --min-severity high --format jsonl >> cors-audit.jsonl
done
jq -s 'group_by(.severity) | map({sev: .[0].severity, count: length})' cors-audit.jsonl

Example 3 — CI guard against CORS regression

Drop into deploy gate:

- name: CORS posture gate
  run: |
    python3 plugins/security/penetration-tester/skills/auditing-cors-policy/scripts/audit_cors.py \
        https://staging-api.example.com/auth \
        --authorized \
        --min-severity high

Exit 1 fails the deploy if any new high/critical lands.

Output

JSON / JSONL / Markdown per lib/report.py. Exit 0 clean, 1 high/ critical, 2 error.

Error Handling

  • Target returns no CORS headers at all → INFO finding "CORS not configured" with note that this is fine for non-cross-origin endpoints.
  • Preflight fails with 405 → MEDIUM finding suggesting OPTIONS handler missing.
  • Connection error → exit 2 with underlying error.

Resources

  • references/THEORY.md — How CORS works, why each finding matters
  • references/PLAYBOOK.md — Allow-list config templates per server type / framework (nginx, Express, Spring, FastAPI, Rails)
  • ../analyzing-tls-config/references/AUTHORIZATION.md — Active-scan authorization pattern

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Add a synthetic-data CI gate for customer-owned Abridge integration code. Test consent handling, note-review handoffs, redaction, and rollback behavior with mocked vendor boundaries, without connecting CI to a live Abridge or EHR tenant.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding regression checks to an Abridge integration repository
  • Testing consent and note-release handling
  • Checking logs for sensitive data exposure
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Triage Abridge recording, note review, Epic handoff, and access problems using observed symptoms and approved guidance. Identify the affected workflow stage, organize a minimal timeline, and prepare a redacted escalation record for the responsible team.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Separate recording problems from upload failures
  • Investigate note creation delays and editor issues
  • Identify the responsible team for Epic handoff failures
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Map and review an Abridge clinical documentation workflow from consent and recording through draft review, evidence checks, edits, and final disposition. Keep clinician approval explicit, identify failure exits, and separate verified facts from tenant-specific details and pending approvals.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Map a clinical note workflow for a care setting
  • Check where consent and patient identity are verified
  • Review draft notes against linked evidence before sign-off
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Audit how clinician-reviewed Abridge note sections map into Epic templates and downstream workflows. Use approved test records to document destinations, exceptions, evidence, rollback steps, and a go or no-go decision for a specific environment.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking Abridge note section mappings to Epic templates
  • Auditing a department’s approved documentation handoff
  • Preparing test evidence and a go or no-go decision
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Review Abridge adoption and workflow value using local usage records, clinician feedback, and verified contract costs. Build an evidence based decision table covering adoption, quality, support burden, and options to expand, hold, or improve the rollout.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reviewing adoption after an Abridge rollout
  • Preparing evidence for a renewal decision
  • Comparing workflow outcomes across care settings
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

Prepare a bounded support bundle for an Abridge issue using allowlisted operational details such as versions, coarse timestamps, and correlation references. Exclude recordings, transcripts, patient identifiers, credentials, and unrestricted logs, then document redactions and review details.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Preparing reviewed evidence for an Abridge support case
  • Documenting redactions and excluded data
  • Collecting approved operational details for an incident
jeremylongshore/tons-of-skills-marketplace2.9천2026년 10월 23일 업데이트

jeremylongshore의 스킬 모두 보기

이 스킬의 문제 신고