GHSA-H5RG-8P7F-47G2

GHSA-H5RG-8P7F-47G2 is a medium-severity server-side request forgery (SSRF) vulnerability in surrealdb (rust), affecting versions < 3.1.5. It is fixed in 3.1.5.

Summary

SurrealDB fetches the JWKS document for a JWT or record access method using a bare reqwest client that follows HTTP redirects by default. The network capability check in core/src/iam/jwks.rs (check_capabilities_url) is applied only to the originally configured URL; redirect targets are not re-validated. An --allow-net-permitted JWKS host that returns a 3xx Location can therefore redirect the request to an address the allowlist was meant to block, resulting in a server-side request forgery (SSRF). The protected HttpClient used by http::* functions re-checks every redirect hop and was hardened in 3.1.0, but the JWKS fetcher uses its own client and was not covered.

Workarounds

  • Restrict the Owner role to trusted operators.
  • Enforce egress filtering at the network layer (block link-local 169.254.0.0/16 and internal ranges) so redirect targets are unreachable regardless of in-process checks.
  • Configure access methods to use only trusted JWKS hosts that do not redirect, or use locally defined keys instead of a remote JWKS.

References

Impact

What an attacker can do:

  • With the Owner role at database level or above (the minimum required to run DEFINE ACCESS ... TYPE JWT URL or TYPE RECORD ... WITH JWT URL), point an access method at an allowlisted host they control and redirect the server's GET to an otherwise-blocked target, cloud metadata, loopback, internal services, bypassing --allow-net/--deny-net.
  • Infer the existence and liveness of internal hosts and ports from response-timing differences (bounded by the 1-second fetch timeout).

What it can't do:

  • Read the response: the fetch is blind, the body is only parsed as a JWKS, and a non-JWKS response surfaces as an opaque InvalidAuth error. Nothing is returned to the caller.
  • Modify data or affect availability (a single GET request).

Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside. Typical impact: access to internal metadata services, internal APIs, or cloud credentials.

GHSA-H5RG-8P7F-47G2 has a CVSS score of 4.1 (Medium). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.1.5); upgrading removes the vulnerable code path.

Affected versions

surrealdb (< 3.1.5)

Security releases

surrealdb → 3.1.5 (rust)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

The JWKS fetcher now applies a redirect policy that re-validates every redirect target against the configured network capabilities (mirroring check_capabilities_url) and caps redirects at max_http_redirects.

  • Versions prior to 3.1.5 are vulnerable.

Frequently Asked Questions

  1. What is GHSA-H5RG-8P7F-47G2? GHSA-H5RG-8P7F-47G2 is a medium-severity server-side request forgery (SSRF) vulnerability in surrealdb (rust), affecting versions < 3.1.5. It is fixed in 3.1.5. Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside.
  2. How severe is GHSA-H5RG-8P7F-47G2? GHSA-H5RG-8P7F-47G2 has a CVSS score of 4.1 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of surrealdb are affected by GHSA-H5RG-8P7F-47G2? surrealdb (rust) versions < 3.1.5 is affected.
  4. Is there a fix for GHSA-H5RG-8P7F-47G2? Yes. GHSA-H5RG-8P7F-47G2 is fixed in 3.1.5. Upgrade to this version or later.
  5. Is GHSA-H5RG-8P7F-47G2 exploitable, and should I be worried? Whether GHSA-H5RG-8P7F-47G2 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-H5RG-8P7F-47G2 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-H5RG-8P7F-47G2? Upgrade surrealdb to 3.1.5 or later.

Other vulnerabilities in surrealdb

Stop the waste.
Protect your environment with Kodem.