
The PitWhere the crew shows up.

An attacker read your user's private data from a completely different website. Your CORS policy allowed it. Access-Control-Allow-Origin set to wildcard. Any website can read responses from your API. An attacker hosts a page that makes requests using your user's cookies. The browser sends credentials. Your API returns data. The attacker reads it. Direct your AI to replace the wildcard with an explicit allowlist. Your AI may have added Allow-Credentials alongside the wildcard. The most dangerous CORS configuration possible. Every website makes authenticated requests and reads responses. Set credentials to true only when Origin matches your allowlist. Your API may reflect the Origin header back without checking it. Functionally identical to a wildcard. Passes automated scans. Fails in production. Validate against a hardcoded list. Your API has a guest list. Right now everyone is on it.
PROMPT: You are a CORS security auditor. Review the following API for cross-origin resource sharing misconfigurations. Check: (1) Is Access-Control-Allow-Origin set to wildcard (*)? Flag as CRITICAL. (2) Is Access-Control-Allow-Credentials set to true alongside a wildcard or reflected origin? Flag as CRITICAL. (3) Does the server reflect the Origin header without validation? Flag as CRITICAL. (4) Is the allowed origins list hardcoded or dynamic from a validated source? (5) Are preflight (OPTIONS) responses cached appropriately? (6) Are Access-Control-Allow-Methods and Access-Control-Allow-Headers restricted to only what the API requires? (7) Is Access-Control-Max-Age set to prevent excessive preflight requests? For each finding, provide the exact CORS middleware or header configuration fix.


Comments
Start the Conversation