CVE-2024-27354: High severity phpseclib phpseclib vulnerability

Published Mar 1, 2024
·
Updated

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

Other sources

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.

GitHub

Affected Software

11 affected componentsFixes available
composer/phpseclib/phpseclib>=3.0.0<3.0.36
3.0.36
composer/phpseclib/phpseclib>=2.0.0<2.0.47
2.0.47
composer/phpseclib/phpseclib>=1.0.0<1.0.23
1.0.23
debian/php-phpseclib<=2.0.30-2+deb11u1, <=2.0.42-1+deb12u1
2.0.30-2+deb11u22.0.42-1+deb12u22.0.48-3
debian/php-phpseclib3<=3.0.19-1+deb12u2
3.0.19-1+deb12u33.0.43-2
debian/phpseclib<=1.0.19-3+deb11u1, <=1.0.20-1+deb12u1
1.0.19-3+deb11u21.0.20-1+deb12u21.0.23-6
phpseclib phpseclib>=1.0.0<1.0.23
phpseclib phpseclib>=2.0.0<2.0.47
phpseclib phpseclib>=3.0.0<3.0.36
Debian Debian Linux=10.0
composer/phpseclib/phpseclib>=0.1.1<1.0.23
1.0.23

Event History

Mar 1, 2024
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·11:15 PM
DescriptionSeverityWeaknessAffected Software
Mar 2, 2024
Advisory Published
via GitHub·12:31 AM
Apr 6, 2025
Data Sourced
via Ubuntu·05:23 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·05:24 AM
Description
May 6, 2026
Advisory Published
via GitHub·05:57 PM
Data Sourced
via GitHub·05:57 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-27354?

CVE-2024-27354 has a moderate severity level due to its potential for denial of service via high CPU consumption.

2

How do I fix CVE-2024-27354?

To mitigate CVE-2024-27354, upgrade phpseclib to version 3.0.36, 2.0.47, or 1.0.23 as appropriate.

3

Which versions of phpseclib are vulnerable to CVE-2024-27354?

phpseclib versions before 1.0.23, 2.0.47, and 3.0.36 are vulnerable to CVE-2024-27354.

4

What types of attacks does CVE-2024-27354 allow?

CVE-2024-27354 allows attackers to perform denial of service attacks by exploiting malformed certificates with large primes.

5

Is my application at risk if I use an affected version of phpseclib with CVE-2024-27354?

Yes, using an affected version of phpseclib puts your application at risk for denial of service due to CVE-2024-27354.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203