CWE-294

Authentication Bypass by Capture-replay. [Authentication-Errors, Improper-Access-Control]

Required inputs: IR

A capture-replay flaw exists when the design of the product makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes). Capture-replay attacks are common and can be difficult to defeat without cryptography. They are a subset of network injection attacks that rely on observing previously-sent valid commands, then changing them slightly if necessary and resending the same commands to the server.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_freshness

Message authentication code computed without a freshness value (counter, timestamp or nonce).

None

False

Options

freshness_functions

freshness_functions

Type: set[bauhaus.analysis.config.QualifiedName]

Default: {'BCryptGenRandom', 'CryptGenRandom', 'Csm_RandomGenerate', 'GetSystemTimeAsFileTime', 'GetTickCount', 'GetTickCount64', 'QueryPerformanceCounter', 'RAND_bytes', 'RAND_pseudo_bytes', 'StbM_GetCurrentTime', 'arc4random', 'arc4random_buf', 'clock', 'clock_gettime', 'getrandom', 'gettimeofday', 'gnutls_rnd', 'mbedtls_ctr_drbg_random', 'psa_generate_random', 'rand', 'random', 'time', 'timespec_get', 'wc_RNG_GenerateBlock'}

Functions that supply a value which differs between messages.
 

freshness_name_pattern

freshness_name_pattern

Type: bauhaus.analysis.config.SearchPattern

Default: '(?i)nonce|freshness|challenge|counter|time_?stamp|(?:seq(?:uence)?|msg|message|frame|packet)_?(?:num(?:ber)?|count|id)'

Called functions and parameters whose name matches this pattern also count as a freshness value.
 

mac_generation_functions

mac_generation_functions

Type: set[bauhaus.analysis.config.QualifiedName]

Default: {'CMAC_Final', 'CSNBHMG', 'CSNBHMG1', 'CSNBMGN', 'CSNBMGN1', 'CSNBMGN2', 'CSNBMGN3', 'CSNEHMG', 'CSNEHMG1', 'CSNEMGN', 'CSNEMGN1', 'CSNEMGN2', 'CSNEMGN3', 'Csm_MacGenerate', 'Csm_MacGenerateFinish', 'EVP_MAC_final', 'EVP_Q_mac', 'HMAC', 'HMAC_Final', 'gnutls_hmac_fast', 'gnutls_hmac_output', 'mbedtls_cipher_cmac', 'mbedtls_cipher_cmac_finish', 'mbedtls_md_hmac', 'mbedtls_md_hmac_finish', 'psa_mac_compute', 'psa_mac_sign_finish', 'wc_CmacFinal', 'wc_HmacFinal'}

Functions that produce the message authentication code of a message.