3x-ui/internal/util
Aleksey Fedorov 7367ff75cd
fix(2fa): accept display forms of the TOTP secret and never panic on a bad one (#7113)
gotp decodes the stored secret with strict base32 and panics when that fails,
so a 2FA secret saved through the settings API in lower case, grouped by
spaces, or not base32 at all turned every login and every attempt to turn 2FA
off into an HTTP 500. An empty secret had the opposite problem: the login
check accepted the code of an empty HMAC key, which anyone can compute.

VerifyWithSkew now normalizes the secret and verifies nothing for an empty or
non-base32 one, so secrets already stored in a display form work again.
Turning 2FA on through the settings update stores the normalized secret and
refuses one no authenticator could match.
2026-11-13 00:13:13 +01:00
..
common fix(url): keep capitalized mailto: and tel: links as they are (#7052) 2026-11-02 15:22:43 +01:00
cronspec fix(settings): accept five-field crontab for report and LDAP schedules 2026-10-11 20:37:04 +02:00
crypto feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
json_util fix(api): cap the client traffic list a master pushes by entry count 2026-10-31 14:25:21 +01:00
ldap feat: ldap skip tls verify (#5637) 2026-06-28 18:10:38 +02:00
link fix(link): keep IPv6 brackets in imported wireguard endpoints (#6976) 2026-11-03 15:52:09 +01:00
maskcompat fix(service): keep chunk capacity math from overflowing 2026-10-11 22:10:46 +02:00
netproxy Test-quality audit: fix 2 prod bugs, strengthen weak tests, add mutation/fuzz/CI tooling (#5345) 2026-06-15 15:17:03 +02:00
netsafe fix(netsafe): give a guarded dial one time budget for every address 2026-10-31 09:19:54 +00:00
random style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
reflect_util refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
sys fix(memory): derive the Go soft limit from the panel's own cgroup (#7102) 2026-11-12 23:35:08 +01:00
totp fix(2fa): accept display forms of the TOTP secret and never panic on a bad one (#7113) 2026-11-13 00:13:13 +01:00
version refactor(util): move panel version comparison into a shared package 2026-10-02 23:56:52 +02:00
wirecodec perf(wirecodec): decode a config envelope into one buffer 2026-10-31 09:09:22 +00:00
wireguard feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00