High severityPHPInsecure ConfigurationHIGH confidence
CORS Reflected Origin With Credentials
The request Origin header is reflected directly into Access-Control-Allow-Origin (CWE-942).
Standards mapping
- OWASP Top 10
- A05:2021 - Security Misconfiguration
- OWASP ASVS
- V14.5.3 (L1)
Vulnerable vs. safe
Flagged by this check
header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]);Passes - the safe pattern
header("Access-Control-Allow-Origin: " . $allowed);Why it matters & how to fix it
The request Origin header is reflected directly into Access-Control-Allow-Origin (CWE-942). This trusts every origin and, with Allow-Credentials, lets any site read authenticated responses. Compare the Origin against a fixed allow-list and only echo it back if it matches.
References
Rule ID integsec-php-cors-reflected-origin-with-credentials - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Insecure ConfigurationCORS Acao Wildcard Header
- JavaScript / TypeScript - Insecure ConfigurationCORS Wildcard Origin
- JavaScript / TypeScript - Insecure ConfigurationCORS Wildcard With Credentials
- JavaScript / TypeScript - Insecure ConfigurationCSRF Protection Disabled
- JavaScript / TypeScript - Insecure ConfigurationExpress Trust Proxy All
- JavaScript / TypeScript - Insecure ConfigurationExpress X Powered By Enabled