TLS Certificate Subject Alternative Name Vulnerability in phpseclib
Summary
CVE-2023-52892: In phpseclib before 1.0.22, 2.x before 2.0.46, and 3.x before 3.0.33, some characters in Subject Alternative Name fields in TLS certificates are incorrectly allowed to have a special meaning in regular expressions (such... Affects php-phpseclib across 2 version ranges.
< 6cd6e8ceab9f2b55c8cd81d2192bf98cbeaf4627
< 33fa69b2514a61138dd48e7a49f99445711e0ad0
No fix is published. How to fix ↓
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, providing functionalities such as encryption, decryption, and secure file transfer. It is widely used in various applications to handle cryptographic operations. However, certain versions of phpseclib are vulnerable to a flaw in the handling of Subject Alternative Name fields in TLS certificates, which can lead to security issues during host verification.
Vulnerability Detail
In phpseclib versions prior to 1.0.22, 2.x before 2.0.46, and 3.x before 3.0.33, the library incorrectly allows certain characters in Subject Alternative Name fields to have special meanings in regular expressions, such as a + wildcard. This can lead to name confusion during X.509 certificate host verification, potentially allowing attackers to impersonate legitimate hosts and intercept sensitive data.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If you cannot immediately update phpseclib, consider implementing additional validation checks on the Subject Alternative Name fields in your application to mitigate the risk of name confusion. This can include restricting the use of special characters in these fields.
Conclusion
The vulnerability in phpseclib regarding the handling of Subject Alternative Name fields poses a significant risk to applications relying on this library for secure communications. It is crucial to update to the latest versions to ensure the integrity and security of your applications.
See every vulnerability recorded for php-phpseclib →
FAQ
The vulnerability can allow attackers to impersonate legitimate hosts, leading to potential data interception and security breaches.
Versions before 1.0.22, 2.x before 2.0.46, and 3.x before 3.0.33 are affected by this vulnerability.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Simply upload your manifest file like package-lock.json to check for vulnerabilities.
Yes, you can implement additional validation checks on the Subject Alternative Name fields to restrict the use of special characters.
You can find more details on the official CVE page or through the vulnerability database linked in the vulnerability report.
Related vulnerabilities
Recent vulnerabilities recorded for php-phpseclib.