Permissive Access-Control-Allow-Origin configuration

Description

Setting the Access-Control-Allow-Origin header to "*" allows code from any origin to access the response. This can lead to unintended access to sensitive data.

Remediations

✅ Permit only the specific origins needed by your application

header("Access-Control-Allow-Origin: myapp.example.com");

Resources

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=java_lang_permissive_allow_origin

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=java_lang_permissive_allow_origin

Ready to take the next step? Learn more about Bearer Cloud.