You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
move from buffer-equal-constant-time to timingSafeEqual #46
This is causing a failed build on my production project due to multiple libraries depending on jsonwebtoken or jws, that ultimately depend on this library.
Would prefer a NodeJS dependency free solution that dose not depend on node:crypto or node:buffer in the hope of one day being better cross compatible with other env. and instead operates on Uint8Array
So i would just rather inline the solution and build a more generic solution that works on any typed array.
We've released patched versions of the jwa module. These releases take care of not using the deprecated code when crypto.timingSafeEqual() is available (while still using it when run in legacy codebase with EOL Node.js versions where it wasn't available).
Running npm upgrade jwa (or whichever package manager alternative you happen to use) will pick those patched versions up and fix the issue for you.
I will leave this issue open to hopefully avoid new issues from being open and will comment again when a Node.js release with the deprecated (but not removed) functionality is available.
Edit: Node.js v24.0.1 was released on 2025-05-08 which reverts the problematic removal, it will still be removed in v25.x in October, but with the release of jwa@1.4.2 and jwa@2.0.1 these APIs are no longer in use so long as you upgrade your dependency tree, e.g. via npm upgrade jwa.
Reacted by TÖRÖK Attila, Yahor Siarheyenka, Gabriel Ebner and Mirla Braga
Reacted by Yahor Siarheyenka, TÖRÖK Attila, Théo LUDWIG, Gabriel Ebner and Mirla Braga
Activity
thaisfaria commentedon Mar 30, 2023
This is causing a failed build on my production project due to multiple libraries depending on jsonwebtoken or jws, that ultimately depend on this library.
jimmywarting commentedon Aug 25, 2023
Would prefer a NodeJS dependency free solution that dose not depend on
node:cryptoornode:bufferin the hope of one day being better cross compatible with other env. and instead operates onUint8ArraySo i would just rather inline the solution and build a more generic solution that works on any typed array.
shrujalshah28 commentedon May 2, 2025
This package use SlowBuffer.prototype.equal; which will be removed in upcoming Node.js v24
theoludwig commentedon May 6, 2025
Node.js v24.0.0 was released, and now causing a crash:
dasbts commentedon May 6, 2025
Same issue, today it broke with the new Node.
panva commentedon May 7, 2025
We've released patched versions of the
jwamodule. These releases take care of not using the deprecated code whencrypto.timingSafeEqual()is available (while still using it when run in legacy codebase with EOL Node.js versions where it wasn't available).Running
npm upgrade jwa(or whichever package manager alternative you happen to use) will pick those patched versions up and fix the issue for you.I will leave this issue open to hopefully avoid new issues from being open and will comment again when a Node.js release with the deprecated (but not removed) functionality is available.
Edit: Node.js v24.0.1 was released on 2025-05-08 which reverts the problematic removal, it will still be removed in v25.x in October, but with the release of jwa@1.4.2 and jwa@2.0.1 these APIs are no longer in use so long as you upgrade your dependency tree, e.g. via
npm upgrade jwa.Update deps, specifically jwa
kirrg001 commentedon Oct 13, 2025
Node v25 rc.1 fails because of that. Is there any plan to migrate to timingSafeEqual soon?
panva commentedon Oct 13, 2025
@kirrg001 jwa@1.4.2 and jwa@2.0.1 do use timingSafeEqual when available in the runtime. You just have to update your dependency tree.
build: bumped jwa sub dependency
build: bumped jwa sub dependency
build: bumped jwa sub dependency (#2065)
Support nodejs 25 by bumping jwa.
mbtools commentedon Dec 12, 2025
Closed by #52