Miggo Logo

CVE-2024-2236:
A timing-based side-channel flaw was found in libgcrypt's RSA implementation. This issue may...

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.38073%
Published
3/7/2024
Updated
4/2/2025
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The analysis focused on the provided diff, which implements mitigations for a timing-based side-channel vulnerability (Marvin Attack) in libgcrypt's RSA implementation. The vulnerability allows for a Bleichenbacher-style attack. Key observations from the patch:

  1. Introduction of WITH_MARVIN_WORKAROUND preprocessor directive to gate the new mitigations.
  2. Addition of a new PKCS#1 v1.5 decoding function _gcry_rsa_pkcs1_decode_for_enc_implicit_rejection in cipher/rsa-common.c. This function implements 'implicit rejection' by returning a synthetic message of a pseudorandomly chosen length in case of padding errors, aiming to make valid and invalid decryptions indistinguishable by timing.
  3. Modifications to the existing _gcry_rsa_pkcs1_decode_for_enc and _gcry_rsa_oaep_decode functions in cipher/rsa-common.c to use new helper functions (e.g., mpi_to_string) and constant-time primitives (ct_* functions) for data processing.
  4. Significant changes in the high-level rsa_decrypt function in cipher/rsa.c to incorporate the implicit rejection mechanism, including deriving a Key Derivation Key (KDK) and calling the new decoding function.
  5. Replacement of standard MPI operations with new _sec (secure/constant-time) versions in critical paths. For example, secret_blinded in cipher/rsa.c now uses mpi_mulm_sec instead of mpi_mulm. These _sec functions are implemented in new files like mpi/mpi-mul-cs.c (mul_cs, mod_cs) and mpi/mpi-mul.c (_gcry_mpi_mul_sec, _gcry_mpi_mod_sec).

The identified vulnerable functions are those that, before the patch, processed RSA ciphertexts or performed cryptographic arithmetic in a way that leaked timing information. The patch modifies these functions to either use constant-time operations or to implement the implicit rejection strategy. rsa_decrypt is the top-level function processing the ciphertext. _gcry_rsa_pkcs1_decode_for_enc is the core PKCS#1 v1.5 padding check vulnerable to Bleichenbacher. _gcry_rsa_oaep_decode was also modified, indicating concerns for OAEP. secret_blinded and the underlying mpi_mulm it used were changed to constant-time versions, indicating they were also points of timing leakage.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

* timin*-**s** si**-***nn*l *l*w w*s *oun* in li***rypt's RS* impl*m*nt*tion. T*is issu* m*y *llow * r*mot* *tt**k*r to initi*t* * *l*i***n*****r-styl* *tt**k, w*i** **n l*** to t** ***ryption o* RS* *ip**rt*xts.

Reasoning

T** *n*lysis *o*us** on t** provi*** *i**, w*i** impl*m*nts miti**tions *or * timin*-**s** si**-***nn*l vuln*r**ility (M*rvin *tt**k) in li***rypt's RS* impl*m*nt*tion. T** vuln*r**ility *llows *or * *l*i***n*****r-styl* *tt**k. K*y o*s*rv*tions *ro