Executive brief
phpseclib is a widely used PHP library for secure communications and handling digital certificates. A vulnerability exists where the library automatically attempts to connect to web addresses found inside untrusted security certificates during the validation process. An attacker can provide a specially crafted certificate to force the server into making unauthorized requests to internal systems, such as private databases, cloud management interfaces, or local services, potentially exposing internal network structure or sensitive metadata.
Technical details
A Server-Side Request Forgery (SSRF) vulnerability exists in phpseclib's X.509 certificate validation logic. When `X509::validateSignature()` processes a certificate whose issuer is not in the trust store, it performs 'AIA chasing' by default. The `testForIntermediate()` method extracts a URL from the `id-ad-caIssuers` field of the Authority Information Access (AIA) extension and passes it to `fetchURL()`. Because `fetchURL()` uses `fsockopen()` without validating the destination, an unauthenticated attacker providing a malicious certificate can force the server to initiate TCP connections to arbitrary hosts and ports, including loopback (127.0.0.1) and cloud metadata services (169.254.169.254). While the attack is 'blind' (the response body is only used if it parses as a valid certificate), it allows for internal port scanning and exploitation of internal services. The issue is addressed in versions 1.0.30, 2.0.55, and 3.0.54 by restricting or disabling this default behavior.
Affected products
- phpseclib phpseclib >= 0.1.1, < 1.0.30; >= 2.0.0, < 2.0.55; >= 3.0.0, < 3.0.54
Timeline
- 2026-06-14: advisory: GitHub Security Advisory published by maintainer
- 2026-06-22: disclosed: CVE published to NVD