fix(static): 第2轮审计修复12项安全缺陷
修复 P1 路径遍历前缀 bypass、代理错误信息泄露、大文件 OOM、邮箱枚举与 CORS 通配;P2 Range 边界、hash 参数校验、db 连接复用、favicon 端口校验、日志批丢、端口解析异常。CSP/SSL 标记为已知限制。审计文档同步更新,修复率 36% → 88%。
This commit is contained in:
1 parent
1ed48a1f48
commit
bcec529761
4 files changed
+421
-172
No files matched your search
@@ -23,6 +23,9 @@ def apply_security_headers(app, csp_policy=None):
|
||||
response.headers['Permissions-Policy'] = 'camera=(), microphone=(), geolocation=()'
|
||||
|
||||
# Content Security Policy
|
||||
# 注:script-src 含 'unsafe-inline' 因 dnfs 特殊节点"前端代码"功能需要内联脚本。
|
||||
# NEW-11(已知限制):若发生 HTML 注入,CSP 无法阻止 XSS 执行。
|
||||
# 后续改进方向:改用 CSP nonce('nonce-{random}'),需同步改造 dnfs 前端注入逻辑。
|
||||
if csp_policy:
|
||||
response.headers['Content-Security-Policy'] = csp_policy
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user