Simple authentication protocols are subject to reflection attacks if a malicious user can use the target machine to impersonate a trusted user.

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.

Resultant

Architecture and Design
COMMISSION: This weakness refers to an incorrect design related to an architectural security tactic.

Medium

Access Control
Gain Privileges or Assume Identity
The primary result of reflection attacks is successful authentication with a target machine -- as an impersonated user.

Architecture and Design
Use different keys for the initiator and responder or of a different type of challenge for the initiator and responder.

Architecture and Design
Let the initiator prove its identity before proceeding.

The following example demonstrates the weakness.

unsigned char *simple_digest(char *alg,char *buf,unsigned int len, int *olen) {const EVP_MD *m;EVP_MD_CTX ctx;unsigned char *ret;OpenSSL_add_all_digests();if (!(m = EVP_get_digestbyname(alg))) return NULL;if (!(ret = (unsigned char*)malloc(EVP_MAX_MD_SIZE))) return NULL;EVP_DigestInit(&ctx, m);EVP_DigestUpdate(&ctx,buf,len);EVP_DigestFinal(&ctx,ret,olen);return ret;}unsigned char *generate_password_and_cmd(char *password_and_cmd) {simple_digest("sha1",password,strlen(password_and_cmd)...);}

String command = new String("some cmd to execute & the password") MessageDigest encer = MessageDigest.getInstance("SHA");encer.update(command.getBytes("UTF-8"));byte[] digest = encer.digest();

CVE-2005-3435
product authentication succeeds if user-provided MD5 hash matches the hash in its database; this can be subjected to replay attacks.
https://www.cve.org/CVERecord?id=CVE-2005-3435

Reflection attack in an auth protocol

A7
Broken Authentication and Session Management
CWE More Specific

Allowed
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

The term "reflection" is used in multiple ways within CWE and the community, so its usage should be reviewed.

CLASP
2006-07-19
Draft 3
2006-07-19

Eric Dalci
Cigital
2008-07-01
updated Time_of_Introduction

CWE Content Team
MITRE
2008-09-08
updated Common_Consequences, Description, Maintenance_Notes, Relationships, Other_Notes, Taxonomy_Mappings

CWE Content Team
MITRE
2011-06-01
updated Common_Consequences

CWE Content Team
MITRE
2012-05-11
updated Observed_Examples, References, Relationships

CWE Content Team
MITRE
2014-07-30
updated Relationships

CWE Content Team
MITRE
2017-11-08
updated Applicable_Platforms, Demonstrative_Examples, Modes_of_Introduction, Relationships

CWE Content Team
MITRE
2020-02-24
updated References, Relationships

CWE Content Team
MITRE
2021-03-15
updated Description, Other_Notes

CWE Content Team
MITRE
2022-10-13
updated Relationships

CWE Content Team
MITRE
2023-01-31
updated Type

CWE Content Team
MITRE
2023-04-27
updated Relationships

CWE Content Team
MITRE
2023-06-29
updated Mapping_Notes

CWE Content Team
MITRE
2025-12-11
4.19
2025-12-11
updated Weakness_Ordinalities