Skip to content
Crypto Disclosed report Advanced CVE-2022-4304

OpenSSL vulnerable to the Marvin Attack (CVE-2022-4304)

A timing side channel existed in OpenSSL's RSA decryption code, allowing a Bleichenbacher-style attack. An attacker who observed a genuine TLS connection could send many trial messages, measure processing time, and eventually recover the pre-master secret to decrypt application data.

hkario Follow

Originally disclosed on HackerOne

Bounty$2,540 Medium 5.9 View original
  • Triaged in 3 days
  • Fixed in 19 days
  • Paid in 19 days
  • Disclosed after 19 days

Summary by the program

Timing Oracle in RSA Decryption (CVE-2022-4304) Severity: Moderate

A timing based side channel exists in the OpenSSL RSA Decryption implementation which could be sufficient to recover a plaintext across a network in a Bleichenbacher style attack. To achieve a successful decryption an attacker would have to be able to send a very large number of trial messages for decryption. The vulnerability affects all RSA padding modes: PKCS# 1 v1.5, RSA-OEAP and RSASVE.

For example, in a TLS connection, RSA is commonly used by a client to send an encrypted pre-master secret to the server. An attacker that had observed a genuine connection between a client and a server could use this flaw to send trial messages to the server and record the time taken to process them. After a sufficiently large number of messages the attacker could recover the pre-master secret used for the original connection and thus be able to decrypt the application data sent over that connection.

OpenSSL 3.0, 1.1.1 and 1.0.2 are vulnerable to this issue.

OpenSSL 3.0 users should upgrade to OpenSSL 3.0.8. OpenSSL 1.1.1 users should upgrade to OpenSSL 1.1.1t. OpenSSL 1.0.2 users should upgrade to OpenSSL 1.0.2zg (premium support customers only).

An initial report of a possible timing side channel was made on 14th July 2020 by Hubert Kario (Red Hat). A refined report identifying a specific timing side channel was made on 15th July 2022 by Hubert Kario. The fix was developed by Dmitry Belyavsky (Red Hat) and Hubert Kario.

Full Security Advisory: https://www.openssl.org/news/secadv/20230207.txt

The report

A timing based side channel exists in the OpenSSL RSA Decryption implementation which could be sufficient to recover a plaintext across a network in a Bleichenbacher style attack. To achieve a successful decryption an attacker would have to be able to send a very large number of trial messages for decryption. The vulnerability affects all RSA padding modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.

The details of the vulnerability are on the https://people.redhat.com/~hkario/marvin/ page. Script to reproduce it: https://github.com/tlsfuzzer/tlsfuzzer/blob/master/scripts/test-bleichenbacher-timing-pregenerate.py Instructions to the reproducer: https://tlsfuzzer.readthedocs.io/en/latest/timing-analysis.html Credit is acknowledged on the security advisory page: https://www.openssl.org/news/secadv/20230207.txt

Impact

Decryption of captured RSA ciphertexts and signature forgery for endpoints allowing timing of RSA decryption operation (local or remote).

The original report as published on HackerOne, by hkario. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the RSA decryption implementation did not run in constant time across all padding modes, leaking timing differences that reveal information about the plaintext.

Impact

An attacker could recover the pre-master secret of an observed TLS connection and decrypt its application data, and could also forge signatures where RSA decryption timing is observable, though a very large number of trial messages is required.

What the attacker needed

Ability to observe a genuine TLS connection; ability to send many trial messages; ability to time RSA decryption

The fix

It was fixed by upgrading to OpenSSL 3.0.8, 1.1.1t or 1.0.2zg.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a server decrypts data, it takes slightly different amounts of time depending on whether the data looks valid. If an attacker can measure those tiny differences over many attempts, they can gradually learn secret information. Here, that secret was the key material protecting a TLS connection, so captured traffic could be decrypted.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by hkario

View all

1 more disclosed report, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.