Garry Tan
79f7a24eb4
fix(token-registry): UTF-8 byte-length short-circuit before timingSafeEqual
...
Constant-time compare on the root token now compares UTF-8 byte lengths
before crypto.timingSafeEqual, which throws on length-mismatched buffers.
A multibyte input whose JS string length matches but byte length differs
no longer crashes on the auth path; isRootToken returns false instead.
Tests cover the four interesting cases: multibyte byte-length mismatch,
extra-prefix length mismatch, same-length last-byte flip, and empty input
against a set root.
Contributed by @RagavRida (#1416 ).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-10 11:04:54 -07:00
..
2026-04-23 10:23:40 -07:00
2026-03-26 11:15:24 -06:00
2026-03-28 08:35:24 -06:00
2026-04-07 00:23:36 -07:00
2026-05-07 20:14:59 -07:00
2026-05-09 08:06:47 -07:00
2026-03-26 11:15:24 -06:00
2026-04-28 20:08:04 -07:00
2026-04-28 20:08:04 -07:00
2026-04-28 20:08:04 -07:00
2026-04-28 20:08:04 -07:00
2026-04-16 13:49:04 -07:00
2026-03-20 12:22:11 -07:00
2026-04-28 20:08:04 -07:00
2026-04-28 20:08:04 -07:00
2026-04-28 20:08:04 -07:00
2026-05-01 07:21:28 -07:00
2026-04-18 23:25:33 +08:00
2026-04-07 00:23:36 -07:00
2026-03-24 00:38:10 -07:00
2026-04-21 21:58:27 -07:00
2026-03-23 22:15:23 -07:00
2026-04-17 00:45:13 -07:00
2026-05-07 20:14:59 -07:00
2026-04-08 00:41:55 -07:00
2026-05-09 08:06:47 -07:00
2026-05-09 08:06:47 -07:00
2026-04-28 00:57:28 -07:00
2026-04-18 23:25:33 +08:00
2026-04-10 17:13:15 -10:00
2026-03-26 11:15:24 -06:00
2026-05-09 08:06:47 -07:00
2026-03-19 18:20:50 -07:00
2026-03-27 00:44:37 -06:00
2026-04-21 21:58:27 -07:00
2026-03-29 23:35:17 -06:00
2026-03-26 23:21:27 -06:00
2026-04-07 00:23:36 -07:00
2026-04-06 00:47:04 -07:00
2026-04-21 21:58:27 -07:00
2026-04-28 00:57:28 -07:00
2026-04-06 00:47:04 -07:00
2026-04-20 13:20:30 +08:00
2026-03-20 12:22:11 -07:00
2026-05-07 20:14:59 -07:00
2026-05-07 20:14:59 -07:00
2026-04-25 22:52:15 -07:00
2026-04-23 10:23:40 -07:00
2026-04-25 22:52:15 -07:00
2026-04-23 10:23:40 -07:00
2026-04-23 10:23:40 -07:00
2026-04-23 10:23:40 -07:00
2026-04-20 22:18:37 +08:00
2026-04-20 22:18:37 +08:00
2026-04-23 10:23:40 -07:00
2026-04-20 22:18:37 +08:00
2026-04-20 22:18:37 +08:00
2026-04-20 22:18:37 +08:00
2026-04-20 22:18:37 +08:00
2026-05-09 08:06:47 -07:00
2026-04-28 20:08:04 -07:00
2026-05-09 08:06:47 -07:00
2026-05-07 20:14:59 -07:00
2026-05-09 08:06:47 -07:00
2026-04-21 21:58:27 -07:00
2026-04-20 22:18:37 +08:00
2026-04-25 22:52:15 -07:00
2026-03-26 22:07:03 -06:00
2026-04-06 00:47:04 -07:00
2026-04-28 20:08:04 -07:00
2026-04-07 00:23:36 -07:00
2026-05-07 20:14:59 -07:00
2026-04-21 21:58:27 -07:00
2026-03-28 08:35:24 -06:00
2026-05-07 20:14:59 -07:00
2026-04-25 22:52:15 -07:00
2026-04-28 20:08:04 -07:00
2026-05-09 08:06:47 -07:00
2026-04-28 20:08:04 -07:00
2026-04-25 22:52:15 -07:00
2026-04-25 22:52:15 -07:00
2026-03-13 00:31:41 -07:00
2026-05-10 11:04:54 -07:00
2026-04-28 00:57:28 -07:00
2026-04-21 21:58:27 -07:00
2026-03-26 11:15:24 -06:00
2026-04-17 00:45:13 -07:00
2026-04-04 10:17:05 -07:00
2026-05-07 20:14:59 -07:00