open-cors-anti-pattern

Detect and prevent overly permissive CORS policies addressing CWE-942.

8|1|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/igbuend/grimbard --skill open-cors-anti-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: open-cors-anti-pattern
Source: https://github.com/igbuend/grimbard/tree/main/skills/open-cors-anti-pattern
Command: npx skills add https://github.com/igbuend/grimbard --skill open-cors-anti-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the security risk of overly permissive Cross-Origin Resource Sharing (CORS) policies, which can expose sensitive data and allow unauthorized actions by malicious websites.

Core Features & Use Cases

  • Detects insecure CORS configurations: Identifies wildcard (*) or reflected Origin headers.
  • Provides secure alternatives: Offers examples of strict allowlists for trusted origins.
  • Use Case: Reviewing an API's response headers to ensure that Access-Control-Allow-Origin is not set to * or reflecting an untrusted client origin, thereby preventing potential data breaches.

Quick Start

Review the CORS configuration for the current project to ensure it follows security best practices.

Frequently Asked Questions about open-cors-anti-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my CORS configuration is vulnerable to CWE-942?

To check if your CORS configuration is vulnerable to CWE-942, analyze server configurations and code setting CORS headers to identify overly permissive wildcard (`*`), null, or reflected origin values. Ensure Access-Control-Allow-Origin is not reflecting untrusted client origins.

What is the security risk of using a wildcard Access-Control-Allow-Origin header?

Using a wildcard Access-Control-Allow-Origin header exposes sensitive data and allows unauthorized actions by malicious websites. It creates an overly permissive Cross-Origin Resource Sharing policy that bypasses strict domain allowlists.

How do I prevent reflected Origin headers in my API security setup?

To prevent reflected Origin headers in API security, review API response headers to ensure Access-Control-Allow-Origin is not reflecting an untrusted client origin. Implement strict allowlists for trusted domains instead of dynamic reflection.

Does setting Access-Control-Allow-Origin to null expose my web application to security risks?

Setting Access-Control-Allow-Origin to null exposes your web application to security risks because it can allow unauthorized cross-origin requests. You should reject null values and enforce strict allowlists for trusted domains only.

What is the best way to implement secure CORS policies for an API?

The best way to implement secure CORS policies for an API is to use strict allowlists for trusted origins. This mitigates CWE-942 by ensuring the Access-Control-Allow-Origin header never accepts wildcard or reflected untrusted values.