H-4 `_box_login` HMAC 兼容期,删除 S-4 holding-box- 后门
Summary
-
_box_loginHMAC 兼容期:无签名仍可登录;三字段齐全则校验;require-hmac=true且 secret 空则拒绝启动 - HMAC 抽到
HmacUtils,login canonical 首行login,与 H-2 注册签名隔离;nonce Redis key 分开 - 有签名时
deviceCode必填且绑定本机/本租户;校验失败不踢旧会话 - 删除 S-4
holding-box-后门,box-token只查 Redis - 不并进 H-2 !1612 (merged) / H-3 !1614 (merged):源分支
hotfix/h4-box-login-auth,目标hotfix/h3-h264-auth
Test plan
- 兼容期无签名 + 合法 boxNo 仍发 token
- 兼容期错误 HMAC 拒绝,旧 token 仍在
- 正确 HMAC + deviceCode 绑本机发 token
- 正确 HMAC + deviceCode 绑他机/他租户拒绝
-
require-hmac=true无签名拒绝 - nonce 重放第二次失败
-
box-token: holding-box-1返回 TOKEN_EXPIRED
配仓另仓:box-config-repo !2。 方案:钉钉 H-4
兼容期无签名仍可仅凭 boxNo 登录,不算关闭 CWE-287。