Skip to content

in_cidr caveat does not match IPv4-mapped IPv6 addresses

Low
miparnisari published GHSA-5784-6qcr-48fq Aug 6, 2026

Package

docker authzed/spicedb (Docker)

Affected versions

<= v1.54.0

Patched versions

>=v1.56.0
gomod github.com/authzed/spicedb (Go)
<= v1.54.0
>=v1.56.0

Description

Impact

Customers that have a schema with a caveat using the in_cidr function, such as the following

caveat is_valid_ip(user_ip ipaddress, cidr string) {
    user_ip.in_cidr(cidr)
  }

can get different results for two textual forms of the same IPv4 host. An allow-list (permit when in_cidr is true) fails closed for a mapped address; a deny-style check (negating in_cidr, or granting extra access for internal ranges) fails open.

In other words, the following .zed file fails the second assertion:

---
schema: |+
  definition user {}

  caveat is_valid_ip(user_ip ipaddress, cidr string) {
    user_ip.in_cidr(cidr)
  }

  definition document {
  	relation viewer: user with is_valid_ip
    permission view = viewer
  }

relationships: >-
  document:firstdoc#viewer@user:alice[is_valid_ip:{"cidr":"10.0.0.0/8"}]
assertions:
  assertTrue:
    - 'document:firstdoc#view@user:alice with {"user_ip": "10.1.2.3"}'
    - 'document:firstdoc#view@user:alice with {"user_ip": "::ffff:a01:203"}'

Patches

v1.54.1

Workarounds

Do not use the in_cidr caveat function.

Severity

Low

CVE ID

No known CVE

Weaknesses

Incorrect Comparison

The product compares two entities in a security-relevant context, but the comparison is incorrect, which may lead to resultant weaknesses. Learn more on MITRE.

Credits