CVE-2025-71398: Surrealdb SurrealDB Bypass Of Deny-net Flags Vulnerability
MODERATECVE-2025-71398 is a MODERATE surrealdb bypass of deny-net flags vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Surrealdb libraries in the crates.io ecosystem. The issue involves surrealdb bypass of deny-net flags via redirect results in server-side request forgery (ssrf). Remediation is available by upgrading affected packages to version 2.2.2, 2.1.5, 2.0.5.
CVE-2025-71398 at a Glance
How to Fix CVE-2025-71398
To remediate this vulnerability, upgrade all affected Surrealdb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade surrealdb to 2.2.2
Upgrade surrealdb to 2.1.5
Upgrade surrealdb to 2.0.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for surrealdb
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-71398, inspect your project dependencies for Surrealdb:
inspect dependencies for surrealdb
Analyze the terminal output to locate any version of Surrealdb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request 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. In Surrealdb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-71398 Affected Surrealdb Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
surrealdb
|
crates.io |
≥ 2.2.0
< 2.2.2
|
2.2.2
|
|
surrealdb
|
crates.io |
≥ 2.1.0
< 2.1.5
|
2.1.5
|
|
surrealdb
|
crates.io |
< 2.0.5
|
2.0.5
|
References
Frequently Asked Questions
What is CVE-2025-71398?
Which Surrealdb versions are affected?
What version fixes CVE-2025-71398?
Is surrealdb affected?
What CWE is associated with CVE-2025-71398?
How can I check crates.io dependencies for CVE-2025-71398?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5q9x-554g-9jgg",
"modified" : "2026-09-04T19:34:50Z",
"published" : "2025-04-11T14:09:37Z",
"aliases" : [ "CVE-2025-71398" ],
"summary" : "SurrealDB bypass of deny-net flags via redirect results in server-side request forgery (SSRF)",
"details" : "SurrealDB offers http functions that can access external network endpoints. A typical, albeit [not recommended ](https://surrealdb.com/docs/surrealdb/reference-guide/security-best-practices#example-deny-all-capabilities-with-some-exceptions) configuration would be to start SurrealDB with all network connections allowed with the exception of a deny list. For example, `surreal start --allow-net --deny-net 10.0.0.0/8` will allow all network connections except to the 10.0.0.0/8 block.\n\nAn authenticated user of SurrealDB can use redirects to bypass this restriction. For example by hosting a server on the public internet which redirects to the IP addresses blocked by the administrator of the SurrealDB server via HTTP 301 or 307 response codes. \n\nWhen sending SurrealDB statements containing the `http::*` functions to the attacker controlled host, the SurrealDB server will follow the redirects to the blocked IP address. Because the statements also return the responses to the attacker, this issue constitutes a full SSRF vulnerability.\n\nThis issue was discovered and patched during an code audit and penetration test of SurrealDB by cure53, the severity as defined within cure53's preliminary finding is Medium, matched by our CVSS v4 assessment.\n\n### Impact\n\nThe impact of this vulnerability is circumvention of the `--deny-net` capability and resulting impact on systems external to SurrealDB. The ultimate impact is dependent on the deployment scenario. \n\nFor example, if the SurrealDB server blocks requests to internal and private IP addresses because they run services which don't require authentication, such as AWS deployments using IMDSv1, the attacker can access these internal endpoints directly, and potentially retrieve or even alter sensitive information and credentials.\n\nThe circumvention could also be used to redirect traffic to the SurrealDB port, providing a low level of impact to availability. \n\n### Patches\nA patch has been created that adds an HTTP redirect limit, and checks HTTP redirects against allowed network targets, preventing redirections to disallowed uri's.\n\n- Versions 2.0.5, 2.1.5, 2.2.2 and later are not affected by this issue.\n\n### Workarounds\nThe possibility of this vulnerability being exploited can be reduced by following an allowlist approach to enabling the http capability `surreal start --allow-net 10.0.0.0/8 ` or using the equivalent `SURREAL_CAPS_ALLOW_NET` environment variable, where endpoints allowed are fully trusted and are not controlled by regular users.\n\nThe network access capability can be disabled, using `--deny-net` or the equivalent `SURREAL_CAPS_DENY_NET` environment variable without specifying targets, with impact to SurrealDB functionality.\n\nAs the impact of this vulnerability depends on the security of the deployment environment of SurrealDB, best practices should be followed within that environment.\n\n\n### Resources\n[#5597](https://github.com/surrealdb/surrealdb/pull/5597)\n[SurrealDB Documentation - Environment Variables](https://surrealdb.com/docs/surrealdb/cli/env)\n[SurrealDB Documentation - Capabilities](https://surrealdb.com/docs/surrealdb/security/capabilities)\n[SurrealDB Documentation - Network Access Capability](https://surrealdb.com/docs/surrealdb/security/capabilities#network)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:L/SC:H/SI:H/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.2.0"
}, {
"fixed" : "2.2.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.1.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-5q9x-554g-9jgg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-71398"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/pull/5597"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/surrealdb/surrealdb"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/surrealdb-before-ssrf-via-http-redirect-bypass"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-04-11T14:09:37Z",
"nvd_published_at" : null
}
}