TLS Certificate Subject Alternative Name Vulnerability in phpseclib

php-phpseclib Updated 02 Oct 2025

Summary

27/06/2024
N/A
No i
Unrated
Not published

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback