CWE-760: Use of a One-Way Hash with a Predictable Salt
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
The product uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the product uses a predictable salt as part of the input.
常见后果
影响范围: Access Control
技术影响: Bypass Protection Mechanism
潜在缓解措施
阶段: Architecture and Design
有效性: High
阶段: Implementation
描述: If a technique that requires extra computational effort can not be implemented, then for each password that is processed, generate a new random salt using a strong random number generator with unpredictable seeds. Add the salt to the plaintext password before hashing it. When storing the hash, also store the salt. Do not use the same salt for every password.
有效性: Limited
检测方法
方法: 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.)
有效性: High
观察示例
参考: CVE-2008-4905
Blogging software uses a hard-coded salt when calculating a password hash.
参考: CVE-2002-1657
Database server uses the username for a salt when encrypting passwords, simplifying brute force attacks.
参考: CVE-2001-0967
Server uses a constant salt when encrypting passwords, simplifying brute force attacks.
参考: CVE-2005-0408
chain: product generates predictable MD5 hashes using a constant value combined with username, allowing authentication bypass.
引入模式
| 阶段 | 说明 |
|---|---|
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |