CWE-301: Reflection Attack in an Authentication Protocol
Simple authentication protocols are subject to reflection attacks if a malicious user can use the target machine to impersonate a trusted user.
Last updated
Overview
A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol. Reflection attacks capitalize on mutual authentication schemes in order to trick the target into revealing the secret shared between it and another valid user. In a basic mutual-authentication scheme, a secret is known to both the valid user and the server; this allows them to authenticate. In order that they may verify this shared secret without sending it plainly over the wire, they utilize a Diffie-Hellman-style scheme in which they each pick a value, then request the hash of that value as keyed by the shared secret. In a reflection attack, the attacker claims to be a valid user and requests the hash of a random value from the server. When the server returns this value and requests its own value to be hashed, the attacker opens another connection to the server. This time, the hash requested by the attacker is the value which the server requested in the first connection. When the server returns this hashed value, it is used in the first connection, authenticating the attacker successfully as the impersonated valid user.
Real-world CVEs
1 recorded CVEs are caused by CWE-301 (Reflection Attack in an Authentication Protocol). The highest-severity and most recent are shown first.
Common consequences
What can happen when CWE-301 is exploited.
Gain Privileges or Assume Identity
Affects: Access Control
The primary result of reflection attacks is successful authentication with a target machine -- as an impersonated user.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to prevent it
Practical mitigations for CWE-301, grouped by where in the lifecycle they apply.
Use different keys for the initiator and responder or of a different type of challenge for the initiator and responder.
Let the initiator prove its identity before proceeding.
Code examples
Illustrative examples from MITRE showing how the weakness appears in code.
The following example demonstrates the weakness.
Vulnerable example
unsigned char *simple_digest(char *alg,char *buf,unsigned int len, int *olen) {Vulnerable example
String command = new String("some cmd to execute & the password") MessageDigest encer = MessageDigest.getInstance("SHA");Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2024-11022 — web server includes the nonce in its challenge/response mechanism, allowing a replay attack
- CVE-2005-3435 — product authentication succeeds if user-provided MD5 hash matches the hash in its database; this can be subjected to replay attacks.
Terminology & mappings
Mapped taxonomies
- CLASP: Reflection attack in an auth protocol
- OWASP Top Ten 2007: Broken Authentication and Session Management (A7) — CWE More Specific fit
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-301.
- What is CWE-301?
- Simple authentication protocols are subject to reflection attacks if a malicious user can use the target machine to impersonate a trusted user.
- What CVEs are caused by CWE-301?
- 1 recorded CVEs are attributed to CWE-301, including CVE-2019-9497.
- Is CWE-301 part of the OWASP Top 10?
- CWE-301 maps to OWASP Top Ten 2007: Broken Authentication and Session Management (A7) in the OWASP security taxonomy.
- How do you prevent CWE-301?
- Use different keys for the initiator and responder or of a different type of challenge for the initiator and responder.
- What are the consequences of CWE-301?
- Exploiting CWE-301 can lead to: Gain Privileges or Assume Identity.
- Is CWE-301 actively exploited?
- 1 recorded CVEs are caused by CWE-301; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-301) (opens in a new tab)
- CWE-301 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-301
Get alerted the moment a new CWE-301 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.