Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. surrealdb
  4. ›
  5. GHSA-q3gg-m8hr-h4x4

GHSA-q3gg-m8hr-h4x4: Externally Controlled Format String in Scripting Functions

February 21, 2024

The rquickjs crate used by SurrealDB implements Rust bindings to the QuickJS C library and is used to execute SurrealDB scripting functions. The rquickjs function Exception::throw_type takes a string and returns an error object. Prior to version 0.4.2 of the crate, this string would be fed directly into printf, which will receive the error string as a format string with no additional arguments, leading to undefined behavior. This issue triggers when a SurrealDB scripting function returns an error and its input contains a format string such as %s or %d.

This vulnerability can only affect SurrealDB servers explicitly enabling the scripting capability with --allow-scripting or --allow-all and equivalent environment variables SURREAL_CAPS_ALLOW_SCRIPT=true and SURREAL_CAPS_ALLOW_ALL=true.

References

  • github.com/advisories/GHSA-q3gg-m8hr-h4x4
  • github.com/surrealdb/surrealdb
  • github.com/surrealdb/surrealdb/issues/3327
  • github.com/surrealdb/surrealdb/pull/3332
  • github.com/surrealdb/surrealdb/security/advisories/GHSA-q3gg-m8hr-h4x4

Code Behaviors & Features

Detect and mitigate GHSA-q3gg-m8hr-h4x4 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.1.1

Fixed versions

  • 1.1.1

Solution

Upgrade to version 1.1.1 or above.

Impact 8.5 HIGH

CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H

Learn more about CVSS

Source file

cargo/surrealdb/GHSA-q3gg-m8hr-h4x4.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:59 +0000.