Advisory

RUSTSEC-2022-0014

Also known as: BIT-mariadb-2022-0778, BIT-mariadb-min-2022-0778, BIT-mysql-client-2022-0778, BIT-node-2022-0778, BIT-node-min-2022-0778, CVE-2022-0778, GHSA-x3mh-jvjw-3xwx

Summary

Infinite loop in BN_mod_sqrt() reachable when parsing certificates

Details

The BN_mod_sqrt() function, which computes a modular square root, contains
a bug that can cause it to loop forever for non-prime moduli.

Internally this function is used when parsing certificates that contain
elliptic curve public keys in compressed form or explicit elliptic curve
parameters with a base point encoded in compressed form.

It is possible to trigger the infinite loop by crafting a certificate that
has invalid explicit curve parameters.

Since certificate parsing happens prior to verification of the certificate
signature, any process that parses an externally supplied certificate may thus
be subject to a denial of service attack. The infinite loop can also be
reached when parsing crafted private keys as they can contain explicit
elliptic curve parameters.

Thus vulnerable situations include:

  • TLS clients consuming server certificates
  • TLS servers consuming client certificates
  • Hosting providers taking certificates or private keys from customers
  • Certificate authorities parsing certification requests from subscribers
  • Anything else which parses ASN.1 elliptic curve parameters

Also any other applications that use the BN_mod_sqrt() where the attacker
can control the parameter values are vulnerable to this DoS issue.

Severity

Not rated by the source.

Dates

Published
2022-03-15 12:00 UTC
Modified
2025-06-10 12:59 UTC

Affected packages and fixes

openssl-src

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 111.18.0, introduced 300.0.0, fixed 300.0.5 (semver)

Fixed versions

111.18.0, 300.0.5

Fix

  • Fixed version 111.18.0
    cargo update -p openssl-src --precise 111.18.0
  • Fixed version 300.0.5
    cargo update -p openssl-src --precise 300.0.5

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences