GHSA-jhg6-6qrx-38mr

Suggest an improvement
Source
https://github.com/advisories/GHSA-jhg6-6qrx-38mr
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-jhg6-6qrx-38mr/GHSA-jhg6-6qrx-38mr.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-jhg6-6qrx-38mr
Aliases
Published
2024-09-18T17:42:46Z
Modified
2024-09-25T18:12:11.982435Z
Severity
  • 3.7 (Low) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N CVSS Calculator
  • 6.3 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
SpiceDB having multiple caveats on resources of the same type may improperly result in no permission
Details

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

References

Affected packages

Go / github.com/authzed/spicedb

Package

Name
github.com/authzed/spicedb
View open source insights on deps.dev
Purl
pkg:golang/github.com/authzed/spicedb

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.35.3