CWEweakness

CWE-328 Use of Weak Hash

Official page ↗
Abstraction
Base
Structure
Simple
Status
Draft
Languages
Go, Not Language-Specific
CWE version
5.0

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: • The algorithm is not invertible (also called "one-way" or "not reversible") • 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: • the original input (preimage attack), given only the digest • another input that can produce the same digest (2nd preimage attack), given the original input • 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 "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.

Common consequences

• Access Control: Bypass Protection Mechanism

Potential mitigations

• [Architecture and Design] Use an adaptive hash function that can be configured to change the amount of computational effort needed to compute the hash, such as the number of iterations ("stretching") or the amount of memory required. Some hash functions perform salting automatically. These functions can significantly increase the overhead for a brute force attack compared to intentionally-fast functions such as MD5. For example, rainbow table attacks can become infeasible due to the high computing overhead. Finally, since computing power gets faster and cheaper over time, the technique can be reconfigured to increase the workload without forcing an entire replacement of the algorithm in use. Some hash functions that have one or more of these desired properties include bcrypt [REF-291], scrypt [REF-292], and PBKDF2 [REF-293]. While there is active debate about which of these is the most effective, they are all stronger than using salts with hash functions with very little computing overhead. Note that using these functions can have an impact on performance, so they require special consideration to avoid denial-of-service attacks. However, their configurability provides finer control over how much CPU and memory is used, so it could be adjusted to suit the environment's needs.

Detection methods

• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Observed examples

• CVE-2022-30320: Programmable Logic Controller (PLC) uses a protocol with a cryptographically insecure hashing algorithm for passwords. • CVE-2005-4900: SHA-1 algorithm is not collision-resistant. • CVE-2020-25685: DNS product uses a weak hash (CRC32 or SHA-1) of the query name, allowing attacker to forge responses by computing domain names with the same hash. • CVE-2012-6707: blogging product uses MD5-based algorithm for passwords. • CVE-2019-14855: forging of certificate signatures using SHA-1 collisions. • CVE-2017-15999: mobile app for backup sends SHA-1 hash of password in cleartext. • CVE-2006-4068: Hard-coded hashed values for username and password contained in client-side script, allowing brute-force offline attacks.

Related

Attack pattern · CAPEC (2)

  • CAPEC-461 Web Services API Signature Forgery Leveraging Hash Function Extension Weakness attack pattern
  • CAPEC-68 Subvert Code-signing Facilities attack pattern

Observed example · CVE (7)

  • CVE-2022-30320 Saia Burgess Controls (SBC) PCD through 2022-05-06 uses a Broken or Risky Cryptographic Algorithm. vulnerability
  • CVE-2020-25685 A flaw was found in dnsmasq before version 2.83. vulnerability
  • CVE-2019-14855 A flaw was found in the way certificate signatures could be forged using collisions found in the SHA-1 algorithm. vulnerability
  • CVE-2017-15999 In the "NQ Contacts Backup & Restore" application 1.1 for Android, no HTTPS is used for transmitting login and synced user data. vulnerability
  • CVE-2012-6707 WordPress through 4.8.2 uses a weak MD5-based password hashing algorithm, which makes it easier for attackers to determine cleartext values… vulnerability
  • CVE-2005-4900 SHA-1 is not collision resistant, which makes it easier for context-dependent attackers to conduct spoofing attacks, as demonstrated by… vulnerability
  • CVE-2006-4068 The pswd.js script relies on the client to calculate whether a username and password match hard-coded hashed values for a server, and uses… vulnerability

Child of · CWE (2)

  • CWE-326 Inadequate Encryption Strength weakness
  • CWE-327 Use of a Broken or Risky Cryptographic Algorithm weakness

Referenced by CAPEC · weakness (2)

  • CAPEC-461 Web Services API Signature Forgery Leveraging Hash Function Extension Weakness attack pattern
  • CAPEC-68 Subvert Code-signing Facilities attack pattern

