CVE-2022-21646: Github.com/authzed/spicedb Lookup Operations Do Not Take Vulnerability
HIGHCVE-2022-21646 is a HIGH (CVSS 8.1) lookup operations do not take vulnerability (CWE-20: Improper Input Validation) affecting Github.com/authzed/spicedb libraries in the Go ecosystem. The issue involves lookup operations do not take into account wildcards in spicedb. Remediation is available by upgrading affected packages to version 1.4.0.
CVE-2022-21646 at a Glance
Security Impact
CVSS: 8.1
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:H/I:H/A:N).
How to Fix CVE-2022-21646
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.
Upgrade github.com/authzed/spicedb to 1.4.0
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-2022-21646, 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.4.0), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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
CVE-2022-21646 Affected Github.com/authzed/spicedb Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/authzed/spicedb
|
Go |
≥ 1.3.0
< 1.4.0
All 1 versions
1.3.0
|
1.4.0
|
References
Frequently Asked Questions
What is CVE-2022-21646?
Which Github.com/authzed/spicedb versions are affected?
What version fixes CVE-2022-21646?
Is github.com/authzed/spicedb affected?
What is the CVSS score of CVE-2022-21646?
What CWE is associated with CVE-2022-21646?
How can I check Go dependencies for CVE-2022-21646?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7p8f-8hjm-wm92",
"modified" : "2022-01-13T15:02:31Z",
"published" : "2022-01-13T15:05:41Z",
"aliases" : [ "CVE-2022-21646" ],
"summary" : "Lookup operations do not take into account wildcards in SpiceDB",
"details" : "### Impact\nAny user making use of a wildcard relationship under the right hand branch of an `exclusion` or within an `intersection` operation will see `Lookup`/`LookupResources` return a resource as \"accessible\" if it is *not* accessible by virtue of the inclusion of the wildcard in the intersection or the right side of the exclusion.\n\nFor example, given schema:\n\n```zed\ndefinition user {}\n\ndefinition resource {\n relation viewer: user\n relation banned: user | user:*\n permission view = viewer - banned\n}\n```\n\nIf `user:*` is placed into the `banned` relation for a particular resource, `view` should return false for *all* resources. in `v1.3.0`, the wildcard is ignored entirely in lookup's dispatch, resulting in the `banned` wildcard being ignored in the exclusion.\n\n### Workarounds\nDon't make use of wildcards on the right side of intersections or within exclusions. \n\n### References\nhttps://github.com/authzed/spicedb/issues/358\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:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/authzed/spicedb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.3.0"
}, {
"fixed" : "1.4.0"
} ]
} ],
"versions" : [ "1.3.0" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/authzed/spicedb/security/advisories/GHSA-7p8f-8hjm-wm92"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21646"
}, {
"type" : "WEB",
"url" : "https://github.com/authzed/spicedb/issues/358"
}, {
"type" : "WEB",
"url" : "https://github.com/authzed/spicedb/commit/15bba2e2d2a4bda336a37a7fe8ef8a35028cd970"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/authzed/spicedb"
}, {
"type" : "WEB",
"url" : "https://github.com/authzed/spicedb/releases/tag/v1.4.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-155", "CWE-20" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-11T21:06:45Z",
"nvd_published_at" : "2022-01-11T22:15:00Z"
}
}