2FA二维码token加v1_前缀:线上WAF拦截「t=32位以上纯hex」形态,前缀破坏纯hex特征(实测可过)
Check Source / check (push) Successful in 2s
Auto Release / build (push) Failing after 44s
Simple Test / test (push) Successful in 1s
Test Env / test (push) Successful in 1s

This commit is contained in:
youpaishidifu
2026-10-01 10:37:21 +08:00
parent 32aa2bab05
commit d56fcbd3cd
@@ -113,7 +113,8 @@ public class TwoFactorManager {
System.currentTimeMillis());
// 一次性随机 token:玩家凭它读取二维码载荷(10 分钟有效)
String token = hex(randomBytes(32));
// v1_ 前缀:线上WAF会拦「t=纯32+位hex」形态,前缀破坏纯hex特征(已实测通过)
String token = "v1_" + hex(randomBytes(32));
String uri = otpauthUri(p.getName(), secret);
// pending 已落库,玩家立即可 /2fa code;二维码链接异步推送后补发