Referenced by CVE · weakness (95)

  • CVE-2026-65104 NVIDIA Megatron-LM for all platforms contains a vulnerability in inference, where an attacker could cause hash collisions in the cache used… vulnerability
  • CVE-2026-97468 Apache CXF's STSTokenValidator and Security Token Service (STS) cached validated security tokens under a non-cryptographic 32-bit hash of… vulnerability
  • CVE-2026-97469 PostgreSQL Anonymizer contains a vulnerability that allows unprivileged masked users to repeatedly call the anon.hash() function and… vulnerability
  • CVE-2026-51996 An issue in geelen mcp-remote 0.1.16 through 0.1.38 allows a remote attacker to execute arbitrary code via the src/lib/utils.ts and the… vulnerability
  • CVE-2026-46488 motionEye (mEye) is an online interface for a piece of software called "motion," which is a video surveillance program with motion… vulnerability
  • CVE-2026-15605 A security vulnerability has been detected in wandb 0.25.2.dev1. vulnerability
  • CVE-2026-41879 R-SOFT DMS stores superadmin credentials using a non-salted nested MD5 hash. vulnerability
  • CVE-2026-14738 A security flaw has been discovered in exo-explore exo up to 1.0.71. vulnerability
  • CVE-2026-14742 A vulnerability was determined in langchain-ai langgraph up to 1.2.4. vulnerability
  • CVE-2026-14630 A vulnerability has been found in ForceInjection AI-fundermentals 2.0/3.0. vulnerability
  • CVE-2026-10540 The Control-M/Enterprise Manager uses weak protections for stored hashes of account passwords, potentially allowing offline password… vulnerability
  • CVE-2026-13455 PostgreSQL Anonymizer contains a vulnerability that allows unprivileged masked users to repeatedly call the anon.hash() function and… vulnerability
  • CVE-2026-53692 Redeight CMS version 1.0 uses the MD5 algorithm without a salt to store user passwords. vulnerability
  • CVE-2026-13482 A vulnerability was detected in skypilot-org skypilot up to 0.12.0. vulnerability
  • CVE-2026-13510 A vulnerability was found in SimStudioAI sim up to 0.6.92. vulnerability
  • CVE-2026-54266 Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. vulnerability
  • CVE-2026-11479 A vulnerability has been found in yoanbernabeu grepai 0.35.0. vulnerability
  • CVE-2026-11481 A vulnerability was determined in yoanbernabeu grepai up to 0.35.0. vulnerability
  • CVE-2026-48488 phpMyFAQ is an open source FAQ web application. vulnerability
  • CVE-2026-11329 A vulnerability has been found in onnx onnx-mlir up to 0.5.0.0. vulnerability
  • CVE-2026-11330 A weakness has been identified in thedotmack claude-mem up to 11.0.1. vulnerability
  • CVE-2026-10783 A security flaw has been discovered in gradio-app gradio 6.14.0. vulnerability
  • CVE-2026-10800 A weakness has been identified in PaddlePaddle FastDeploy up to 2.4.1. vulnerability
  • CVE-2026-10801 A security vulnerability has been detected in modelscope ms-swift up to 4.2.0. vulnerability
  • CVE-2026-10803 A flaw has been found in MLflow up to 3.10.0. vulnerability
  • CVE-2026-10804 A vulnerability has been found in Streamlit up to 1.53.0. vulnerability
  • CVE-2026-10812 A vulnerability was detected in zilliztech GPTCache up to 0.1.44. vulnerability
  • CVE-2026-10813 A flaw has been found in LMCache up to 0.5.4. vulnerability
  • CVE-2026-10814 A vulnerability has been found in milvus-io milvus up to 2.6.13. vulnerability
  • CVE-2026-36182 GNCC GP5 v7.1.76 was discovered to utilize a weak hashing algorithm to protect the root password, possibly allowing attackers to obtain… vulnerability
Show all 95 ›

Referenced by CWE · child of (1)

  • CWE-916 Use of Password Hash With Insufficient Computational Effort weakness

Referenced by CWE · has member (1)

  • CWE-1468 Weaknesses Addressed by the OWASP Golang Secure Coding Practices Guide view

Referenced by OWASP · mapped cwe (2)

  • A04:2025 Cryptographic Failures Top 10 2025
  • A02:2021 Cryptographic Failures Top 10 2021