{"id":"CVE-2025-71396","aliases":["CVE-2025-71396","GHSA-3824-qmfq-2qv7"],"related":[],"kind":"vulnerability","state":"published","title":"SurrealDB before 2.2.2 Denial of Service via JavaScript Scripting","summary":"SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 does not enforce a default execution-time limit on embedded JavaScript scripting functions when the scripting capability is explicitly enabled (via --allow-scripting or --allow-all). An authenticated attacker can submit long-running JavaScript functions to exhaust server resources and cause a denial of service. Scripting is disabled by default.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SurrealDB before 2.0.5, 2.1.x before 2.1.5, and 2.2.x before 2.2.2 does not enforce a default execution-time limit on embedded JavaScript scripting functions when the scripting capability is explicitly enabled (via --allow-scripting or --allow-all). An authenticated attacker can submit long-running JavaScript functions to exhaust server resources and cause a denial of service. Scripting is disabled by default.","source":"cvelist"},{"lang":"en","text":"Through enabling the scripting capability. SurrealDB allows for advanced functions with complicated logic, by allowing embedded functions to be written in JavaScript.\n\nThese functions are bounded for memory and stack size, but not in time. An attacker could launch a number of long running functions that could potentially facilitate a Denial Of Service attack.\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 Low, matched by our CVSS v4 assessment.\n\n### Impact\nAn attacker can use the scripting capabilities of SurrealDB to run a series of long running functions to facilitate a Denial Of Service attack.\n\n### Patches\nA default timeout for the scripting functions has been implemented with a configurable `SURREAL_SCRIPTING_MAX_TIME_LIMIT` environment variable\n\n- Versions 2.0.5, 2.1.5, 2.2.2 and later are not affected by this issue.\n\n### Workarounds\nFor users that cannot upgrade. Deny 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[5597](https://github.com/surrealdb/surrealdb/pull/5597)\n[SurrealDB Documentation - Capabilities](https://surrealdb.com/docs/surrealdb/security/capabilities)\n[SurrealQL Documentation - Scripting Functions](https://surrealdb.com/docs/surrealql/functions/script)","format":"markdown","source":"ghsa"},{"lang":"es","text":"SurrealDB antes de 2.0.5, 2.1.x antes de 2.1.5, y 2.2.x antes de 2.2.2 no impone un límite de tiempo de ejecución predeterminado en las funciones de scripting JavaScript incrustadas cuando la capacidad de scripting está explícitamente habilitada (mediante --allow-scripting o --allow-all). Un atacante autenticado puede enviar funciones JavaScript de larga duración para agotar los recursos del servidor y causar una denegación de servicio. El scripting está deshabilitado por defecto.","source":"nvd"}],"published":"2025-04-11T14:08:45.000Z","modified":"2026-10-29T21:17:06.320Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":2.3,"rating":"LOW"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","score":2.3,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"type":"semver","introduced":"2.2.0","fixed":"2.2.2","status":"affected"},{"type":"semver","version":"2.2.2","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"2.0.5","status":"affected"},{"type":"semver","version":"2.0.5","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.1.0","fixed":"2.1.5","status":"affected"},{"type":"semver","version":"2.1.5","status":"unaffected"}],"vendor":"surrealdb","product":"surrealdb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.2.0","status":"affected","fixed":"2.2.2"}],"ecosystem":"crates.io","package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.5"}],"ecosystem":"crates.io","package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.1.0","status":"affected","fixed":"2.1.5"}],"ecosystem":"crates.io","package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.0.5"},{"status":"affected","introduced":"2.1.0","fixed":"2.1.5"},{"status":"affected","introduced":"2.2.0","fixed":"2.2.2"}],"vendor":"surrealdb","product":"surrealdb","cpe":"cpe:2.3:a:surrealdb:surrealdb:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/surrealdb/surrealdb/security/advisories/GHSA-3824-qmfq-2qv7","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/surrealdb-before-denial-of-service-via-javascript-scripting","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/surrealdb/surrealdb/pull/5597","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/surrealdb/surrealdb","tags":["package"],"sources":["ghsa"]}],"credits":["cure53"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-20T13:38:19.088Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-71396","url":"https://www.cve.org/CVERecord?id=CVE-2025-71396","licence":"CVE Terms of Use","modified":"2026-10-29T21:15:22.783Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3824-qmfq-2qv7","url":"https://github.com/advisories/GHSA-3824-qmfq-2qv7","licence":"CC-BY-4.0","modified":"2026-07-19T03:56:47.420Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-71396","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71396","licence":"Public domain","modified":"2026-10-29T21:17:06.320Z"}],"updatedAt":"2026-11-25T22:59:12.405Z","epss":{"score":0.00409,"percentile":0.37257,"date":"2026-12-01T12:00:22.000Z"}}