mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-02 11:14:02 +00:00
StrHelper::strncpy null-terminates but does NOT zero-pad the 16-byte password buffer, so setting a shorter password over a longer previous value (e.g. one inherited from a prior repeater config) leaves trailing garbage. onAnonDataRecv's constant-time compare runs over the full buffer width, so a correct password stopped matching — admin/guest logins were silently rejected, or downgraded to a read-only guest when allow_read_only was on (the login looked identical to read-only). Fix: copy both stored passwords into zeroed buffers (up to strnlen) before the constant-time compare, so the comparison reflects the actual string while staying constant-time over the full width. Hardware-verified on the kit: admin login with the correct password now grants ADMIN (post + remote management), confirmed server-side via get acl (perms 03). Note: the repeater's handleLoginReq shares this latent issue.