xfy
179090fa34
fix(security): 修复 2 个 CRITICAL + 6 个 HIGH 安全与代码质量问题
安全修复:
- ConnLimiter Acquire() TOCTOU 竞态: atomic.AddInt64 替代 loadInt64+addInt64
- Cache Purge token 时序侧信道: 改用 subtle.ConstantTimeCompare
- Lua Cosocket SSRF: 新增 ip_guard 两层 IP 检查(字面量+解析后),拒绝私有/回环地址
- X-Accel-Redirect 路径遍历: urlpath.Clean + 前缀拒绝(/internal/ /admin/)
- CRLF 注入: containsCRLF 校验变量展开后的 header 值,logging.Warn 可观测
- Proxy URI 注入: bytes.ContainsAny 检查 path 中的 @\r\n 危险字符
代码质量:
- disk_cache.go Set() 7 处静默 return 改为 logging.Error 日志记录
- config.go 从 2392 行拆分为 9 个按域文件(config/server/proxy/security/ssl/cache/performance/monitoring/variable)
验证: go build + vet + golangci-lint(0 issues) + test(83.2% 无回归) + race detector 全部通过
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 10:13:47 +08:00
..
2026-04-24 18:24:31 +08:00
2026-04-13 17:38:49 +08:00
2026-04-20 10:59:17 +08:00
2026-04-16 18:12:16 +08:00
2026-04-20 10:59:17 +08:00
2026-04-13 09:24:43 +08:00
2026-04-20 10:59:17 +08:00
2026-04-13 16:15:31 +08:00
2026-04-20 10:59:17 +08:00
2026-04-13 16:15:31 +08:00
2026-04-20 10:59:17 +08:00
2026-04-11 12:17:34 +08:00
2026-04-20 10:59:17 +08:00
2026-04-20 08:27:24 +08:00
2026-04-20 10:59:17 +08:00
2026-04-16 18:24:05 +08:00
2026-04-28 10:13:47 +08:00
2026-04-13 09:51:44 +08:00
2026-04-20 11:23:03 +08:00
2026-04-16 18:12:16 +08:00
2026-04-20 16:03:41 +08:00
2026-04-23 17:20:32 +08:00
2026-04-20 11:23:03 +08:00
2026-04-20 10:59:17 +08:00
2026-04-10 16:55:38 +08:00
2026-04-20 11:23:03 +08:00
2026-04-20 11:23:03 +08:00
2026-04-20 11:23:03 +08:00
2026-04-20 11:23:03 +08:00
2026-04-16 13:50:15 +08:00
2026-04-20 11:23:03 +08:00
2026-04-28 10:13:47 +08:00
2026-04-28 10:13:47 +08:00
2026-04-16 13:50:15 +08:00
2026-04-16 11:09:26 +08:00
2026-04-16 13:50:15 +08:00
2026-04-11 13:34:34 +08:00
2026-04-20 10:59:17 +08:00
2026-04-13 16:50:14 +08:00
2026-04-20 11:23:03 +08:00
2026-04-20 10:59:17 +08:00
2026-04-20 10:59:17 +08:00
2026-04-23 17:20:32 +08:00
2026-04-10 16:55:38 +08:00
2026-04-12 11:21:17 +08:00
2026-04-20 10:59:17 +08:00
2026-04-28 10:13:47 +08:00
2026-04-28 10:13:47 +08:00