ersinkoc/security-check/sc-cors

Claude Code and agent skill by ersinkoc/security-check

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

CORS misconfiguration detection — wildcard origin, reflected origin, null origin, and credential leaks

Install

npx vskill@latest install ersinkoc/security-check/sc-cors

SKILL.md

The same SKILL.md was published earlier as ersinkoc/security-check/sc-cors.

SC: CORS Misconfiguration

Purpose

Detects Cross-Origin Resource Sharing misconfigurations that allow unauthorized cross-origin access to sensitive APIs. Covers wildcard origins with credentials, reflected origin without validation, null origin allowance, overly permissive regex matching, and subdomain matching bypasses.

Activation

Called by sc-orchestrator during Phase 2 when HTTP APIs are detected.

Phase 1: Discovery

Keyword Patterns to Search
"Access-Control-Allow-Origin", "cors(", "CORS(",
"allowOrigin", "allow_origin", "AllowOrigin",
"Access-Control-Allow-Credentials",
"corsOptions", "cors_allowed_origins"
Vulnerability Patterns

1. Wildcard with Credentials:

javascript
// VULNERABLE: Wildcard + credentials (browsers block this but misconfiguration indicates intent)
app.use(cors({
origin: '*',
credentials: true // This combination is a security anti-pattern
}));

2. Reflected Origin:

javascript
// VULNERABLE: Reflects any origin
app.use((req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
res.setHeader('Access-Control-Allow-Credentials', 'true');
next();
});
// SAFE: Allowlist
const ALLOWED_ORIGINS = ['https://app.example.com', 'https://admin.example.com'];
app.use(cors({
origin: (origin, callback) => {
if (!origin || ALLOWED_ORIGINS.includes(origin)) {
callback(null, true);
} else {
callback(new Error('CORS not allowed'));
}
},
credentials: true
}));

3. Null Origin Allowed:

python
# VULNERABLE: Allows null origin (exploitable via sandboxed iframe)
CORS_ALLOWED_ORIGINS = ['null'] # Attackers can send Origin: null

4. Regex Bypass:

javascript
// VULNERABLE: Weak regex allows subdomain takeover attack
origin: /\.example\.com$/ // Matches evil-example.com too!
// SAFE: Anchor regex properly
origin: /^https:\/\/([a-z]+\.)?example\.com$/

Severity Classification

  • Critical: Reflected origin + credentials on endpoints with sensitive data
  • High: Null origin allowed + credentials, regex bypass allowing attacker domains
  • Medium: Wildcard origin on non-credential endpoints with sensitive data
  • Low: Overly permissive CORS on public data endpoints

Output Format

Finding: CORS-{NNN}
  • Title: CORS Misconfiguration — {type}
  • Severity: Critical | High | Medium | Low
  • Confidence: 0-100
  • File: file/path:line
  • Vulnerability Type: CWE-942 (Permissive Cross-domain Policy)
  • Description: {CORS configuration allows unauthorized cross-origin access.}
  • Impact: Cross-origin data theft, account takeover via CSRF-like attacks.
  • Remediation: Implement strict origin allowlist. Never reflect origin without validation.
  • References: https://cwe.mitre.org/data/definitions/942.html

Common False Positives

  1. Public APIs — APIs serving public data may intentionally use *
  2. CDN/static assets — CORS * on static files is standard practice
  3. Development configuration — localhost origins in dev config
  4. API gateways — CORS may be configured at the gateway level, not application level

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
46
Repository forks
5
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ersinkoc/security-check/sc-cors/badge)](https://verified-skill.com/skills/ersinkoc/security-check/sc-cors)

Something wrong with this skill or its page? Tell us.