Advisory

GHSA-jhg6-6qrx-38mr

Also known as: CVE-2024-46989, GO-2024-3131

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2024-09-18 17:42 UTC
Modified
2024-11-18 16:27 UTC

Affected packages and fixes

github.com/authzed/spicedb

Go · All systems

Affected

  • introduced 0, fixed 1.35.3 (semver)

Fixed versions

1.35.3

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences