بنقرة واحدة
cors-check
Detect CORS misconfiguration by testing various Origin headers and analyzing Access-Control responses
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Detect CORS misconfiguration by testing various Origin headers and analyzing Access-Control responses
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Interactive gap analysis against Korea's ISMS-P 102-control certification framework (management, protection, personal information)
Security log analysis and anomaly detection for access, auth, and syslog files
Analyze suspicious files through triage/static/dynamic/code phases to produce IOCs, YARA/Sigma rules, and MITRE ATT&CK mappings
File hash reputation lookup via VirusTotal API v3 for MD5/SHA1/SHA256 detection ratio, threat classification, and vendor results
OWASP Top 10 (2021) checklist-based inspection and compliance matrix generation
Multi-chain smart contract security for Solana, Algorand, Cairo, Cosmos, Substrate, and TON with pre-audit readiness checks
| name | cors-check |
| description | Detect CORS misconfiguration by testing various Origin headers and analyzing Access-Control responses |
| license | MIT |
| metadata | {"category":"web-security","locale":"en","phase":"v1"} |
Sends HTTP requests with various Origin header values to a target URL to detect vulnerabilities in CORS (Cross-Origin Resource Sharing) policy. Identifies misconfigurations such as Access-Control-Allow-Origin reflecting the request Origin verbatim, allowing null, or simultaneously setting * with Access-Control-Allow-Credentials: true.
curl must be installed| Variable | Description | Example |
|---|---|---|
TARGET_URL | Endpoint URL to test | https://api.example.com/user |
LEGITIMATE_ORIGIN | Known legitimate origin (if available) | https://example.com |
TARGET_URL="https://api.example.com/user"
LEGITIMATE_ORIGIN="https://example.com"
echo "=== Baseline CORS headers (no Origin) ==="
curl -s -I -X GET "$TARGET_URL" \
--max-time 10 2>&1 \
| grep -i "access-control"
echo ""
echo "=== Origin reflection test ==="
test_cors() {
local label="$1"
local origin="$2"
local response
response=$(curl -s -I -X GET "$TARGET_URL" \
-H "Origin: $origin" \
--max-time 10 2>&1)
local acao
acao=$(echo "$response" | grep -i "access-control-allow-origin:" | tr -d '\r')
local acac
acac=$(echo "$response" | grep -i "access-control-allow-credentials:" | tr -d '\r')
echo "--- [$label] Origin: $origin ---"
echo " ACAO: ${acao:-<none>}"
echo " ACAC: ${acac:-<none>}"
# Risk assessment
if echo "$acao" | grep -qi "$origin"; then
if echo "$acac" | grep -qi "true"; then
echo " [CRITICAL] Origin reflected + Credentials=true -> credential theft possible"
else
echo " [WARNING] Origin reflected (no Credentials)"
fi
fi
if echo "$acao" | grep -q '^\s*[Aa]ccess-[Cc]ontrol-[Aa]llow-[Oo]rigin:\s*\*'; then
if echo "$acac" | grep -qi "true"; then
echo " [CRITICAL] ACAO=* + Credentials=true -> blocked by browser but still a misconfiguration"
else
echo " [INFO] ACAO=* (wildcard; acceptable for unauthenticated public APIs)"
fi
fi
echo ""
}
test_cors "Legitimate origin" "$LEGITIMATE_ORIGIN"
test_cors "null Origin" "null"
test_cors "Attacker domain" "https://attacker.com"
test_cors "Subdomain" "https://sub.example.com"
test_cors "Prefix-similar domain" "https://example.com.evil.com"
test_cors "Trailing slash variant" "${LEGITIMATE_ORIGIN}/"
test_cors "HTTP downgrade" "http://example.com"
echo "=== Preflight OPTIONS request test ==="
curl -s -I -X OPTIONS "$TARGET_URL" \
-H "Origin: https://attacker.com" \
-H "Access-Control-Request-Method: GET" \
-H "Access-Control-Request-Headers: Authorization, Content-Type" \
--max-time 10 2>&1 \
| grep -i "access-control"
Reference: See REFERENCE.md for risk assessment criteria (4 severity levels plus remediation guidance).
| Symptom | Cause and resolution |
|---|---|
| No ACAO header on all tests | CORS policy not configured or same-origin only. curl responses may differ from browser behavior |
| 302 redirect preventing expected response | Add -L flag or specify the final URL directly |
| Server blocks OPTIONS method | 405 response means Preflight not supported. Fall back to simple request (GET/POST) testing |
ACAO: * + ACAC: true combination, but the server configuration is still wrong and should be reported.corsy (https://github.com/s0md3v/Corsy).