From 60358c131f7c3fde179f4bb18618bca4c2eb4a59 Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 21:09:25 +0000 Subject: [PATCH] Publish Advisories GHSA-2cvj-g5r5-jrrg GHSA-m7rc-8w7m-r9qr --- .../GHSA-2cvj-g5r5-jrrg.json | 78 ++++++++++++++++ .../GHSA-m7rc-8w7m-r9qr.json | 93 +++++++++++++++++++ 2 files changed, 171 insertions(+) create mode 100644 advisories/github-reviewed/2025/04/GHSA-2cvj-g5r5-jrrg/GHSA-2cvj-g5r5-jrrg.json create mode 100644 advisories/github-reviewed/2025/04/GHSA-m7rc-8w7m-r9qr/GHSA-m7rc-8w7m-r9qr.json diff --git a/advisories/github-reviewed/2025/04/GHSA-2cvj-g5r5-jrrg/GHSA-2cvj-g5r5-jrrg.json b/advisories/github-reviewed/2025/04/GHSA-2cvj-g5r5-jrrg/GHSA-2cvj-g5r5-jrrg.json new file mode 100644 index 00000000000..2d9a9d1f7fc --- /dev/null +++ b/advisories/github-reviewed/2025/04/GHSA-2cvj-g5r5-jrrg/GHSA-2cvj-g5r5-jrrg.json @@ -0,0 +1,78 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-2cvj-g5r5-jrrg", + "modified": "2025-04-10T21:08:50Z", + "published": "2025-04-10T21:08:50Z", + "aliases": [], + "summary": "SurrealDB has local file read of 2-column TSV files via analyzers ", + "details": "An authenticated system user at the root, namespace, or database levels can use the `DEFINE ANALYZER` statement to point to arbitrary file locations on the file system, and should the file be tab separated with two columns, the analyzer can be leveraged to exfiltrate the content.\n\nThis issue was discovered and patched during an code audit and penetration test of SurrealDB by cure53, the severity defined within cure53's preliminary finding is Low, matched by our CVSS v4 assessment.\n\n### Impact\nLimited to unauthorised access to 2 column TSV files on the file system\n\n### Patches\nA patch has been created that introduces a new environment variable, `SURREAL_FILE_ALLOWLIST` , which contains a list of allowed file paths. When a mapping file is processed, the mapper checks if the file’s path is within one of the allowed paths.\n\n- Versions 2.1.5, 2.2.2 and later are not affected by this issue.\n\n### Workarounds\nUsers unable to update may want to limit those with root, namespace, or database level users to trusted parties only.\n\n### References\n[SurrealQL Documentation - DEFINE ANALYZER](https://surrealdb.com/docs/surrealql/statements/define/analyzer#define-analyzer-statement)\n[#5600](https://github.com/surrealdb/surrealdb/pull/5600)", + "severity": [ + { + "type": "CVSS_V4", + "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N" + } + ], + "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": "0" + }, + { + "fixed": "2.1.5" + } + ] + } + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-2cvj-g5r5-jrrg" + }, + { + "type": "WEB", + "url": "https://github.com/surrealdb/surrealdb/pull/5600" + }, + { + "type": "PACKAGE", + "url": "https://github.com/surrealdb/surrealdb" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-22" + ], + "severity": "LOW", + "github_reviewed": true, + "github_reviewed_at": "2025-04-10T21:08:50Z", + "nvd_published_at": null + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2025/04/GHSA-m7rc-8w7m-r9qr/GHSA-m7rc-8w7m-r9qr.json b/advisories/github-reviewed/2025/04/GHSA-m7rc-8w7m-r9qr/GHSA-m7rc-8w7m-r9qr.json new file mode 100644 index 00000000000..146abc31b49 --- /dev/null +++ b/advisories/github-reviewed/2025/04/GHSA-m7rc-8w7m-r9qr/GHSA-m7rc-8w7m-r9qr.json @@ -0,0 +1,93 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-m7rc-8w7m-r9qr", + "modified": "2025-04-10T21:08:00Z", + "published": "2025-04-10T21:07:44Z", + "aliases": [], + "summary": "SurrealDB vulnerable to memory exhaustion via nested functions and scripts", + "details": "In order to prevent DoS situations due to infinite recursions, SurrealDB implements a limit of nested calls for both native functions and embedded JavaScript functions.\n\nHowever, in SurrealDB instances with embedded scripting functions enabled, it was found that this limit can be circumvented by utilizing both at the same time. If a native function contains JavaScript which issues a new query that calls that function, the recursion limit is not triggered.\n\nOnce executed, SurrealDB will follow the path of infinite recursions until the system runs out of memory, prior to the recursion limit being triggered.\n\nThis vulnerability can only affect SurrealDB servers explicitly enabling the scripting capability with `--allow-scripting` or \n`--allow-all` and equivalent environment variables `SURREAL_CAPS_ALLOW_SCRIPT=true` and `SURREAL_CAPS_ALLOW_ALL=true`.\n\nThis issue was discovered and patched during an code audit and penetration test of SurrealDB by cure53, the severity defined within cure53's preliminary finding is Medium, matched by our CVSS v4 assessment.\n\n### Impact\nFor SurrealDB instances with embedded scripting functions enabled, this attack could be used to perform a DoS attack on the server by an authenticated user. \n\n### Patches\nA patch has been created that further limits scripting function call limit recursion depth and disallows multiple calls to `surreadb.query()` to run in parallel in a scripting function.\n\n- Versions 2.0.5, 2.1.5, 2.2.2 and later are not affected by this issue.\n\n### Workarounds\nDeny execution of embedded scripting functions through the configuration of [capabilities](https://surrealdb.com/docs/surrealdb/security/capabilities#capabilities) by starting SurrealDB with the `--deny-scripting` flag or the equivalent environment variable `SURREAL_CAPS_DENY_SCRIPT=true`. This has a usability implication, although scripting functions are disabled by default.\n\n### References\n[SurrealDB Documentation - Capabilities](https://surrealdb.com/docs/surrealdb/security/capabilities)\n[SurrealQL Documentation - Scripting Functions](https://surrealdb.com/docs/surrealql/functions/script)", + "severity": [ + { + "type": "CVSS_V4", + "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N" + } + ], + "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-m7rc-8w7m-r9qr" + }, + { + "type": "PACKAGE", + "url": "https://github.com/surrealdb/surrealdb" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-674" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2025-04-10T21:07:44Z", + "nvd_published_at": null + } +} \ No newline at end of file