← PHP / Laravel · 目录

PHP-075 / 中级

对外暴露配置缓存或环境变量(config:cache 文件)

A05:2021 Security Misconfiguration · CWE-200 Exposure of Sensitive Information

为什么存在问题?

bootstrap/cache/config.php 公开会泄露所有配置值。

如何修复

nginx
# 仅将 public 作为文档根目录,阻止 Web 访问 bootstrap/storage 路径

延伸阅读