Input validation error in phpseclib - CVE-2023-52892
Published: April 29, 2025 / Updated: May 21, 2026
Vulnerability details
The vulnerability allows a remote attacker to bypass implemented security restrictions.
The vulnerability exists due to an error when handling some characters in Subject Alternative Name fields in TLS certificates. These fields are incorrectly allowed to have a special meaning in regular expressions (such as a + wildcard), leading to name confusion in X.509 certificate host verification.
Affected software
Ubuntu
Fedora
php-phpseclib (Ubuntu package)
php-phpseclib
How to mitigate CVE-2023-52892
php-phpseclib (Ubuntu package) - addressed in versions 1.0.1-3ubuntu0.1+esm1, 1.0.9-1ubuntu0.1~esm1, 1.0.18-2ubuntu0.1~esm1, 1.0.20-1ubuntu0.1~esm1, 2.0.1-1ubuntu0.1~esm2, 2.0.9-1ubuntu0.1~esm2, 2.0.23-2ubuntu0.1~esm2, 2.0.36-1ubuntu0.1~esm2, 3.0.13-1ubuntu0.1~esm1
php-phpseclib - addressed in versions 2.0.48-1.fc40, 2.0.48-1.fc41
External References
- https://github.com/phpseclib/phpseclib/issues/1943
- https://github.com/phpseclib/phpseclib/releases/tag/3.0.33
- https://github.com/phpseclib/phpseclib/commit/6cd6e8ceab9f2b55c8cd81d2192bf98cbeaf4627
- https://github.com/x509-name-testing/name_testing_artifacts
- https://github.com/phpseclib/phpseclib/security/advisories/GHSA-wc6m-wcx7-q5p2