gstack/browse
RagavRida fa754092e3 fix(token-registry): UTF-8 byte-length short-circuit before timingSafeEqual
isRootToken's length check compared JS string lengths, but the buffers
passed to crypto.timingSafeEqual are UTF-8 byte representations. A
multibyte token whose JS string length matches rootToken (e.g.
"é".repeat(20), 20 chars / 40 bytes, vs a 20-byte ASCII root) would
slip past the length check and crash inside timingSafeEqual on the
mismatched-buffer-size invariant, turning a 401/403 auth-rejection path
into an unhandled exception.

Switch the short-circuit to Buffer.byteLength(token, 'utf8') and build
the comparison buffers with explicit 'utf8' encoding.

Regression tests cover: multibyte input with matching string length but
differing byte length (the actual bug, asserts not.toThrow plus false),
differing-length tokens (short-circuit branch), same-length differ-by-
last-byte (timingSafeEqual branch), and empty string when root is set.

Caught by Codex during pre-landing review of #1171.
2026-05-10 19:03:43 +05:30
..
bin feat: multi-agent support — gstack works on Codex, Gemini CLI, and Cursor (v0.9.0) (#226) 2026-03-19 18:20:50 -07:00
scripts fix: ngrok Windows build + close CI error-swallowing gap (v0.18.0.1) (#1024) 2026-04-16 13:49:04 -07:00
src fix(token-registry): UTF-8 byte-length short-circuit before timingSafeEqual 2026-05-10 19:03:43 +05:30
test fix(token-registry): UTF-8 byte-length short-circuit before timingSafeEqual 2026-05-10 19:03:43 +05:30
PLAN-snapshot-dropdown-interactive.md fix: snapshot -i auto-detects dropdown/popover interactive elements (#845) 2026-04-05 22:57:45 -07:00
SKILL.md v1.31.0.0 fix: delete AskUserQuestion fallback (root cause of forever war) + harness primitives (#1390) 2026-05-09 17:01:13 -07:00
SKILL.md.tmpl v1.28.0.0 feat: browse --headed/--proxy/--navigate + gstack/llms.txt + webdriver-only stealth (#1363) 2026-05-07 20:14:59 -07:00