Skip to content

GHSA-p52g-cm5j-mjv4 CVE-2022-4304 RUSTSEC-2023-0007

openssl-src subject to Timing Oracle in RSA Decryption

Medium crates.io
Severity
5.9 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
23.51%
Chance of exploitation in the next 30 days. Higher than 97.80% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-203 Observable Discrepancy
Fix
111.25.0
Upgrade openssl-src to this version or later

Description

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.

Affected versions

crates.io

PackageVulnerableFixed in
openssl-src
< 111.25.0
111.25.0
openssl-src
>= 300.0.0, < 300.0.12
300.0.12
openssl-src
>= 0.0.0-0, < 111.25.0
>= 300.0.0, < 300.0.12
111.25.0
300.0.12

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

openssl-src crates.io → 111.25.0

cargo
cargo update -p openssl-src --precise 111.25.0

Severity breakdown

CVSS 3.1 5.9

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

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Weakness

CWE-203: Observable Discrepancy

The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.

How to prevent it
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
  • Implementation: Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success. If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files. Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-w67w-mw4j-8qrv
openssl-src contains Read Buffer Overflow in X.509 Name Constraint
Medium Also affects openssl-src
GHSA-vrh7-x64v-7vxq
openssl-src contains `NULL` dereference during PKCS7 data verification
High Also affects openssl-src
GHSA-vxrh-cpg7-8vjr
openssl-src subject to NULL dereference validating DSA public key
High Also affects openssl-src
GHSA-r7jw-wp68-3xch
openssl-src vulnerable to Use-after-free following `BIO_new_NDEF`
High Also affects openssl-src
GHSA-v5w6-wcm8-jm4q
openssl-src contains Double free after calling `PEM_read_bio_ex`
High Also affects openssl-src
GHSA-29xx-hcv2-c4cp
openssl-src subject to Invalid pointer dereference in `d2i_PKCS7` functions
High Also affects openssl-src
GHSA-x4qr-2fvf-3mr5
Vulnerable OpenSSL included in cryptography wheels
High Also affects openssl-src
GHSA-vr8j-hgmm-jh9r
Denial of service by double-checked locking in openssl-src
High Also affects openssl-src
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor