CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-M557-WRGG-6RP4

GHSA-m557-wrgg-6rp4: Server-Side Request Forgery via Authority Information Access (AIA) Chasing in phpseclib

Amit Schendel
Amit Schendel
Senior Security Researcher

Jun 16, 2026·6 min read·3 visits

Executive Summary (TL;DR)

An insecure default configuration in phpseclib enables dynamic retrieval of Certificate Authority certificates via Authority Information Access (AIA) extensions. Because these target URLs are extracted directly from user-supplied certificates and processed without destination validation, attackers can initiate arbitrary outbound GET requests to internal networks and cloud metadata servers.

The PHP Secure Communications Library (phpseclib) contains a Server-Side Request Forgery (SSRF) vulnerability due to an insecure default implementation of Authority Information Access (AIA) certificate chasing. This flaw allows remote, unauthenticated attackers to coerce applications validating user-supplied X.509 certificates into generating arbitrary outbound HTTP requests to internal networks or local interfaces.

Vulnerability Overview

The PHP Secure Communications Library (phpseclib) is a pure-PHP implementation of cryptographic and public-key infrastructure primitives. Within its X.509 validation module, File/X509.php, the library supports dynamic path validation to construct complete certificate trust chains. If a validated certificate is signed by an intermediate certificate authority that is not present in the local trust store, the library tries to retrieve the missing certificate dynamically.

This behavior, defined as Authority Information Access (AIA) Chasing under RFC 4325, parses the id-pe-authorityInfoAccess extension inside the certificate to locate the parent CA URI. When an application parses an untrusted certificate containing this extension, phpseclib extracts the URI specified in the id-ad-caIssuers access method and issues an HTTP GET request to download the issuer's certificate.

However, because dynamic AIA chasing was enabled by default without destination validation, the implementation introduces a Server-Side Request Forgery (SSRF) vulnerability. An attacker capable of submitting or uploading a crafted certificate to an application using phpseclib can fully control the destination host, port, and query string of the resulting outbound HTTP request. The lack of destination restrictions means that the server can be forced to connect to internal systems, loopback interfaces, or cloud metadata endpoints.

Root Cause Analysis

The root cause of GHSA-m557-wrgg-6rp4 is a structural vulnerability arising from three compounding deficiencies: input trust issues, unsafe default behavior, and a lack of egress verification. The primary failure is the direct ingestion and parsing of unvalidated metadata from untrusted sources. Because the id-pe-authorityInfoAccess extension resides within the certificate body itself, any attacker can specify an arbitrary URL during certificate generation.

During signature evaluation, the validation pipeline triggers testForIntermediate() to find parent certificates. The library parses the certificate's extensions, extracts the value of the uniformResourceIdentifier inside the AIA structure, and passes it directly to the static method fetchURL(). No validation is performed on the host or scheme before this transition.

Finally, the fetchURL() method uses PHP's native fsockopen() function to establish a raw TCP connection to the extracted destination. Prior to the remediation, the static Boolean property $disable_url_fetch was initialized to false by default, activating dynamic HTTP requests out-of-the-box. Furthermore, fetchURL() lacks any destination restrictions or loopback blocklists, leaving the validating server vulnerable to arbitrary intranet interactions.

Code Analysis

In affected versions of phpseclib, the dynamic fetching process begins inside File/X509.php when the signature validation engine fails to find a pre-loaded local issuer. The code extracts the target URL and directly initiates a socket handshake via fetchURL() without structural checks on the destination address.

