CVE-2023-35930: Github.com/authzed/spicedb Remote Code Execution Vulnerability

LOW
Advisory Identifier: GHSA-m54h-5x5f-5m6r
CVSS 3.7
CWE-913
Published
Advisory Summary

CVE-2023-35930 is a LOW (CVSS 3.7) remote code execution vulnerability (CWE-913: Improper Control of Dynamically-Managed Code Resources) affecting Github.com/authzed/spicedb libraries in the Go ecosystem. The issue involves spicedb's lookupresources may return partial results. Remediation is available by upgrading affected packages to version 1.22.2.

CVE-2023-35930 at a Glance

CVE Identifier CVE-2023-35930
GHSA Identifier GHSA-m54h-5x5f-5m6r
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-913: Improper Control of Dynamically-Managed Code Resources
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-2023-35930

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.22.2
Upgrade github.com/authzed/spicedb to 1.22.2
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-2023-35930, 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.22.2), 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-913: Improper Control of Dynamically-Managed Code Resources, where the product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. 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

### Impact Any user making a negative authorization decision based on the results of a LookupResources request with 1.22.0 is affected. For example, using `LookupResources` to find a list of resources to allow access to be okay: some subjects that should have access to a resource may not. But if using `LookupResources` to find a list of banned resources instead, then some users that shouldn't have access may. Generally, `LookupResources` is not and should not be used to gate access in this way - that's what the `Check` API is for. Additionally, version 1.22.0 has included a warning about this bug since its initial release. ### Workarounds Avoid using `LookupResources` for negative authorization decisions if using `1.22.0`. ### Patches The only affected release is [v1.22.0](https://github.com/authzed/spicedb/releases/tag/v1.22.0), and it is patched in [v1.22.2](https://github.com/authzed/spicedb/releases/tag/v1.22.2) (there is no v1.22.1 release, though there is a git tag). ### References - https://github.com/authzed/spicedb/pull/1397 ### For more information If you have any questions or comments about this advisory: * Open an issue in [SpiceDB](https://github.com/authzed/spicedb) * Ask a question in the [SpiceDB Discord](https://authzed.com/discord)

CVE-2023-35930 Affected Github.com/authzed/spicedb Versions

1 component(s)
Fixed Versions:
1.22.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/authzed/spicedb
Go
≥ 1.22.0
< 1.22.2
All 1 versions
1.22.0
1.22.2

References

Frequently Asked Questions

What is CVE-2023-35930?
CVE-2023-35930 is a security vulnerability in Github.com/authzed/spicedb involving SpiceDB's LookupResources may return partial results under CWE-913: Improper Control of Dynamically-Managed Code Resources.
Which Github.com/authzed/spicedb versions are affected?
Affected versions include releases prior to 1.22.2 across affected packages: github.com/authzed/spicedb.
What version fixes CVE-2023-35930?
Upgrading to 1.22.2 (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.22.2. Upgrade your dependency to 1.22.2 or later.
What is the CVSS score of CVE-2023-35930?
CVE-2023-35930 has a CVSS v3.1 base score of 3.7 (LOW) 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-2023-35930?
CVE-2023-35930 is classified under CWE-913: Improper Control of Dynamically-Managed Code Resources (The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.).
How can I check Go dependencies for CVE-2023-35930?
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-m54h-5x5f-5m6r",
  "modified" : "2023-06-30T20:25:41Z",
  "published" : "2023-06-28T22:48:50Z",
  "aliases" : [ "CVE-2023-35930" ],
  "summary" : "SpiceDB's LookupResources may return partial results",
  "details" : "### Impact\nAny user making a negative authorization decision based on the results of a LookupResources request with 1.22.0 is affected.\n\nFor example, using `LookupResources` to find a list of resources to allow access to be okay: some subjects that should have access to a resource may not. But if using `LookupResources` to find a list of banned resources instead, then some users that shouldn't have access may.\n\nGenerally, `LookupResources` is not and should not be used to gate access in this way - that's what the `Check` API is for. Additionally, version 1.22.0 has included a warning about this bug since its initial release.\n\n### Workarounds\nAvoid using `LookupResources` for negative authorization decisions if using `1.22.0`. \n\n### Patches\nThe only affected release is [v1.22.0](https://github.com/authzed/spicedb/releases/tag/v1.22.0), and it is patched in [v1.22.2](https://github.com/authzed/spicedb/releases/tag/v1.22.2) (there is no v1.22.1 release, though there is a git tag).\n\n### References\n- https://github.com/authzed/spicedb/pull/1397\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [SpiceDB](https://github.com/authzed/spicedb)\n* Ask a question in the [SpiceDB Discord](https://authzed.com/discord)\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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/authzed/spicedb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.22.0"
      }, {
        "fixed" : "1.22.2"
      } ]
    } ],
    "versions" : [ "1.22.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/security/advisories/GHSA-m54h-5x5f-5m6r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-35930"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/pull/1397"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/authzed/spicedb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/authzed/spicedb/releases/tag/v1.22.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-913" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-28T22:48:50Z",
    "nvd_published_at" : "2023-06-26T20:15:10Z"
  }
}