Skip to content

fix(manager): use timingSafeEqual for password comparisons#22

Open
codejunkie99 wants to merge 1 commit into
lunel-dev:mainfrom
codejunkie99:fix/timing-safe-password-compare
Open

fix(manager): use timingSafeEqual for password comparisons#22
codejunkie99 wants to merge 1 commit into
lunel-dev:mainfrom
codejunkie99:fix/timing-safe-password-compare

Conversation

@codejunkie99

@codejunkie99 codejunkie99 commented Apr 18, 2026

Copy link
Copy Markdown

Issue
Password comparisons use ===, which is not constant-time and leaks
timing information on matching-prefix length.

Where

  • manager/src/index.ts:1442 — legacy admin auth
  • manager/src/index.ts:3527 — admin login POST
  • manager/src/index.ts:3963 — gateway control WS auth

Fix
Swap === for crypto.timingSafeEqual. The symbol is already imported
at line 3 and used correctly in verifyJwtToken at line 397, this just
makes the other three spots consistent.

Risk
None. Same behavior on the happy path, no protocol change, no new deps.

- manager/src/index.ts:1442 (legacy admin auth)
- manager/src/index.ts:3527 (admin login POST)
- manager/src/index.ts:3963 (gateway control WS auth)

Matches the pattern already used in verifyJwtToken at :397.
@o1x3

o1x3 commented May 14, 2026

Copy link
Copy Markdown

Same !== check is on the proxy side too, in proxy/src/index.ts at lines 960, 968, 980, 1013, 1038. The same helper would cover those. Want me to add them to this PR or open a separate one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants