1 Wildcard CORS and Reflected Origin
CORS (Cross-Origin Resource Sharing) headers tell browsers which origins may access API responses. Misconfigured CORS allows malicious sites to read sensitive API data from authenticated users.
Wildcard with credentials — impossible but attempted:
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: trueBrowsers reject this combination, but developers often "fix" it by reflecting the Origin header blindly.
Reflected Origin (critical vulnerability):
# VULNERABLE: mirrors any Origin header back
origin = request.headers.get("Origin", "")
response.headers["Access-Control-Allow-Origin"] = origin # Mirrors attacker!
response.headers["Access-Control-Allow-Credentials"] = "true"An attacker creates a page at https://evil.com that sends a credentialed CORS request to your API. Your API responds with Access-Control-Allow-Origin: https://evil.com, allowing the attacker to read the victim's private data.