// Vulnerable logic in File/X509.php prior to remediation
private static function fetchURL(string $url): ?string
{ 
    if (self::$disable_url_fetch) { // Default is false
        return null;
    }
    $parts = parse_url($url);
    if (!isset($parts['scheme']) || !isset($parts['host'])) {
        return null;
    }
    switch ($parts['scheme']) {
        case 'http':
            // Open socket to arbitrary host and port controlled by the attacker
            $fsock = @fsockopen($parts['host'], $parts['port'] ?? 80, $errno, $errstr, 5);
            if (!$fsock) {
                return null;
            }
            $path = ($parts['path'] ?? '/') . (isset($parts['query']) ? '?' . $parts['query'] : '');
            fputs($fsock, "GET $path HTTP/1.0\r\n");
            fputs($fsock, "Host: $parts[host]\r\n\r\n");
            ...

The remediation introduces a mechanism to intercept and validate or entirely block these outbound requests. In versions 1.0.30, 2.0.55, and 3.0.54, a callback execution pattern is established, allowing developers to define custom egress filtering.

// Remediated logic in File/X509.php introducing callback delegation
private static $url_fetch_callback = null;
 
public static function setURLFetchCallback(callable $callback)
{ 
    self::$url_fetch_callback = $callback;
}
 
private static function fetchURL(string $url): ?string
{ 
    if (self::$disable_url_fetch) {
        return null;
    }
    // If a custom validation callback is registered, delegate handling
    if (is_callable(self::$url_fetch_callback)) {
        return call_user_func(self::$url_fetch_callback, $url);
    }
    
    // Standard fallback logic applies restricted handling or blocks fetching
    ...

Exploitation and Attack Mechanics

To exploit GHSA-m557-wrgg-6rp4, an attacker must target an application interface that parses and validates client-supplied certificates, such as WebID-TLS endpoints, S/MIME message processors, or SAML metadata upload endpoints. The attacker prepares a leaf certificate and configures the AIA extension field to point to an internal resource or port.

Once the application processes the certificate and triggers $x509->validateSignature(), phpseclib parses the extension and extracts the target URI. The validation execution triggers an outbound GET request to the target URI regardless of whether the signature eventually fails to validate. This provides an attacker with a blind SSRF capability, allowing them to map internal networks or interact with unauthenticated REST endpoints.

Impact Assessment

The CVSS v3.1 vector string is evaluated as CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N, yielding a Moderate severity score of 5.8. Because the Scope parameter is set to Changed (S:C), the vulnerability is characterized by its potential to cross security boundaries—such as transitioning from a public web server context to an isolated internal administrative domain.

In cloud environments, attackers can target the link-local address 169.254.169.254. This allows access to Instance Metadata Services (IMDSv1) on AWS, Azure, or Google Cloud, which frequently contain active IAM credentials, configuration parameters, or environment variables. Exposure of these endpoints can lead to full host or cloud account compromise.

In local environments, this flaw facilitates internal network mapping and port scanning. Attackers can execute HTTP requests to local database sockets, Redis instances (127.0.0.1:6379), or internal administrative utilities. Because the HTTP response is parsed solely for X.509 compatibility, direct data extraction is minimized, but request-forgery actions (such as sending command payloads via URI parameters) remain fully viable.

Remediation and Defenses

Remediation requires upgrading the phpseclib/phpseclib dependency to the designated secure versions: 1.0.30, 2.0.55, or 3.0.54. These releases introduce the capability to intercept dynamic fetches and implement proper host validation.

If immediate upgrading is not possible, developers must explicitly call X509::disableURLFetch() prior to parsing or validating untrusted certificates. This permanently deactivates dynamic fetching, preventing the execution of fetchURL() during signature validation.

For systems where dynamic AIA chasing is a business requirement, developers using the patched releases must invoke X509::setURLFetchCallback() to register a custom verification hook. This hook must validate that target hostnames do not resolve to local loopback ranges, private class subnets (RFC 1918), or link-local targets (RFC 3927) before allowing the socket connection to proceed.

Technical Appendix

CVSS Score
5.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N

Affected Systems

phpseclib/phpseclib (Packagist/Composer Package)

Affected Versions Detail

Product
Affected Versions
Fixed Version
phpseclib
phpseclib
>= 0.1.1, < 1.0.301.0.30
phpseclib
phpseclib
>= 2.0.0, < 2.0.552.0.55
phpseclib
phpseclib
>= 3.0.0, < 3.0.543.0.54
AttributeDetail
CWE IDCWE-918
Attack VectorNetwork (AV:N)
CVSS v3.15.8
ImpactServer-Side Request Forgery
Exploit StatusProof of Concept
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1071.001Application Layer Protocol: Web Protocols
Command and Control
CWE-918
Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream source and retrieves the value of this URL without validating the target destination.

References & Sources

  • [1]GitHub Security Advisory GHSA-m557-wrgg-6rp4
  • [2]phpseclib Project Advisory
  • [3]phpseclib Repository
  • [4]phpseclib 3.0.54 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•GHSA-534H-C3CW-V3H9
5.5

GHSA-534h-c3cw-v3h9: Local Information Disclosure via Abstract-Namespace Socket in Nuxt Dev Server

A local security vulnerability in the Nuxt development server (nuxt dev) allows local unprivileged users to access sensitive configuration files and source code. On Linux environments running Node.js 20+, Nuxt bound its internal vite-node IPC server to an abstract-namespace Unix socket without any peer authentication, enabling co-resident local users to connect and request module code directly.

Amit Schendel
Amit Schendel
2 views•5 min read
•about 2 hours ago•GHSA-8RFP-98V4-MMR6
0.0

GHSA-8RFP-98V4-MMR6: Protocol-Filtering Bypass via Unicode Obfuscation in Mozilla Bleach

Mozilla Bleach is an open-source HTML sanitizing library for Python. Versions up to and including 6.3.0 contain an incomplete filtering implementation in the URI validation logic ('sanitize_uri_value'). This logic fails to detect disallowed protocols, such as 'javascript:', if they contain Unicode invisible characters, whitespace characters, or characters with a code point greater than U+00A0. While standard-compliant web browsers do not directly execute invalid URI schemes containing these non-standard characters, downstream systems that normalize Unicode text by stripping invisible or non-ASCII characters can unintentionally reactivate the 'javascript:' prefix, causing Cross-Site Scripting (XSS). Additionally, this behavior violates Bleach's core sanitization contract by outputting URIs that bypass protocol allowlists configured by the caller.

Amit Schendel
Amit Schendel
2 views•7 min read
•about 2 hours ago•GHSA-G75F-G53V-794X
4.3

GHSA-G75F-G53V-794X: CPU Exhaustion via Unbounded Email Regular Expression Scanning in Bleach

An uncontrolled resource consumption vulnerability exists in the Python package Bleach when parsing text to linkify email addresses. When `parse_email=True` is enabled, the regular expression engine is forced into a quadratic-time complexity scan on specially crafted payloads lacking an '@' symbol. This causes immediate CPU exhaustion and blocks application server worker processes.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 3 hours ago•GHSA-GR75-JV2W-4656
4.7

GHSA-GR75-JV2W-4656: Path Traversal and Sandbox Escape in LangChain File-Search Middleware and Loaders

A path traversal and sandbox escape vulnerability in LangChain and LangChain-Anthropic Python packages allows unauthenticated local attackers to access files outside the restricted directory via crafted input, symbolic links, or prefix bypasses.

Alon Barad
Alon Barad
2 views•8 min read
•about 4 hours ago•CVE-2026-45491
6.2

CVE-2026-45491: Directory Traversal via Improper Link Resolution in .NET System.Formats.Tar

A directory traversal vulnerability exists in the Microsoft .NET System.Formats.Tar library during archive extraction. When extracting a TAR archive using the TarFile.ExtractToDirectory API, the extraction engine improperly resolves symbolic links prior to file creation, allowing local unauthorized attackers to write or overwrite arbitrary files outside the target directory. This can lead to local tampering, privilege escalation, or arbitrary code execution.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 4 hours ago•GHSA-GJ48-438W-JH9V
6.1

GHSA-GJ48-438W-JH9V: Client-Side HTML Sanitization Bypass in Bleach

A client-side HTML sanitization bypass vulnerability exists in the Bleach library where the formaction attribute is not recognized as a URI. This allows attackers to inject javascript: URIs when formaction is on the allowed list, resulting in Cross-Site Scripting (XSS).

Alon Barad
Alon Barad
5 views•6 min read