Server-Side Request Forgery in phpseclib: X.509 Certificate Validation Vulnerability

phpseclib/phpseclib Updated 16 Jun 2026

Summary

16/06/2026
MODERATE
Yes i
Moderate
5.8

GHSA-m557-wrgg-6rp4: 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. Affects phpseclib/phpseclib across 3 version ranges.

>= 0.1.1, < 1.0.30 >= 2.0.0, < 2.0.55 >= 3.0.0, < 3.0.54

Fixed in 1.0.30, 2.0.55 or 3.0.54, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

phpseclib is a popular PHP library that provides a range of cryptographic functionalities, including support for X.509 certificates. It is widely used in applications that require secure communications and certificate validation. However, a significant vulnerability has been identified in the way phpseclib handles X.509 certificate validation, specifically in its handling of the Authority Information Access (AIA) extension, which can lead to server-side request forgery (SSRF) attacks.

Vulnerability Detail

The vulnerability arises when phpseclib validates an untrusted X.509 certificate. The function X509::validateSignature() reads a URL from the certificate's AIA extension and connects to it without any restrictions. This allows an attacker to control the host, port, and path of the connection, potentially leading to unauthorized access to internal services or metadata endpoints. The default behavior of enabling URL fetching and the lack of destination restrictions make this a critical issue, as it can be exploited by unauthenticated attackers to probe internal networks.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 0.1.1, < 1.0.30 1.0.30
    composer require phpseclib/phpseclib:1.0.30
  • >= 2.0.0, < 2.0.55 2.0.55
    composer require phpseclib/phpseclib:2.0.55
  • >= 3.0.0, < 3.0.54 3.0.54
    composer require phpseclib/phpseclib:3.0.54

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, you can disable URL fetching by calling the method X509::disableURLFetch() before validating any certificates. This will prevent any outbound connections during the validation process. Here is an example code snippet:

<?php require 'vendor/autoload.php'; use phpseclib3\File\X509; ``` X509::disableURLFetch(); // Disable URL fetching $v = new X509(); $v->loadX509(file_get_contents('attacker_cert.pem')); ``` $v->validateSignature(); // This will not connect to any external URL ?>

Conclusion

The phpseclib library has a vulnerability in its X.509 certificate validation process that can lead to SSRF attacks. It is crucial to update to the latest patched versions to mitigate this risk. Additionally, using workarounds like disabling URL fetching can provide temporary relief until the library is updated.

See every vulnerability recorded for phpseclib/phpseclib →

Share this vulnerability

FAQ

SSRF is a type of attack where an attacker can make requests from a vulnerable server to internal or external resources, potentially leading to data exposure or unauthorized access.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your composer.lock file.

An attacker can gain access to internal services, perform reconnaissance, and potentially exploit other vulnerabilities within your network.

Yes, you can disable URL fetching in phpseclib by using the X509::disableURLFetch() method before validating certificates.

The CVSS score of this vulnerability is 5.8, indicating a moderate level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for phpseclib/phpseclib.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 0.1.1, < 1.0.30 1.0.30
    composer require phpseclib/phpseclib:1.0.30
  • >= 2.0.0, < 2.0.55 2.0.55
    composer require phpseclib/phpseclib:2.0.55
  • >= 3.0.0, < 3.0.54 3.0.54
    composer require phpseclib/phpseclib:3.0.54

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback