CVE-2024-27354
published 2024-03-01CVE-2024-27354: 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…
PriorityP336high7.5CVSS 3.1
AVNACLPRNUINSUCNINAH
EPSS
0.60%
44.8th percentile
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.
Affected
18 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | debian_linux | — | — |
| debian | php-phpseclib | < php-phpseclib 2.0.42-1+deb12u2 (bookworm) | php-phpseclib 2.0.42-1+deb12u2 (bookworm) |
| debian | php-phpseclib3 | < php-phpseclib 2.0.42-1+deb12u2 (bookworm) | php-phpseclib 2.0.42-1+deb12u2 (bookworm) |
| debian | phpseclib | < php-phpseclib 2.0.42-1+deb12u2 (bookworm) | php-phpseclib 2.0.42-1+deb12u2 (bookworm) |
| phpseclib | phpseclib | >= 0 < 1.0.19-3+deb11u2 | 1.0.19-3+deb11u2 |
| phpseclib | phpseclib | >= 0 < 1.0.20-1+deb12u2 | 1.0.20-1+deb12u2 |
| phpseclib | phpseclib | >= 0 < 1.0.23-1 | 1.0.23-1 |
| phpseclib | phpseclib | >= 0 < 1.0.1-3ubuntu0.1+esm1 | 1.0.1-3ubuntu0.1+esm1 |
| phpseclib | phpseclib | >= 0 < 1.0.9-1ubuntu0.1~esm1 | 1.0.9-1ubuntu0.1~esm1 |
| phpseclib | phpseclib | >= 0 < 1.0.18-2ubuntu0.1~esm1 | 1.0.18-2ubuntu0.1~esm1 |
| phpseclib | phpseclib | >= 0 < 1.0.20-1ubuntu0.1~esm1 | 1.0.20-1ubuntu0.1~esm1 |
| phpseclib | phpseclib | >= 0.1.1 < 1.0.23 | 1.0.23 |
| phpseclib | phpseclib | >= 1.0.0 < 1.0.23 | 1.0.23 |
| phpseclib | phpseclib | >= 1.0.0 < 1.0.23 | 1.0.23 |
| phpseclib | phpseclib | >= 2.0.0 < 2.0.47 | 2.0.47 |
| phpseclib | phpseclib | >= 2.0.0 < 2.0.47 | 2.0.47 |
| phpseclib | phpseclib | >= 3.0.0 < 3.0.36 | 3.0.36 |
| phpseclib | phpseclib | >= 3.0.0 < 3.0.36 | 3.0.36 |
CVSS provenance
nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
ghsa7.5HIGH
osv7.5HIGH
vendor_debian7.5HIGH
vendor_ubuntu7.5HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
phpseclib: guardrails needed on isPrime and randomPrime
ghsa·2026-05-06
CVE-2024-27354 [HIGH] CWE-400 phpseclib: guardrails needed on isPrime and randomPrime
phpseclib: guardrails needed on isPrime and randomPrime
### 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
OSV
phpseclib vulnerabilities
osv·2025-04-02·CVSS 7.5
CVE-2021-30130 [HIGH] phpseclib vulnerabilities
phpseclib vulnerabilities
It was discovered that phpseclib did not correctly handle RSA PKCS#1
v1.5 signature verification. An attacker could possibly use this issue to
bypass authentication. This issue only affected Ubuntu 20.04 LTS.
(CVE-2021-30130)
It was discovered that phpseclib did not correctly handle certain
characters in certain TLS fields, which could lead to name confusion.
An attacker could possibly use this issue to bypass authentication.
(CVE-2023-52892)
It was discovered that phpseclib incorrectly limited the size of prime
numbers generated by isPrime. An attacker could possibly use this issue
to cause a denial of service. (CVE-2024-27354)
It was discovered that phpseclib did not correctly handle processing the
ASN.1 object identifier of a certificate. An attacker could
OSV
phpseclib a large prime can cause a denial of service
osv·2024-03-02·CVSS 7.5
CVE-2024-27354 [HIGH] phpseclib a large prime can cause a denial of service
phpseclib a large prime can cause a denial of service
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.
GHSA
phpseclib a large prime can cause a denial of service
ghsa·2024-03-02·CVSS 7.5
CVE-2024-27354 [HIGH] CWE-400 phpseclib a large prime can cause a denial of service
phpseclib a large prime can cause a denial of service
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.
OSV
CVE-2024-27354: An issue was discovered in phpseclib 1
osv·2024-03-01·CVSS 7.5
CVE-2024-27354 [HIGH] CVE-2024-27354: An issue was discovered in phpseclib 1
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.
Ubuntu
phpseclib vulnerabilities
vendor_ubuntu·2025-04-02·CVSS 7.5
CVE-2024-27354 [HIGH] phpseclib vulnerabilities
Title: phpseclib vulnerabilities
Summary: Several security issues were fixed in phpseclib.
It was discovered that phpseclib did not correctly handle RSA PKCS#1
v1.5 signature verification. An attacker could possibly use this issue to
bypass authentication. This issue only affected Ubuntu 20.04 LTS.
(CVE-2021-30130)
It was discovered that phpseclib did not correctly handle certain
characters in certain TLS fields, which could lead to name confusion.
An attacker could possibly use this issue to bypass authentication.
(CVE-2023-52892)
It was discovered that phpseclib incorrectly limited the size of prime
numbers generated by isPrime. An attacker could possibly use this issue
to cause a denial of service. (CVE-2024-27354)
It was discovered that phpseclib did not correctly handle processin
Debian
CVE-2024-27354: php-phpseclib - An issue was discovered in phpseclib 1.x before 1.0.23, 2.x before 2.0.47, and 3...
vendor_debian·2024·CVSS 7.5
CVE-2024-27354 [HIGH] CVE-2024-27354: php-phpseclib - An issue was discovered in phpseclib 1.x before 1.0.23, 2.x before 2.0.47, and 3...
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.
Scope: local
bookworm: resolved (fixed in 2.0.42-1+deb12u2)
bullseye: resolved (fixed in 2.0.30-2+deb11u2)
forky: resolved (fixed in 2.0.47-1)
sid: resolved (fixed in 2.0.47-1)
trixie: resolved (fixed in 2.0.47-1)
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://gist.github.com/katzj/ee72f3c2a00590812b2ea3c0c8890e0bhttps://github.com/phpseclib/phpseclib/blob/master/phpseclib/Math/PrimeField.php#L49https://lists.debian.org/debian-lts-announce/2024/03/msg00002.htmlhttps://lists.debian.org/debian-lts-announce/2024/03/msg00003.htmlhttps://gist.github.com/katzj/ee72f3c2a00590812b2ea3c0c8890e0bhttps://github.com/phpseclib/phpseclib/blob/master/phpseclib/Math/PrimeField.php#L49https://lists.debian.org/debian-lts-announce/2024/03/msg00002.htmlhttps://lists.debian.org/debian-lts-announce/2024/03/msg00003.html
2024-03-01
Published