806
[REF-62]Mark Dowd, John McDonald and Justin Schuh. "The Art of Software Security
Assessment". 1st Edition. 2006. Addison Wesley.
[REF-962]Object Management Group (OMG). "Automated Source Code Security Measure
(ASCSM)". 2016 January. < http://www.omg.org/spec/ASCSM/1.0/ >.
[REF-18]Secure Software, Inc.. "The CLASP Application Security Process". 2005. < https://
cwe.mitre.org/documents/sources/TheCLASPApplicationSecurityProcess.pdf >.
[REF-1192]Information Technology Laboratory, National Institute of Standards and Technology.
"FIPS PUB 140-3: SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES". 2019
March 2. < https://csrc.nist.gov/publications/detail/fips/140/3/final >.
[REF-1283]Forescout Vedere Labs. "OT:ICEFALL: The legacy of "insecure by design" and its
implications for certifications and risk management". 2022 June 0. < https://www.forescout.com/
resources/ot-icefall-report/ >.
CWE-328: Use of Weak Hash
Weakness ID : 328
Structure : Simple
Abstraction : Base
Description
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).
Extended Description
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:
1. The algorithm is not invertible (also called "one-way" or "not reversible")
2. The algorithm is deterministic; the same input produces the same digest every time
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:
1. the original input (preimage attack), given only the digest
2. another input that can produce the same digest (2nd preimage attack), given the original input
3. a set of two or more inputs that evaluate to the same digest (birthday attack), given the actor
can arbitrarily choose the inputs to be hashed and can do so a reasonable amount of times
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 that 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
CWE Version 4.14
CWE-328: Use of Weak Hash
CWE-328: Use of Weak Hash