crypto-js is a JavaScript library of crypto standards. Prior to version 4.2.0, 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 defaults to SHA1, a cryptographic hash algorithm considered insecure since at least 2005, and 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. If used to protect passwords, the impact is high. If used to generate signatures, the impact is high. Version 4.2.0 contains a patch for this issue. As a workaround, configure crypto-js to use SHA256 with at least 250,000 iterations.
The product uses an algorithm that produces a digest (output value) that does not meet security expectations for a hash function that allows an adversary to reasonably determine the original input (preimage attack), find another input that can produce the same hash (2nd preimage attack), or find multiple inputs that evaluate to the same hash (birthday attack).
Name | Vendor | Start Version | End Version |
---|---|---|---|
Crypto-js | Crypto-js_project | * | 4.2.0 (excluding) |
Red Hat Enterprise Linux 8 | RedHat | dotnet7.0 | * |
Red Hat Enterprise Linux 8 | RedHat | dotnet6.0 | * |
Red Hat Enterprise Linux 8 | RedHat | dotnet7.0 | * |
Red Hat Enterprise Linux 9 | RedHat | dotnet7.0 | * |
Red Hat Enterprise Linux 9 | RedHat | dotnet6.0 | * |
Red Hat Enterprise Linux 9 | RedHat | dotnet7.0 | * |
Cryptojs | Ubuntu | bionic | * |
Cryptojs | Ubuntu | esm-apps/bionic | * |
Cryptojs | Ubuntu | esm-apps/jammy | * |
Cryptojs | Ubuntu | esm-apps/noble | * |
Cryptojs | Ubuntu | esm-apps/xenial | * |
Cryptojs | Ubuntu | focal | * |
Cryptojs | Ubuntu | jammy | * |
Cryptojs | Ubuntu | lunar | * |
Cryptojs | Ubuntu | mantic | * |
Cryptojs | Ubuntu | noble | * |
Cryptojs | Ubuntu | trusty | * |
Cryptojs | Ubuntu | upstream | * |
Cryptojs | Ubuntu | xenial | * |
A hash function is defined as an algorithm that maps arbitrarily sized data into a fixed-sized digest (output) such that the following properties hold:
Building on this definition, a cryptographic hash function must also ensure that a malicious actor cannot leverage the hash function to have a reasonable chance of success at determining any of the following:
What is regarded as “reasonable” varies by context and threat model, but in general, “reasonable” could cover any attack that is more efficient than brute force (i.e., on average, attempting half of all possible combinations). Note that some attacks might be more efficient than brute force but are still not regarded as achievable in the real world. Any algorithm does not meet the above conditions will generally be considered weak for general use in hashing. In addition to algorithmic weaknesses, a hash function can be made weak by using the hash in a security context that breaks its security guarantees. For example, using a hash function without a salt for storing passwords (that are sufficiently short) could enable an adversary to create a “rainbow table” [REF-637] to recover the password under certain conditions; this attack works against such hash functions as MD5, SHA-1, and SHA-2.