MEDIUM 5.8

CVE-2026-55599: phpseclib SSRF via Untrusted X.509 Certificate Validation

phpseclib, a widely-used PHP library for cryptographic operations and secure communications, contains a server-side request forgery (SSRF) vulnerability in how it validates X.509 certificates. When an application uses phpseclib to validate a certificate, the library automatically fetches and connects to a URL embedded in the certificate's Authority Information Access extension—without any restrictions on where that URL points. An attacker who controls a malicious certificate can force a validating server to make connections to internal resources it should never reach, such as localhost services, cloud metadata endpoints, or internal-only infrastructure. This happens by default with no configuration required, making it a dangerous insecure default.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.8 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N
Weaknesses (CWE)
CWE-918
Affected products
1 configuration(s)
Published / Modified
2026-06-22 / 2026-06-26

NVD description (verbatim)

phpseclib is a PHP secure communications library. From 0.1.1 until 1.0.30, 2.0.55, and 3.0.54, when an application validates an untrusted X.509 certificate with phpseclib, X509::validateSignature() reads a URL out of that certificate's Authority Information Access (AIA) extension and connects to it. Attacker who supplies certificate fully controls host, port, and path of that connection. URL fetching is enabled by default, and no destination is blocked. An unauthenticated attacker can therefore make a validating server open connections to internal hosts and ports it should never reach, for example loopback 127.0.0.1, cloud metadata address 169.254.169.254, and internal-only services. This is a server-side request forgery (SSRF) caused by an insecure default. This vulnerability is fixed in 1.0.30, 2.0.55, and 3.0.54.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in the X509::validateSignature() method across phpseclib versions 0.1.1 through 1.0.29, 2.0.54, and 3.0.53. During certificate validation, the method parses the Authority Information Access (AIA) extension (OID 1.3.6.1.5.5.7.1.1) and automatically initiates HTTP/HTTPS connections to URLs specified within it. The library performs no validation of the destination host, port, or path before making the connection. An attacker supplying a malicious certificate with a crafted AIA URL can redirect validating servers to probe internal networks, cloud metadata services (169.254.169.254), or localhost interfaces (127.0.0.1), enabling reconnaissance and potential credential theft or service abuse. The root cause is an insecure default that enables URL fetching without explicit opt-in or destination allowlisting.

Business impact

Organizations running web applications or services that validate untrusted X.509 certificates—such as API gateways, certificate pinning validators, or PKI infrastructure—face exposure to internal network reconnaissance. Attackers can map internal services, access cloud metadata endpoints to steal credentials and configuration, or trigger denial-of-service conditions on internal systems. The vulnerability is particularly dangerous in containerized and cloud environments where metadata endpoints are common attack vectors. Because the flaw is an insecure default, many developers may not realize their applications are vulnerable simply by using recent versions of phpseclib without explicit hardening.

Affected systems

Any application using phpseclib versions 0.1.1 through 1.0.29, 2.0.54, or 3.0.53 that validates certificates—whether for TLS handshake verification, certificate chain validation, or certificate pinning checks—is potentially affected. This includes web services, API clients, VPN implementations, and certificate management tools written in PHP. The vulnerability does not require the application to explicitly enable AIA fetching; it happens by default. Verify your phpseclib version and usage patterns: if your application calls X509::validateSignature() or related certificate validation methods on untrusted input, assume exposure.

Exploitability

Exploitation requires an attacker to supply a certificate that the target application will validate. This is feasible in scenarios where certificates are uploaded by users, retrieved from untrusted sources, or used in protocols that accept arbitrary certificates (such as ACME validators or certificate transparency monitors). The attack requires no authentication, no user interaction, and no special network position—only the ability to control a certificate and knowledge that the target uses phpseclib. The CVSS score of 5.8 (Medium) reflects the network-accessible attack vector and potential for information disclosure, though the impact is limited to confidentiality; no code execution or authentication bypass occurs.

Remediation

Upgrade phpseclib to version 1.0.30, 2.0.55, or 3.0.54 or later, depending on your current version branch. These releases fix the vulnerability by disabling unsafe AIA URL fetching by default and requiring explicit allowlisting of trusted destinations. After patching, audit any code that validates untrusted certificates and consider implementing additional controls: restrict certificate sources, disable AIA fetching unless absolutely necessary, or use a Web Application Firewall to block outbound connections to sensitive internal ranges (127.0.0.0/8, 169.254.0.0/16, etc.). Test thoroughly in a staging environment before rolling out patches to production.

