Junglewise Threat Intelligence

SurrealDB arbitrary file read in DEFINE ANALYZER mapper filter

Severity: high · CVSS 7.7 · Published 2026-06-19

Technologies: surrealdb (crates.io). Vendors: SurrealDB, crates.io.

Executive brief

SurrealDB is a multi-model database. A vulnerability in its full-text search feature allows users with database 'EDITOR' or 'OWNER' roles to read sensitive files from the underlying server's filesystem. This could lead to the exposure of system credentials or secret environment variables, potentially allowing an attacker to gain full control over the database instance.

Technical details

A path traversal and information exposure vulnerability exists in SurrealDB's 'DEFINE ANALYZER' statement when using the 'mapper' filter. The root cause is a failure to enforce the 'SURREAL_FILE_ALLOWLIST' restriction when the list is empty (the default state), combined with error messages that leak the first line of the targeted file. An authenticated attacker with 'EDITOR' or 'OWNER' privileges can provide an arbitrary file path to the mapper filter; if the file is readable by the SurrealDB process, its content is returned in the resulting query error message. This can be used to extract environment variables or startup credentials from system files like /proc/self/environ. The issue is fixed in version 3.1.5 by denying all file access by default and removing file contents from error messages.

Affected products

  • SurrealDB SurrealDB < 3.1.5

Timeline

  • 2026-06-19: disclosed
  • 2026-06-19: patched: Fixed in version 3.1.5
  • 2026-06-19: advisory

References

Related threats