Permissive Regular Expression in phpseclib - #VU168998

 

Permissive Regular Expression in phpseclib - #VU168998

Published: November 21, 2026


Vulnerability identifier: #VU168998
CSH Severity: Medium
CVSS v4: 8.2 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N]
CVE-ID: N/A
CWE-ID: CWE-625
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to bypass certificate hostname verification and impersonate a host they do not control in applications that rely on the check.

The vulnerability exists due to a permissive regular expression in phpseclib's X509::validateURL() when a certificate lacks a subjectAltName extension and its commonName is converted into a pattern without escaping all regex metacharacters. A remote attacker can present a certificate signed by a CA the application trusts with regex metacharacters in its commonName to make the hostname check accept a host they do not control.


Affected software

phpseclib

Remediation

Install security update from vendor's website.

phpseclib - addressed in versions 1.0.32, 2.0.57, 3.0.59

External References

Related Security Bulletins