CVE-2024-27355: phpseclib OID Length Guardrails Vulnerability
Summary
CVE-2024-27355: phpseclib guardrails needed on OID length. Affects phpseclib/phpseclib across 3 version ranges.
>= 0.1.1, < 1.0.23
>= 2.0.0, < 2.0.47
>= 3.0.0, < 3.0.36
Fixed in 1.0.23, 2.0.47 or 3.0.36, depending on the release line you run. How to fix ↓
Also tracked for
- php-phpseclib · Debian:11
The same CVE-2024-27355 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
phpseclib is a popular open-source library for secure communications in PHP. It provides a range of cryptographic functionalities, including support for various encryption algorithms, key management, and secure data transmission. However, it has been found to have vulnerabilities related to the handling of untrusted ASN1 files, such as X509 certificates and RSA keys, which could lead to security breaches if not addressed.
Vulnerability Detail
The vulnerability arises from insufficient guardrails on Object Identifier (OID) lengths when processing untrusted ASN1 files. This can lead to potential denial-of-service attacks or other security issues, as attackers may exploit this weakness to manipulate the parsing of these files. The vulnerability affects multiple versions of phpseclib, specifically those prior to 2.0.47, 3.0.36, and 1.0.23, making it critical for users to update to the patched versions.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 0.1.1, < 1.0.231.0.23composer require phpseclib/phpseclib:1.0.23 -
>= 2.0.0, < 2.0.472.0.47composer require phpseclib/phpseclib:2.0.47 -
>= 3.0.0, < 3.0.363.0.36composer require phpseclib/phpseclib:3.0.36
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
No workarounds are available for this vulnerability. The only effective solution is to update to the patched versions mentioned above.
Conclusion
CVE-2024-27355 represents a significant security risk for applications using vulnerable versions of phpseclib. It is crucial for developers to update to the latest patched versions to mitigate potential threats associated with untrusted ASN1 file processing.
See every vulnerability recorded for phpseclib/phpseclib →
FAQ
CVE-2024-27355 is a vulnerability in the phpseclib library that relates to insufficient guardrails on OID lengths when processing untrusted ASN1 files.
The affected versions include phpseclib versions prior to 2.0.47, 3.0.36, and 1.0.23.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
The vulnerability can lead to denial-of-service attacks or other security issues due to improper handling of ASN1 files.
The CVSS score for CVE-2024-27355 is 7.5, indicating a high severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for phpseclib/phpseclib.