fix(deps): update dependency crypto-js to v4 [security] - #212
Open
renovate[bot] wants to merge 1 commit into
Open
fix(deps): update dependency crypto-js to v4 [security]#212renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
from
January 21, 2026 15:20
5cb1a49 to
d43aa9f
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
from
February 13, 2026 19:20
d43aa9f to
db30ca0
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
from
March 13, 2026 11:50
db30ca0 to
d74d160
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
2 times, most recently
from
April 16, 2026 14:10
d74d160 to
dee976a
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
from
April 29, 2026 09:53
dee976a to
0f71875
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
from
May 12, 2026 15:16
0f71875 to
ee6648b
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
2 times, most recently
from
May 27, 2026 00:50
ee6648b to
9f1d473
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
2 times, most recently
from
July 20, 2026 22:47
9f1d473 to
d056146
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
from
August 11, 2026 23:51
d056146 to
b1630e4
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
2 times, most recently
from
August 12, 2026 23:21
b1630e4 to
3463074
Compare
renovate
Bot
force-pushed
the
renovate-npm-crypto-js-vulnerability
branch
from
August 26, 2026 21:20
3463074 to
3faa4dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.1.9-1→^4.0.0crypto-js: Insufficient Entropy in Cryptographic Secret Generation via Vulnerable CryptoJS Dependency Chain
CVE-2026-71851 / GHSA-rg76-677x-56q9
More information
Details
Summary
CryptoJS.lib.WordArray.random()in affected versions is not a cryptographically secure random number generator. Nominal requests for 128 or 256 bits of entropy produce effective search spaces of approximately 2^39 and 2^47 possibilities — small enough to enumerate on commodity hardware.Coinspect's Ill Bloom investigation confirmed that downstream wallet applications used this function as the entropy source for BIP39 recovery phrases.
An application is affected only if it uses the vulnerable function to generate security-sensitive values.
Merely depending on
crypto-js < 4.0.0is not sufficient to be exploitable.Details
The affected implementation used a custom variation of George Marsaglia's Multiply-With-Carry PRNG, seeded from
Math.random(). It was introduced in 3.1.2-4 (June 2014, commit brix/crypto-js@ff1f003) in response to issue #7, and was present in every 3.x release except 3.2.0 and 3.2.1. That change was reverted in 3.3.0 because it was considered a breaking change, so projects tracking the 3.x line could resolve to newer versions that still contained the weak generator.4.0.0 replaced the generator with the platform's native cryptographic API.
Applying PBKDF2, another KDF, or a cryptographic hash after the vulnerable generator does not restore missing entropy.
Proof of concept
Coinspect reproduced the attack end to end:
WordArray.random()behavior.Impact
An attacker can enumerate the reduced output space and recover security-sensitive values generated through the affected function.
Coinspect documented coordinated drain waves affecting addresses derived from vulnerable recovery phrases. As of July 13, 2026, the measured lower bound of stolen assets across the two events was approximately $5M.
The consequences are persistent:
Remediation
For projects:
crypto-jsto version4.0.0or later. Where possible, replace CryptoJS randomness with the native Web Crypto API or Node.jscryptomodule.crypto-jsmatching< 4.0.0.CryptoJS.lib.WordArray.random()was used to generate any security-sensitive values.For wallet users: create a new wallet with a newly generated recovery phrase from a trustworthy source and migrate assets to addresses derived from it. Do not import the existing recovery phrase into the new wallet.
Public address checker
Coinspect provides a public checker for addresses identified in the known Ill Bloom exposed-address datasets:
https://illbloom.org/
Only public blockchain addresses should be entered. Users must never enter a recovery phrase, seed phrase, mnemonic, private key, password, or wallet backup file.
A match indicates that funds controlled by the same recovery phrase may be at immediate risk. A negative result only means that the submitted address was not found in the currently published datasets.
References
https://illbloom.org/
https://www.coinspect.com/blog/ill-bloom-investigation/
randomBytes is not random enough:https://github.com/brix/crypto-js/issues/7
https://github.com/brix/crypto-js/commit/ff1f0032ff58aedfcc44eb6aa7b2c78207a98009
3.3.0and4.0.0:https://github.com/brix/crypto-js/compare/3.3.0...4.0.0
ferrumnet/bip39fork:https://github.com/ferrumnet/bip39
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
crypto-js PBKDF2 1,000 times weaker than specified in 1993 and 1.3M times weaker than current standard
CVE-2023-46233 / GHSA-xwcq-pm8m-c4vf
More information
Details
Impact
Summary
Crypto-js PBKDF2 is 1,000 times weaker than originally specified in 1993, and at least 1,300,000 times weaker than current industry standard. This is because it both (1) defaults to SHA1, a cryptographic hash algorithm considered insecure since at least 2005 and (2) defaults to one single iteration, a 'strength' or 'difficulty' value specified at 1,000 when specified in 1993. PBKDF2 relies on iteration count as a countermeasure to preimage and collision attacks.
Potential Impact:
Probability / risk analysis / attack enumeration:
Update: PBKDF2 requires a pseudo-random function that takes two inputs, so HMAC-SHA1 is used rather than plain SHA1. HMAC is not affected by length extension attacks. However, by defaulting to a single PBKDF2 iteration, the hashes do not benefit from the extra computational complexity that PBKDF2 is supposed to provide. The resulting hashes therefore have little protection against an offline brute-force attack.
crypto-js has 10,642 public users as displayed on NPM, today October 11th 2023. The number of transient dependents is likely several orders of magnitude higher.
A very rough GitHub search shows 432 files cross GitHub using PBKDF2 in crypto-js in Typescript or JavaScript, but not specifying any number of iterations.
Affected versions
All versions are impacted. This code has been the same since crypto-js was first created.
Further Cryptanalysis
The issue here is especially egregious because the length extension attack makes useless any secret that might be appended to the plaintext before calculating its signature.
Consider a scheme in which a secret is created for a user's username, and that secret is used to protect e.g. their passwords. Let's say that password is 'fake-password', and their username is 'example-username'.
To encrypt the user password via symmetric encryption we might do
encrypt(plaintext: 'fake-password', encryption_key: cryptojs.pbkdf2(value: 'example username' + salt_or_pepper)). By this means, we would, in theory, create anencryption_keythat can be determined from the public username, but which requires the secretsalt_or_pepperto generate. This is a common scheme for protecting passwords, as exemplified in bcrypt & scrypt. Because the encryption key is symmetric, we can use this derived key to also decrypt the ciphertext.Because of the length extension issue, if the attacker obtains (via attack 1), a collision with 'example username', the attacker does not need to know
salt_or_pepperto decrypt their account data, only their public username.Description
PBKDF2 is a key-derivation is a key-derivation function that is used for two main purposes: (1) to stretch or squash a variable length password's entropy into a fixed size for consumption by another cryptographic operation and (2) to reduce the chance of downstream operations recovering the password input (for example, for password storage).
Unlike the modern webcrypto standard, crypto-js does not throw an error when a number of iterations is not specified, and defaults to one single iteration. In the year 2000, when PBKDF2 was originally specified, the minimum number of iterations suggested was set at 1,000. Today, OWASP recommends 1,300,000:
https://github.com/brix/crypto-js/blob/4dcaa7afd08f48cd285463b8f9499cdb242605fa/src/pbkdf2.js#L22-L26
Patches
No available patch. The package is not maintained.
Workarounds
Consult the OWASP PBKDF2 Cheatsheet. Configure to use SHA256 with at least 250,000 iterations.
Coordinated disclosure
This issue was simultaneously submitted to crypto-js and crypto-es on the 23rd of October 2023.
Caveats
This issue was found in a security review that was not scoped to crypto-js. This report is not an indication that crypto-js has undergone a formal security assessment by the author.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
brix/crypto-js (crypto-js)
v4.2.0Compare Source
v4.1.1Compare Source
v4.1.0Compare Source
v4.0.0Compare Source
v3.3.0Compare Source
v3.2.1Compare Source
v3.2.0Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.