Skip to content

fix: resolve timingSafeEqual infinite recursion bug#63

Open
0xAxiom wants to merge 1 commit intomainfrom
fix/timing-safe-equal-infinite-recursion
Open

fix: resolve timingSafeEqual infinite recursion bug#63
0xAxiom wants to merge 1 commit intomainfrom
fix/timing-safe-equal-infinite-recursion

Conversation

@0xAxiom
Copy link
Owner

@0xAxiom 0xAxiom commented Mar 2, 2026

What

Fix infinite recursion bug in plugins/repo-mode-launch/lib/hashing.ts.

The exported timingSafeEqual function shadowed the imported crypto.timingSafeEqual, causing the function to call itself recursively instead of the Node.js crypto implementation. This results in a stack overflow whenever hash comparison is attempted.

Changes

  • Renamed the crypto import to cryptoTimingSafeEqual to avoid shadowing
  • Renamed the exported function to timingSafeHashEqual for clarity
  • The function now correctly delegates to Node.js crypto.timingSafeEqual

Impact

Runtime crash — any code path calling timingSafeEqual from this module would hit infinite recursion and crash with a stack overflow.

Tested

  • ESLint + Prettier pass (lint-staged ran on commit)
  • No other files import timingSafeEqual from hashing.ts (only repo-attestation.ts and naming.ts import other functions)

The exported timingSafeEqual function shadowed the imported crypto.timingSafeEqual,
causing infinite recursion when called. Renamed the export to timingSafeHashEqual
and the import to cryptoTimingSafeEqual to avoid the naming collision.
@0xAxiom 0xAxiom requested a review from MeltedMindz as a code owner March 2, 2026 01:03
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.

1 participant