CWE-322

Key Exchange without Entity Authentication. [Authentication-Errors, Communication-Channel-Errors, Data-Integrity-Issues, Key-Management-Errors, Improper-Access-Control]

Required inputs: IR

The product performs a key exchange with an actor without verifying the identity of that actor. Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable an attacker to impersonate an actor by modifying traffic between the two entities. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.
Demonstrative Examples
Example 1

Many systems have used Diffie-Hellman key exchange without authenticating the entities exchanging keys, allowing attackers to influence communications by redirecting or interfering with the communication path. Many people using SSL/TLS skip the authentication (often unknowingly).

Excerpts from CWE [https://cwe.mitre.org], Copyright (C) 2006-2026, the MITRE Corporation. See 9.4 3rd-Party Licenses in the documentation for full details.

Possible Messages

Key

Text

Severity

Disabled

missing_verification

TLS/SSL handshake performed without prior peer verification.

None

False

Options

handshake_functions

handshake_functions

Type: list[str]

Default: ['SSL_do_handshake', 'BIO_do_handshake', 'wolfSSL_connect', 'wolfSSL_accept', 'mbedtls_ssl_handshake', 'gnutls_handshake']

Functions that perform (or complete) a TLS/SSL handshake.
 

verification_functions

verification_functions

Type: list[str]

Default: ['SSL_CTX_set_verify', 'SSL_set_verify', 'wolfSSL_CTX_set_verify', 'wolfSSL_set_verify', 'mbedtls_ssl_conf_authmode', 'gnutls_certificate_set_verify_function']

Functions that configure certificate/peer verification for a TLS session or context.