GHSA-qjrv-v6qp-x99x: Surrealdb SurrealDB Has An Uncaught Exception Vulnerability
HIGHGHSA-qjrv-v6qp-x99x is a HIGH (CVSS 6.5) surrealdb has an uncaught exception vulnerability (CWE-248: Uncaught Exception) affecting Surrealdb libraries in the crates.io ecosystem. The issue involves surrealdb has an uncaught exception handling parsing errors on empty strings. Remediation is available by upgrading affected packages to version 2.0.4.
GHSA-qjrv-v6qp-x99x at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix GHSA-qjrv-v6qp-x99x
To remediate this vulnerability, upgrade all affected Surrealdb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade surrealdb to 2.0.4
Upgrade surrealdb-core to 2.0.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for surrealdb
How to Check if You Are Affected
To determine whether your application is affected by GHSA-qjrv-v6qp-x99x, inspect your project dependencies for Surrealdb:
inspect dependencies for surrealdb
Analyze the terminal output to locate any version of Surrealdb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Surrealdb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-qjrv-v6qp-x99x Affected Surrealdb Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
surrealdb
|
crates.io |
≥ 2.0.0
< 2.0.4
|
2.0.4
|
|
surrealdb-core
|
crates.io |
≥ 2.0.0
< 2.0.4
|
2.0.4
|
References
Frequently Asked Questions
What is GHSA-qjrv-v6qp-x99x?
Which Surrealdb versions are affected?
What version fixes GHSA-qjrv-v6qp-x99x?
Is surrealdb affected?
Is surrealdb-core affected?
What is the CVSS score of GHSA-qjrv-v6qp-x99x?
What CWE is associated with GHSA-qjrv-v6qp-x99x?
How can I check crates.io dependencies for GHSA-qjrv-v6qp-x99x?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qjrv-v6qp-x99x",
"modified" : "2024-10-08T22:20:02Z",
"published" : "2024-10-08T22:20:02Z",
"aliases" : [ ],
"summary" : "SurrealDB has an Uncaught Exception Handling Parsing Errors on Empty Strings",
"details" : "The error rendering code from the parser would panic when handling failed parsing of queries where the error occurred when converting an empty string to a SurrealDB value. This would be the case when casting an empty string to a `record`, `duration` or `datetime`, as well as potentially when parsing an empty string to JSON or providing an empty string to the `type::field` and `type::fields` functions.\n\n### Impact\n\nA client that is authorized to run queries in a SurrealDB server would be able to execute a malformed query which would fail to parse when converting an empty string and cause a panic in the error rendering code. This would crash the server, leading to denial of service.\n\n### Patches\n\n- Version 2.0.4 and later are not affected by this issue.\n\n### Workarounds\n\nAffected users who are unable to update may want to limit the ability of untrusted clients to run arbitrary SurrealQL queries in the affected versions of SurrealDB. To limit the impact of the denial of service, SurrealDB administrators may also want to ensure that the SurrealDB process is running so that it can be automatically re-started after a crash.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/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.0.0"
}, {
"fixed" : "2.0.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "surrealdb-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/security/advisories/GHSA-qjrv-v6qp-x99x"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/pull/4923"
}, {
"type" : "WEB",
"url" : "https://github.com/surrealdb/surrealdb/commit/709d6efe901dbf3e207b4fc2ebc30775595efc16"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/surrealdb/surrealdb"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-248" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-10-08T22:20:02Z",
"nvd_published_at" : null
}
}