CVE-2024-27354 phpseclib: guardrails needed on isPrime and randomPrime

High 7.5 Published Updated

An attacker can cause a denial of service via CPU exhaustion by submitting a malformed certificate with a large prime to the phpseclib library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-27354?

CVE-2024-27354 is a high-severity denial of service vulnerability in Debian Debian Linux, published on 1 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An issue was discovered in phpseclib 1.x before 1.0.23, 2.x before 2.0.47, and 3.x before 3.0.36. An attacker can construct a malformed certificate containing an extremely large prime to cause a denial of service (CPU consumption for an isPrime primality check). NOTE: this issue was introduced when attempting to fix CVE-2023-27560.

Weakness: CWE-400

Which versions are affected by CVE-2024-27354?

6 open source packages ship an affected version, including phpseclib/phpseclib. It affects 2 products.

PackageAffectedFixed in
phpseclib/phpseclib PackagistFrom 0.1.11.0.23
phpseclib/phpseclib PackagistFrom 0.1.11.0.23
phpseclib/phpseclib PackagistFrom 2.0.02.0.47
phpseclib/phpseclib PackagistFrom 2.0.02.0.47
phpseclib/phpseclib PackagistFrom 3.0.03.0.36
phpseclib/phpseclib PackagistFrom 3.0.03.0.36

Products include Debian Debian Linux, Phpseclib Phpseclib.

How do I fix CVE-2024-27354?

Upgrade phpseclib/phpseclib to a fixed version for your release line: 1.0.23, 2.0.47 or 3.0.36.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-27354 being exploited?

There is no known exploitation of CVE-2024-27354 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as CLSA-2026-1783386122, DEBIAN-CVE-2024-27354, GHSA-2528-jw5q-ww88, UBUNTU-CVE-2024-27354.

Is CVE-2024-27354 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free