HexBrain

Internet Bug Bounty · Report #2270225

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

Validstatus
mediumseverity
$2,540bounty
41upvotes
21 Dec 2023disclosed

Summary

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

How it was found

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).

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original