Java CORS reflects Origin header with credentials allowed
Rule ID: vetkit.java.cors.reflected-origin
The request's Origin header is reflected into Access-Control-Allow-Origin while Access-Control-Allow-Credentials is true, so any website can make credentialed cross-origin requests and read the responses.
Last updated:
Suite: Security
java
The request's Origin header is reflected into Access-Control-Allow-Origin while Access-Control-Allow-Credentials is true, so any website can make credentialed cross-origin requests and read the responses.
Category: SECURITY · Engine rule severity: WARNING
How to fix it
Compare the Origin against an explicit allow-list (exact match) before echoing it, or drop Access-Control-Allow-Credentials and answer with a fixed origin.
References
Source: packages/engine/rules/sast/java.yml.
Related checks
- Android WebView setAllowFileAccess(true) enabled
- Android WebView onReceivedSslError calls proceed()
- Android WebView addJavascriptInterface with JavaScript on
- Android WebView setAllowUniversalAccessFromFileURLs enabled
- Android MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE files
- Java expression injection: SpEL, OGNL, MVEL, JEXL or EL
Check your own repository for this
vetkit runs this rule as part of a repository audit, alongside secret scanning, dependency vulnerabilities, code quality and AI code risk checks. It reads a temporary checkout and never executes your code.
Start with the free Security Quick Scan · See how the platform works
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.