CVE-2024-46989: Github.com/authzed/spicedb Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-jhg6-6qrx-38mr
CVSS 3.7
CWE-269 CWE-285
Published
Advisory Summary

CVE-2024-46989 is a MODERATE (CVSS 3.7) remote code execution vulnerability (CWE-269: Improper Privilege Management) affecting Github.com/authzed/spicedb libraries in the Go ecosystem. The issue involves spicedb having multiple caveats on resources of the same type may improperly result in no permission. Remediation is available by upgrading affected packages to version 1.35.3.

CVE-2024-46989 at a Glance

CVE Identifier CVE-2024-46989
GHSA Identifier GHSA-jhg6-6qrx-38mr
Severity MODERATE
CVSS v3.1 Base Score 3.7
CWE Classification CWE-269: Improper Privilege Management
Affected Product Github.com/authzed/spicedb
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-46989

To remediate this vulnerability, upgrade all affected Github.com/authzed/spicedb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/authzed/spicedb fixed: 1.35.3
Upgrade github.com/authzed/spicedb to 1.35.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/authzed/spicedb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-46989, inspect your project dependencies for Github.com/authzed/spicedb:

inspect dependencies for github.com/authzed/spicedb

Analyze the terminal output to locate any version of Github.com/authzed/spicedb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.35.3), 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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Github.com/authzed/spicedb, 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

## Background Multiple caveats over the same indirect subject type on the same relation can result in no permission being returned when permission is expected For example, given this schema: ``` definition user {} caveat somecaveat(somefield int) { somefield == 42 } definition group { relation member: user } definition resource { relation viewer: group#member with somecaveat permission view = folder->view } ``` If the resource has multiple groups, and each group is caveated, it is possible for the returned permission to be "no permission" when permission is expected. ## Impact Permission is returned as NO_PERMISSION when PERMISSION is expected on the CheckPermission API. ## Workarounds Do not use caveats or do not use caveats on an indirect subject type with multiple entries

CVE-2024-46989 Affected Github.com/authzed/spicedb Versions

1 component(s)
Fixed Versions:
1.35.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/authzed/spicedb
Go
< 1.35.3
1.35.3

References

Frequently Asked Questions

What is CVE-2024-46989?
CVE-2024-46989 is a security vulnerability in Github.com/authzed/spicedb involving SpiceDB having multiple caveats on resources of the same type may improperly result in no permission under CWE-269: Improper Privilege Management.
Which Github.com/authzed/spicedb versions are affected?
Affected versions include releases prior to 1.35.3 across affected packages: github.com/authzed/spicedb.
What version fixes CVE-2024-46989?
Upgrading to 1.35.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/authzed/spicedb affected?
Yes, github.com/authzed/spicedb is affected in releases prior to 1.35.3. Upgrade your dependency to 1.35.3 or later.
What is the CVSS score of CVE-2024-46989?
CVE-2024-46989 has a CVSS v3.1 base score of 3.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-46989?
CVE-2024-46989 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check Go dependencies for CVE-2024-46989?
Run the dependency tree command: 'inspect dependencies for github.com/authzed/spicedb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jhg6-6qrx-38mr",
  "modified" : "2024-11-18T16:27:14Z",
  "published" : "2024-09-18T17:42:46Z",
  "aliases" : [ "CVE-2024-46989" ],
  "summary" : "SpiceDB having multiple caveats on resources of the same type may improperly result in no permission",
  "details" : "## Background\n\nMultiple caveats over the same indirect subject type on the same relation can result in no permission being returned when permission is expected\n\nFor example, given this schema:\n\n```\ndefinition user {}\n\ncaveat somecaveat(somefield int) {\n  somefield == 42\n}\n\ndefinition group {\n  relation member: user\n}\n\ndefinition resource {\n  relation viewer: group#member with somecaveat\n  permission view = folder->view\n}\n```\n\nIf the resource has multiple groups, and each group is caveated, it is possible for the returned permission to be \"no permission\" when permission is expected.\n\n## Impact\nPermission is returned as NO_PERMISSION when PERMISSION is expected on the CheckPermission API.\n\n## Workarounds\nDo not use caveats or do not use caveats on an indirect subject type with multiple entries",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/authzed/spicedb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.35.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/security/advisories/GHSA-jhg6-6qrx-38mr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-46989"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/commit/20855de75812bcbc975efebe7f76abf47c0f3edb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/commit/d4ef8e1dbce1eafaf25847f4c0f09738820f5bf2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/authzed/spicedb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269", "CWE-285" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-18T17:42:46Z",
    "nvd_published_at" : "2024-09-18T18:15:07Z"
  }
}