← PHP / Laravel · 目录

PHP-032 / 中级

CORS 通配符与允许凭据

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

为什么存在问题?

任意网站可读取已登录用户的数据。

如何修复

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

延伸阅读