CVE-2024-38361: Github.com/authzed/spicedb SpiceDB Exclusions Can Result Vulnerability

MODERATE
Advisory Identifier: GHSA-grjv-gjgr-66g2
CVSS 3.7
CWE-281
Published
Advisory Summary

CVE-2024-38361 is a MODERATE (CVSS 3.7) spicedb exclusions can result vulnerability (CWE-281: Improper Preservation of Permissions) affecting Github.com/authzed/spicedb libraries in the Go ecosystem. The issue involves spicedb exclusions can result in no permission returned when permission expected. Remediation is available by upgrading affected packages to version 1.33.1.

CVE-2024-38361 at a Glance

CVE Identifier CVE-2024-38361
GHSA Identifier GHSA-grjv-gjgr-66g2
Severity MODERATE
CVSS v3.1 Base Score 3.7
CWE Classification CWE-281: Improper Preservation of Permissions
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-38361

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.33.1
Upgrade github.com/authzed/spicedb to 1.33.1
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-38361, 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.33.1), 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-281: Improper Preservation of Permissions, where the product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended. 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 Use of an exclusion under an arrow that has multiple resources may resolve to `NO_PERMISSION` when permission is expected. For example, given this schema: ```zed definition user {} definition folder { relation member: user relation banned: user permission view = member - banned } definition resource { relation folder: folder permission view = folder->view } ``` If the resource exists under *multiple* folders and the user has access to view more than a single folder, SpiceDB may report the user does not have access due to a failure in the exclusion dispatcher to request that *all* the folders in which the user is a member be returned ### Impact Permission is returned as `NO_PERMISSION` when `PERMISSION` is expected on the `CheckPermission` API. ### Workarounds None

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

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

References

Frequently Asked Questions

What is CVE-2024-38361?
CVE-2024-38361 is a security vulnerability in Github.com/authzed/spicedb involving SpiceDB exclusions can result in no permission returned when permission expected under CWE-281: Improper Preservation of Permissions.
Which Github.com/authzed/spicedb versions are affected?
Affected versions include releases prior to 1.33.1 across affected packages: github.com/authzed/spicedb.
What version fixes CVE-2024-38361?
Upgrading to 1.33.1 (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.33.1. Upgrade your dependency to 1.33.1 or later.
What is the CVSS score of CVE-2024-38361?
CVE-2024-38361 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-38361?
CVE-2024-38361 is classified under CWE-281: Improper Preservation of Permissions (The product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.).
How can I check Go dependencies for CVE-2024-38361?
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-grjv-gjgr-66g2",
  "modified" : "2024-11-18T16:26:46Z",
  "published" : "2024-06-20T16:24:01Z",
  "aliases" : [ "CVE-2024-38361" ],
  "summary" : "SpiceDB exclusions can result in no permission returned when permission expected",
  "details" : "### Background\n\nUse of an exclusion under an arrow that has multiple resources may resolve to `NO_PERMISSION` when permission is expected.\n\nFor example, given this schema:\n\n```zed\ndefinition user {}\n\ndefinition folder {\n  relation member: user\n  relation banned: user\n  permission view = member - banned\n}\n\ndefinition resource {\n  relation folder: folder\n  permission view = folder->view\n}\n```\n\nIf the resource exists under *multiple* folders and the user has access to view more than a single folder, SpiceDB may report the user does not have access due to a failure in the exclusion dispatcher to request that *all* the folders in which the user is a member be returned\n\n### Impact\n\nPermission is returned as `NO_PERMISSION` when `PERMISSION` is expected on the `CheckPermission` API.\n\n### Workarounds\n\nNone\n",
  "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:H/AT:N/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.33.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/security/advisories/GHSA-grjv-gjgr-66g2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38361"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/commit/ecef31d2b266fde17eb2c3415e2ec4ceff96fbeb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/authzed/spicedb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-281" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-20T16:24:01Z",
    "nvd_published_at" : "2024-06-20T23:15:52Z"
  }
}