CVE-2024-27354
highpriority · track · 0EPSS 0.006 · 49 %ileEUUSEPSS · scored 2026-10-28
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 6.9–7.5
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (10)
Products and version ranges known to be affected.
advisories (2)
Vendor and ecosystem advisories describing this.
- GHSA-2528-jw5q-ww88phpseclib: guardrails needed on isPrime and randomPrime2026-05-06ghsa · osvUS
### 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
- GHSA-hg35-mp25-qf6hDuplicate Advisory: phpseclib: guardrails needed on isPrime and randomPrime2024-03-02ghsa · osvUS
### Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-2528-jw5q-ww88. This link is maintained to preserve external references. ### Original 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.
also known as (4)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (19)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2024-27354/cnnvd
- https://gist.github.com/katzj/ee72f3c2a00590812b2ea3c0c8890e0bcnnvd
- https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Math/PrimeField.php#L49cnnvd
- https://github.com/phpseclib/phpseclib/releasesPatchcnnvd
- https://vigilance.fr/vulnerability/phpseclib-overload-43708cnnvd
- https://gist.github.com/katzj/ee72f3c2a00590812b2ea3c0c8890e0benisa_euvd
- https://github.com/FriendsOfPHP/security-advisories/blob/master/phpseclib/phpseclib/CVE-2024-27354.yamlenisa_euvd
- https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Math/PrimeField.php#L49enisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan