CVE-2024-27354: High severity phpseclib phpseclib vulnerability
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
Event History
Frequently Asked Questions
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.
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.
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.
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.
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.