yangjianbo
e75d3e3584
fix(security): 修复密码重置链接 Host Header 注入漏洞 (P0-07)
ForgotPassword 原来从 c.Request.Host 构建重置链接基础 URL,攻击者
可伪造 Host 头将重置链接指向恶意域名窃取 token。
修复方案:
- ServerConfig 新增 frontend_url 配置项
- auth_handler 改为从配置读取前端 URL,未配置时拒绝请求
- Validate() 校验 frontend_url 必须为绝对 HTTP(S) URL
- 新增 TestValidateServerFrontendURL 单元测试
- config.example.yaml 添加配置说明
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 17:15:26 +08:00
..
2026-02-07 17:15:26 +08:00
2026-02-03 15:36:17 +08:00
2026-02-07 17:15:26 +08:00
2026-01-01 01:43:20 +08:00
2026-02-02 22:13:50 +08:00
2026-02-05 21:52:54 +08:00
2026-02-06 08:50:45 +08:00
2026-02-06 01:06:22 +08:00
2026-02-07 16:34:57 +08:00
2026-02-07 17:09:55 +08:00
2026-02-02 22:13:50 +08:00
2026-02-02 22:13:50 +08:00
2026-01-16 17:05:49 +08:00