Patch guidance

1. Identify all servers and applications using phpseclib—check composer.json, vendor directories, and dependency trees. 2. For each major version line, upgrade to the patched release: 1.0.30+, 2.0.55+, or 3.0.54+. 3. Review release notes and changelogs to understand any breaking changes or deprecated methods. 4. Test certificate validation workflows in staging, including edge cases with AIA extensions. 5. Deploy patches using your standard change management process, prioritizing applications that accept untrusted certificates. 6. Verify patches are applied by checking version output and running phpunit tests if available. 7. Monitor for any certificate validation errors or unexpected behavior post-patch; AIA handling changes may affect some legitimate certificate chains.

Detection guidance

Monitor for unexpected outbound connections from PHP application servers, particularly to internal IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 169.254.0.0/16) or cloud metadata endpoints. Log and alert on certificate validation operations that trigger HTTP connections. Review application logs for error messages related to certificate parsing or AIA extension processing. If you have network access logs, correlate certificate validation operations with new outbound connections. For development and testing, enable verbose logging in phpseclib by checking $this->log if available in the library. In web application firewalls and intrusion detection systems, look for patterns where certificate uploads or imports precede internal network probes.

Why prioritize this

Although the CVSS score is Medium (5.8), this vulnerability warrants prompt attention because: (1) it is an insecure default affecting all users of the library without explicit opt-in; (2) it enables attackers to probe internal infrastructure and cloud metadata endpoints, a common precursor to lateral movement and credential theft; (3) the barrier to exploitation is low—merely supplying a crafted certificate; (4) many organizations may not realize their applications are vulnerable simply by using phpseclib for certificate validation. Prioritize patching if your application validates certificates from untrusted sources or is exposed to the internet.

Risk score, explained

The CVSS 3.1 score of 5.8 reflects an attack requiring network access and no privileges or user interaction, coupled with limited impact (confidentiality only—information disclosure via SSRF). However, context matters: in cloud and containerized environments, SSRF access to metadata endpoints can yield high-impact credential theft, effectively raising the practical risk. Organizations should assess their own environment: if internal services or cloud metadata are reachable from applications using phpseclib, treat this as a higher-priority finding.

Frequently asked questions

Does this vulnerability allow code execution or authentication bypass?

No. The vulnerability is limited to information disclosure via server-side request forgery (SSRF). An attacker can force the application to connect to internal resources and potentially read responses, but cannot execute arbitrary code or bypass authentication directly. However, information leaked from internal services (e.g., cloud credentials from metadata endpoints) can lead to further compromise.

What if my application never validates untrusted certificates?

If your PHP application only validates certificates from trusted, controlled sources (e.g., your own CA or a hardened upstream provider), the attack surface is reduced. However, you should still patch: supply-chain compromises, misconfigurations, and future use cases are risks. Additionally, verify that certificate sources are truly controlled; developers sometimes underestimate untrusted input.

Does the patch break legitimate certificate validation workflows?

The patch disables unsafe AIA fetching by default, which may affect applications that legitimately rely on AIA extensions for certificate chain building. Verify your certificate validation logic post-patch. The library is expected to provide opt-in mechanisms or configuration to re-enable AIA if needed, but test thoroughly in staging.

How do I know which version of phpseclib I'm running?

Check your composer.json and composer.lock files, or run `composer show phpseclib/phpseclib` in your project directory. Alternatively, check the library's version constant or examine the /vendor/phpseclib directory. If you're unsure, audit your entire dependency tree with `composer audit` to identify outdated or vulnerable packages.

This analysis is based on the CVE record and vendor advisory as of the publication date. Patch version numbers and affected version ranges are derived from official phpseclib release notes; verify against the vendor's advisory before deploying patches. The absence of a CISA Known Exploited Vulnerabilities (KEV) listing does not indicate low risk; it reflects current public exploit disclosure status, which may change. Organizations should assess their own environment, certificate validation practices, and network topology when prioritizing response. No proof-of-concept code, exploitation steps, or weaponized tools are provided herein. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).