All reports
High

phpseclib: guardrails needed on isPrime and randomPrime

Affected versions

Version ranges need review.

Affected versions
>= 0.1.1, < 1.0.23
Fixed version
1.0.23
Affected versions
>= 2.0.0, < 2.0.47
Fixed version
2.0.47
Affected versions
>= 3.0.0, < 3.0.36
Fixed version
3.0.36
Affected versions
>=3.0.0,<3.0.36|>=2.0.0,<2.0.47|>=1.0.0,<1.0.23
Fixed version
Not reported

Exploitation

CVE-2024-27354

Probability of exploitation in the next 30 days: 0.60%

FIRST EPSS · 2026-11-19

Description

Impact

Anyone trying to generate a prime and testing the primality of a number.

Patches

https://github.com/phpseclib/phpseclib/commit/ad5dbdf2129f5e0fb644637770b7f33de8ca8575

Workarounds

Using the GMP extension would probably help, assuming that one has its own guardrails.

Resources

https://github.com/phpseclib/phpseclib/commit/ad5dbdf2129f5e0fb644637770b7f33de8ca8575 https://www.usenix.org/system/files/conference/usenixsecurity25/sec25cycle1-prepub-599-shi-bing.pdf

Links