# CVE-2025-71394: SurrealDB local file read in DEFINE ANALYZER statement

Source: https://junglewise.ai/threats/cve-2025-71394-surrealdb-local-file-read-in-define-analyzer-statement  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-18. Updated: 2026-07-18  
License: CC BY 4.0 with a link back

CVE-2025-71394 · Severity: medium · CVSS 4 · Published 2026-07-18

SurrealDB is a multi-model database used for managing and scaling data applications. A vulnerability in the database's analyzer definition feature allows authorized users to read sensitive files directly from the server's local storage. While an attacker needs existing database credentials to exploit this, it could lead to the exposure of system configuration files or other sensitive data stored on the host machine.

Technologies: [surrealdb (crates.io)](https://junglewise.ai/threats/technologies/surrealdb). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is CVE-2025-71394 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-71394 being exploited in the wild.

**How severe is CVE-2025-71394?** Medium severity, with a CVSS score of 4, published 18 July 2026.

**Which products and versions are affected?** surrealdb (crates.io) SEMVER:introduced=2.2.0,fixed=2.2.2.

**Is there a fix for CVE-2025-71394?** Yes. surrealdb (crates.io): upgrade to 2.2.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-71394 attacked?** It is attacked over the network, in a hosted service.

**Am I affected by CVE-2025-71394?** Check whether you run surrealdb (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- surrealdb (crates.io): upgrade to 2.2.2 or later

  ```sh
  cargo update -p surrealdb
  ```


## Technical details

A path traversal vulnerability (CWE-22) exists in SurrealDB's 'DEFINE ANALYZER' statement. Authenticated users with root, namespace, or database level privileges can provide arbitrary file paths to the analyzer. If the targeted file is formatted as a two-column tab-separated (TSV) file, the analyzer can be used to exfiltrate its contents. The vulnerability was addressed by introducing a 'SURREAL_FILE_ALLOWLIST' environment variable to restrict file access to approved paths. Patches are available in versions 2.1.5 and 2.2.2.

## Affected products

- SurrealDB SurrealDB < 2.1.5, < 2.2.2

## Identifiers

- CVE-2025-71394
- GHSA-2cvj-g5r5-jrrg

## Timeline

- 2025-04-10: advisory: Initial GitHub Security Advisory published
- 2026-07-18: disclosed: NVD publication date

## References

- [https://github.com/surrealdb/surrealdb/security/advisories/GHSA-2cvj-g5r5-jrrg](https://github.com/surrealdb/surrealdb/security/advisories/GHSA-2cvj-g5r5-jrrg)
- [https://www.vulncheck.com/advisories/surrealdb-before-local-file-read-via-define-analyzer](https://www.vulncheck.com/advisories/surrealdb-before-local-file-read-via-define-analyzer)

## Related threats

- [SurrealDB use-after-free in KV backends via affinitypool spawn_local](https://junglewise.ai/threats/cve-2026-121417-surrealdb-before-3-3-0-contains-a-use-after-free-vulnerability)
- [SurrealDB JSON parser denial of service via uncontrolled recursion](https://junglewise.ai/threats/surrealdb-json-parser-denial-of-service-via-uncontrolled-recursion-3037f8a0)
- [SurrealDB ES512 algorithm silently downgraded to ES384](https://junglewise.ai/threats/surrealdb-es512-algorithm-silently-downgraded-to-es384-f0af29b8)
- [SurrealDB permission bypass via WHERE clause evaluation](https://junglewise.ai/threats/surrealdb-permission-bypass-via-where-clause-evaluation-afa6f001)
- [SurrealDB authorization bypass in KILL statement](https://junglewise.ai/threats/surrealdb-authorization-bypass-in-kill-statement-fc230d0f)
