What it is: Selection of Less-Secure Algorithm During Negotiation ('Algorithm Downgrade') (CWE-757) is a vulnerability that occurs when a protocol or its implementation allows actors to negotiate the use of algorithms but fails to select the strongest available option.
Why it matters: This can weaken security by allowing attackers to exploit vulnerabilities in weaker algorithms, compromising data integrity and confidentiality.
How to fix it: Ensure that your system always selects the strongest available encryption or authentication mechanism by implementing strict policies and configurations.
TL;DR: Selection of Less-Secure Algorithm During Negotiation (CWE-757) is a critical vulnerability where systems fail to select the strongest available algorithm, leading to potential data breaches. Ensure strong algorithms are always used.
| Field | Value |
|---|---|
| CWE ID | CWE-757 |
| OWASP Category | A04:2025 - Cryptographic Failures |
| CAPEC | CAPEC-220, CAPEC-606, CAPEC-620 |
| Typical Severity | High |
| Affected Technologies | encryption protocols, authentication mechanisms |
| Detection Difficulty | Moderate |
| Last Updated | 2026-07-29 |
What is Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)?
Selection of Less-Secure Algorithm During Negotiation (CWE-757) is a type of cryptographic failure vulnerability that occurs when a protocol or its implementation allows actors to negotiate the use of algorithms but fails to select the strongest available option. As defined by the MITRE Corporation under CWE-757, and classified by the OWASP Foundation under A04:2025 - Cryptographic Failures.
Quick Summary
Selection of Less-Secure Algorithm During Negotiation (CWE-757) is a critical vulnerability that can weaken security by allowing attackers to exploit vulnerabilities in weaker algorithms. This can compromise data integrity and confidentiality, leading to potential data breaches. Jump to: What is Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)? · Quick Summary · Overview · How It Works · Business Impact · Attack Scenario · Detection · Fix · Framework Fixes · Ask AI · Best Practices Checklist · FAQ · Vulnerabilities Related
Jump to: Quick Summary · Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Overview · How Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Works · Business Impact of Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) · Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Attack Scenario · How to Detect Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) · How to Fix Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) · Framework-Specific Fixes for Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) · How to Ask AI to Check Your Code for Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) · Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Best Practices Checklist · Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) FAQ · Vulnerabilities Related to Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) · References · Scan Your Own Site
Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Overview
What: A vulnerability where a protocol or its implementation allows actors to negotiate the use of algorithms but fails to select the strongest available option.
Why it matters: This can weaken security by allowing attackers to exploit vulnerabilities in weaker algorithms, compromising data integrity and confidentiality.
Where it occurs: In systems that support interaction between multiple actors and allow them to negotiate algorithm selection for encryption or authentication mechanisms.
Who is affected: Applications and services that rely on secure communication protocols like SSL/TLS, SSH, S/MIME, etc., where weak algorithms can be negotiated.
Who is NOT affected: Systems already using strong cryptographic policies with no negotiation options available.
How Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Works
Root Cause
The root cause lies in the protocol or implementation’s failure to enforce a strict policy for selecting the strongest algorithm during the negotiation phase. This can lead to weaker algorithms being chosen, compromising security.
Attack Flow
- An attacker initiates communication with the vulnerable system.
- The system negotiates an encryption or authentication mechanism with the attacker.
- Due to misconfiguration or lack of strong policies, a less secure algorithm is selected.
- The attacker exploits vulnerabilities in this weaker algorithm to compromise data integrity and confidentiality.
Prerequisites to Exploit
- Misconfigured protocol settings allowing weak algorithms.
- Lack of strict security policies enforcing the selection of strongest available options.
Vulnerable Code
def negotiate_algorithm(client_proposal):
# Vulnerable: Fails to enforce strong policy for algorithm selection
selected_algo = client_proposal['weak']
return selected_algo
This code fails to enforce a strict policy for selecting the strongest available algorithm, allowing weak algorithms to be chosen.
Secure Code
def negotiate_algorithm(client_proposal):
# Secure: Enforces strong policy for algorithm selection
if 'strong' in client_proposal:
selected_algo = client_proposal['strong']
else:
raise ValueError("Strong algorithm not available")
return selected_algo
This code enforces a strict policy ensuring that only the strongest available algorithm is selected.
Business Impact of Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)
Confidentiality
- Data encrypted with weaker algorithms can be more easily decrypted by attackers.
- Sensitive information transmitted over insecure channels may be intercepted and read.
Integrity
- Attackers can modify data in transit using vulnerabilities in weaker encryption mechanisms.
- Tampered data might go undetected due to the lack of strong integrity checks.
Availability
- Weak algorithms can lead to denial-of-service attacks by exhausting system resources through brute-force decryption attempts.
Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Attack Scenario
- An attacker initiates communication with a vulnerable server.
- The server negotiates an encryption mechanism based on the client’s proposal.
- Due to misconfiguration, a weak algorithm is selected for encryption.
- The attacker exploits vulnerabilities in this weaker algorithm to decrypt and read sensitive data.
How to Detect Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)
Manual Testing
- [ ] Review configuration files and settings ensuring strong algorithms are prioritized.
- [ ] Verify that the system enforces strict policies for selecting strongest available options during negotiation phases.
- [ ] Test communication with a client proposing weak algorithms to see if they are accepted.
Automated Scanners (SAST / DAST)
Static analysis can detect misconfigured settings allowing weak algorithm selection. Dynamic testing is needed to confirm that strong algorithms are always selected in real-world scenarios.
PenScan Detection
PenScan’s automated scanners such as ZAP, Nuclei, Wapiti, Nikto, SSLyze, and Dalfox can identify instances where weaker algorithms are negotiated.
False Positive Guidance
A false positive occurs when a scanner flags weak algorithm proposals that are actually rejected by the system due to strict configuration policies.
How to Fix Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)
- Enforce strict security policies for selecting strongest available options during negotiation phases.
- Regularly update configurations to use strong cryptographic algorithms and protocols.
- Implement monitoring and alerting mechanisms to detect and respond to weak algorithm selection attempts.
Framework-Specific Fixes for Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)
Java
public String negotiateAlgorithm(Map<String, String> clientProposal) {
if (clientProposal.containsKey("strong")) {
return clientProposal.get("strong");
} else {
throw new IllegalArgumentException("Strong algorithm not available");
}
}
Node.js
function negotiateAlgorithm(clientProposal) {
if ('strong' in clientProposal) {
return clientProposal.strong;
} else {
throw new Error('Strong algorithm not available');
}
}
Python/Django
def negotiate_algorithm(client_proposal):
if 'strong' in client_proposal:
selected_algo = client_proposal['strong']
else:
raise ValueError("Strong algorithm not available")
return selected_algo
PHP
function negotiateAlgorithm($clientProposal) {
if (isset($clientProposal['strong'])) {
$selected_algo = $clientProposal['strong'];
} else {
throw new Exception('Strong algorithm not available');
}
return $selected_algo;
}
How to Ask AI to Check Your Code for Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)
Review the following Python code block for potential CWE-757 Selection of Less-Secure Algorithm During Negotiation vulnerabilities and rewrite it using strict policy enforcement:
def negotiate_algorithm(client_proposal):
if 'strong' in client_proposal:
selected_algo = client_proposal['strong']
else:
raise ValueError("Strong algorithm not available")
return selected_algo
Review the following Python code block for potential CWE-757 Selection of Less-Secure Algorithm During Negotiation vulnerabilities and rewrite it using strict policy enforcement: [paste code here]
Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) Best Practices Checklist
✅ Enforce strict security policies ensuring the strongest available algorithm is always selected. ✅ Regularly update configurations to use strong cryptographic algorithms and protocols. ✅ Implement monitoring and alerting mechanisms for weak algorithm selection attempts. ✅ Test communication with a client proposing weak algorithms to ensure they are rejected. ✅ Review configuration files and settings regularly for misconfigurations allowing weak algorithms.
Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’) FAQ
How does selection of less-secure algorithm during negotiation (CWE-757) occur?
Selection of Less-Secure Algorithm During Negotiation occurs when a protocol or its implementation allows actors to negotiate the use of algorithms but fails to select the strongest available option.
Why is selection of less-secure algorithm during negotiation dangerous?
It weakens security by allowing attackers to exploit vulnerabilities in weaker algorithms, compromising data integrity and confidentiality.
What are some real-world examples of selection of less-secure algorithm during negotiation?
Real-world examples include SSL/TLS handshake processes where older or less secure ciphers are chosen over stronger alternatives due to misconfiguration.
How can I detect selection of less-secure algorithm during negotiation in my code?
Use automated scanners and manual testing techniques such as reviewing configuration files for weak settings and ensuring strong algorithms are prioritized.
What steps should I take to fix selection of less-secure algorithm during negotiation?
Ensure that your system always selects the strongest available encryption or authentication mechanism by implementing strict policies and configurations.
How does OWASP categorize selection of less-secure algorithm during negotiation?
Selection of Less-Secure Algorithm During Negotiation is categorized under A04:2025 Cryptographic Failures in the OWASP Top Ten.
What are some common mistakes developers make when addressing selection of less-secure algorithm during negotiation?
Common mistakes include not updating configurations to use strong algorithms and failing to validate that the strongest available option is selected.
Vulnerabilities Related to Selection of Less-Secure Algorithm During Negotiation (‘Algorithm Downgrade’)
| CWE | Name | Relationship | |—|—|—| | CWE-693 | Protection Mechanism Failure (ChildOf) |
References
Scan Your Own Site
Manual code review catches what you know to look for. An automated scan catches what you didn’t. Scan your own website using PenScan to find Selection of Less-Secure Algorithm During Negotiation and other risks before an attacker does.