← PHP / Laravel · Contents

PHP-032 / Intermediate

CORS wildcard with credentials allowed

A05:2021 Security Misconfiguration · CWE-942 Permissive Cross-domain Policy

Why is this a problem?

Arbitrary sites can read logged-in users' data.

How to fix it

php
'allowed_origins' => ['https://app.example.com'],
'supports_credentials' => true,

Further reading