Skip to main content
VulnerabilityPublished

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

Affects phpseclib/phpseclibSource GCVE Database

0

Not known to be exploited · CVSS 7.5 High : upgrade to 1.0.23 soon.

Data as of 27 Oct 2026, 02:11 UTC

CVSS 3.1 base score
7.5High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 1.0.23, 2.0.47, 3.0.36
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 6 May 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Upgrade phpseclib/phpseclib to 1.0.23; phpseclib/phpseclib to 2.0.47; phpseclib/phpseclib to 3.0.36.

Affected software

ProductAffectedFixed in
Packagistphpseclib/phpseclibAffected
  • >=0.1.1 <1.0.23
Fixed in
  • 1.0.23
Packagistphpseclib/phpseclibAffected
  • >=2.0.0 <2.0.47
Fixed in
  • 2.0.47
Packagistphpseclib/phpseclibAffected
  • >=3.0.0 <3.0.36
Fixed in
  • 3.0.36

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Upgrade phpseclib to versions 1.0.23, 2.0.47, or 3.0.36 or later where the vulnerability is fixed. Alternatively, use the GMP extension for prime number operations if it includes proper guardrails. No other specific mitigations are indicated by the vendor advisory.

Description

CVE-2024-27354 is a high-severity vulnerability in phpseclib affecting the isPrime and randomPrime functions used for prime number generation and primality testing. The flaw impacts versions >=0.1.1 <1.0.23, >=2.0.0 <2.0.47, and >=3.0.0 <3.0.36. A patch is available in versions 1.0.23, 2.0.47, and 3.0.36. The vulnerability does not affect confidentiality or integrity but can cause denial of service (availability impact). Using the GMP extension may mitigate the issue if proper guardrails are in place.

References

Community reviews

Loading reviews…