{"answers":{"affected":"2 open source packages ship an affected version, including surrealdb.","exploited":"There is no known exploitation of GHSA-6vg3-hgrw-p5gf in the wild and no public exploit code.","fix":"Upgrade surrealdb to 3.1.0 or later.","what":"GHSA-6vg3-hgrw-p5gf is an authentication bypass vulnerability in surrealdb, published on 1 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-6vg3-hgrw-p5gf and fix it if it is affected.\n\nWhat it is: GHSA-6vg3-hgrw-p5gf is an authentication bypass vulnerability in surrealdb, published on 1 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-6vg3-hgrw-p5gf in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- surrealdb (crates.io): affected all versions; fixed in 3.1.0\n- surrealdb (crates.io): affected all versions; fixed in 3.1.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-6vg3-hgrw-p5gf/ (Markdown: https://insights.sbomify.com/GHSA-6vg3-hgrw-p5gf/index.md)","id":"GHSA-6vg3-hgrw-p5gf","markdown":"https://insights.sbomify.com/GHSA-6vg3-hgrw-p5gf/index.md","name":"GHSA-6vg3-hgrw-p5gf","record":{"aliases":[],"analysis":{"component_type":"database","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"SurrealDB database","requires_auth":"low_privilege","summary":"Authenticated users can bypass tenant isolation permissions and violate unique constraints by spoofing composite record ID fields in SurrealDB.","user_interaction":"not_required","vuln_class":"auth_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"An authenticated user could bypass permission rules that gated access on parts of a record's id — most commonly tenant-isolation rules of the form `PERMISSIONS FOR select WHERE id.tenant = $auth.id.tenant`. The same defect also let UNIQUE constraints defined on parts of an id admit duplicate entries.\n\nWhen a query referenced part of a composite record id (`id.tenant`, `id.uid`, …), SurrealDB read the value from the record's editable body fields instead of from the immutable id key. Because the body is editable but the id is fixed at creation, an attacker with write access could set the body field to any value and have permission checks read that spoofed value.\n\n### Impact\n\nWhat an attacker **can** do:\n\n- Read records hidden by permission rules of the form `id.\u003cfield\u003e = $auth.\u003c...\u003e` (typically tenant- or scope-isolation boundaries) by writing the same-named field on a record they control to the spoofed value.\n- Cause UNIQUE constraints defined on `id.\u003cfield\u003e` to silently admit duplicate entries, leaving the database with rows that violate the constraint.\n\nWhat it **can't** do:\n\n- Cross namespace or database isolation boundaries.\n-Bypass field-level `PERMISSIONS FOR` update clauses that don't reference `id.\u003cfield\u003e` paths.\n- Affect availability or crash the server.\n\n### Patches\n\nThe value-path resolver now special-cases `Part::Field` and `Part::Value` against `RecordIdKey::Object`, reading the named component directly from the id key without ever entering `select_document`. The Array-keyed special case (`id[0]`, `id[1]`, …) is unchanged.\n\n- Versions 3.1.0 and later are not affected.\n\n### Workarounds\n\nUsers unable to patch are advised to consider the following workarounds:\n- Avoid permission expressions that read `id.\u003cfield\u003e` on Object-keyed record ids; gate on the full record id (`id = $auth.id`) or on a server-derived session value instead.\n- Avoid UNIQUE indexes on `id.\u003cfield\u003e` until 3.1.0; use `DEFINE INDEX ... ON FIELDS id UNIQUE` (the full id) where possible.","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"SurrealDB has an Authorization Bypass via Composite Record-id Paths","id":"GHSA-6vg3-hgrw-p5gf","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"auth_bypass","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["3.1.0"],"introduced":["0"],"last_affected":[],"package":"surrealdb","purl":null,"source":"GHSA-6vg3-hgrw-p5gf"},{"ecosystem":"crates.io","fixed":["3.1.0"],"introduced":["0"],"last_affected":[],"package":"surrealdb","purl":"pkg:cargo/surrealdb","source":"GHSA-6vg3-hgrw-p5gf"}],"products":null,"published":"2026-07-01","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Authenticated users can bypass tenant isolation permissions and violate unique constraints by spoofing composite record ID fields in SurrealDB.","url":"https://insights.sbomify.com/GHSA-6vg3-hgrw-p5gf/"}