medium · M3 · MASVS-NETWORK-1 · PTKD-API-CORS-WILDCARD
Permissive CORS with credentials
An endpoint returned Access-Control-Allow-Origin: * together with Access-Control-Allow-Credentials: true (or reflected an arbitrary Origin), which lets any website read authenticated responses.
How it is exploited
An endpoint returns Access-Control-Allow-Origin: * (or reflects the request Origin) together with Access-Control-Allow-Credentials: true. Any malicious website the user visits can then make credentialed cross-origin requests to your API and read the authenticated responses.
Why it matters
Cross-site data theft: another site reads the victim's private API responses using their session.
How to fix it
- Never combine a wildcard or reflected origin with credentialed CORS.
- Allow-list the exact origins that need cross-origin access, and avoid credentials on cross-origin APIs entirely where possible.
Does your app have this?
PTKD checks your build or your source project for PTKD-API-CORS-WILDCARD and every other check in this knowledge base.
Scan your appReferences
Related checks (M3)
- State-changing request succeeded without authentication
- Weak JWT observed on the wire
- Biometric authentication not bound to a cryptographic key
- Premium access is stored on the phone and trusted (heuristic)
- Firebase rules trust an email address nobody verified
- Firebase security rules open to everyone
- Users can make themselves admin or premium in Firestore
- Supabase auth settings in the local config (check the hosted project)