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.)
Use of a One-Way Hash with a Predictable Salt
This vulnerability occurs when an application uses a one-way hash (like for password storage) but combines it with a predictable or easily guessed salt. This undermines the security benefit of…
What is CWE-760?
Real-world CVEs caused by CWE-760
-
Blogging software uses a hard-coded salt when calculating a password hash.
-
Database server uses the username for a salt when encrypting passwords, simplifying brute force attacks.
-
Server uses a constant salt when encrypting passwords, simplifying brute force attacks.
-
chain: product generates predictable MD5 hashes using a constant value combined with username, allowing authentication bypass.
Step-by-step attacker path
- 1
Identify a code path that handles untrusted input without validation.
- 2
Craft a payload that exercises the unsafe behavior — injection, traversal, overflow, or logic abuse.
- 3
Deliver the payload through a normal request and observe the application's reaction.
- 4
Iterate until the response leaks data, executes attacker code, or escalates privileges.
Vulnerable pseudo
MITRE has not published a code example for this CWE. The pattern below is illustrative — see Resources for canonical references.
// Example pattern — see MITRE for the canonical references.
function handleRequest(input) {
// Untrusted input flows directly into the sensitive sink.
return executeUnsafe(input);
} Secure pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
const safe = validateAndEscape(input);
return executeWithGuards(safe);
} How to prevent CWE-760
- 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.
- 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.
How to detect CWE-760
Plexicus auto-detects CWE-760 and opens a fix PR in under 60 seconds.
Codex Remedium scans every commit, identifies this exact weakness, and ships a reviewer-ready pull request with the patch. No tickets. No hand-offs.
Frequently asked questions
What is CWE-760?
This vulnerability occurs when an application uses a one-way hash (like for password storage) but combines it with a predictable or easily guessed salt. This undermines the security benefit of salting, making pre-computed attack methods like rainbow tables highly effective.
How serious is CWE-760?
MITRE has not published a likelihood-of-exploit rating for this weakness. Treat it as medium-impact until your threat model proves otherwise.
What languages or platforms are affected by CWE-760?
MITRE has not specified affected platforms for this CWE — it can apply across most application stacks.
How can I prevent CWE-760?
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,…
How does Plexicus detect and fix CWE-760?
Plexicus's SAST engine matches the data-flow signature for CWE-760 on every commit. When a match is found, our Codex Remedium agent opens a fix PR with the corrected code, tests, and a one-line summary for the reviewer.
Where can I learn more about CWE-760?
MITRE publishes the canonical definition at https://cwe.mitre.org/data/definitions/760.html. You can also reference OWASP and NIST documentation for adjacent guidance.
Weaknesses related to CWE-760
Use of Password Hash With Insufficient Computational Effort
This vulnerability occurs when a system protects passwords by hashing them, but uses a hashing algorithm that is too fast or…
Use of a One-Way Hash without a Salt
This vulnerability occurs when a system uses a one-way hash function (like MD5 or SHA-256) to protect sensitive data like passwords, but…
Further reading
- MITRE — official CWE-760 https://cwe.mitre.org/data/definitions/760.html
- bcrypt https://bcrypt.sourceforge.net/
- Tarsnap - The scrypt key derivation function and encryption utility http://www.tarsnap.com/scrypt.html
- RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0 https://www.rfc-editor.org/rfc/rfc2898
- How To Safely Store A Password https://codahale.com/how-to-safely-store-a-password/
- How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek) https://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
- Password security: past, present, future https://www.openwall.com/presentations/PHDays2012-Password-Security/
Don't Let Security
Weigh You Down.
Stop choosing between AI velocity and security debt. Plexicus is the only platform that runs Vibe Coding Security and ASPM in parallel — one workflow, every codebase.