Cedar JSON policy templates accept invalid slot identifiers
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
The cedar-policy crate from 4.0.0 before 4.11.1 and from 3.0.0 before 3.4.3, and @cedar-policy/cedar-wasm from 4.0.1 before 4.11.1 and from 3.2.0 before 3.4.3, accept JSON-format policy templates with malformed is in scope conditions that use the wrong slot identifier. Cedar silently corrects the identifier (CWE-20). Linking such a template fails or panics when it has one slot, and when it has slots in both scopes, each slot is bound to the value meant for the other, so authorization decisions can wrongly allow or deny access.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
Description from the GitHub advisory
Cedar users must be using all of the following features to be affected by this advisory: JSON format policies, policy templates, and the `is in` scope condition. This advisory only affects JSON-formatted Cedar policy templates containing `is in` scope conditions that are **malformed** according to the Cedar syntax. It does **not** affect syntactically well-formed policies. Users of Cedar who author policies in the JSON format were able to write Cedar policies using the `is in` condition with an incorrect slot identifier in the principal and resource scope constraints (e.g., `?principal` in the resource scope constraint) even though this is not allowed when parsing policies from the Cedar policy syntax. Internally, the slot identifiers were silently corrected (e.g. `?resource` is placed in the resource scope constraint). If the policy contains *exactly one slot* in either the principal or resource position, then any attempt to create a linked policy from the template results in an error: the internal representation of the template does not contain the slot identifier as written in the malformed JSON policy (it has been corrected silently), so attempting to fill that slot is an error. If instead the template is linked using slot identifier expected internally (i.e., not what is written in the JSON template), the linking will initially succeed, but a subsequent invariant violation will cause a panic. When the template contains *slots in both the principal and resource* position, then both slots will be present in the internal representation: linking succeeds, but with each slot bound to the value intended for the other (the silent correction). The linked policy is then semantically different from the malformed policy the user intended, and any subsequent authorization decision made against that policy may lead to accesses being unintentionally allowed or denied. Concretely, consider the following JSON format policy template intended to deny users in a particular project from accessing documents with a particular classification. ``` { "effect": "forbid", "principal": { "op": "is", "entity_type": "User", "in": { "slot": "?resource" } }, "action": { "op": "All" }, "resource": { "op": "is", "entity_type": "Doc", "in": { "slot": "?principal" } }, "conditions": [] } ``` Linked with `?principal = Classification::"topsecret"` and `?resource = Project::"alpha"`, the author expects to create the policy: ``` forbid(principal is User in Project::"alpha", action, resource is Doc in Classification::"topsecret"); ``` But because Cedar internally links slots by scope position (not by name), the actual policy evaluated by the engine is: ``` forbid(principal is User in Classification::"topsecret", action, resource is Doc in Project::"alpha"); ``` If a user is in `Project::"alpha"` but not `Classification::"topsecret"`, the `forbid` policy does not apply, and access is unintentionally allowed. ## Patches This advisory is patched in version 4.11.1 and 3.4.3, both available on Crates.io and NPM. ## Workarounds If you cannot update to a patched version, you can determine if you are affected by checking your JSON format policy templates for the following two patterns. ``` "principal": { "op": "is", "entity_type": "User", "in": { "slot": "?resource" } } ``` and ``` "resource": { "op": "is", "entity_type": "Doc", "in": { "slot": "?principal" } } ``` ## References * [Cedar Policy Language Reference Guide - Cedar Policy Templates](https://docs.cedarpolicy.com/policies/templates.html) * [Cedar Policy Language Reference Guide - JSON Policy Format](https://docs.cedarpolicy.com/policies/json-format.html)
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | cedar-policy (crates.io) | 4.0.0 to before 4.11.1 | 4.11.1 | Patch available | GHSA-c33x-vcv4-vg3g |
| — | cedar-policy (crates.io) | 3.0.0 to before 3.4.3 | 3.4.3 | Patch available | GHSA-c33x-vcv4-vg3g |
| — | @cedar-policy/cedar-wasm (npm) | 4.0.1 to before 4.11.1 | 4.11.1 | Patch available | GHSA-c33x-vcv4-vg3g |
| — | @cedar-policy/cedar-wasm (npm) | 3.2.0 to before 3.4.3 | 3.4.3 | Patch available | GHSA-c33x-vcv4-vg3g |
- cedar-policy (crates.io) Vendor— Affected 4.0.0 to before 4.11.1 Fixed in 4.11.1 Patch available GHSA-c33x-vcv4-vg3g
- cedar-policy (crates.io) Vendor— Affected 3.0.0 to before 3.4.3 Fixed in 3.4.3 Patch available GHSA-c33x-vcv4-vg3g
- @cedar-policy/cedar-wasm (npm) Vendor— Affected 4.0.1 to before 4.11.1 Fixed in 4.11.1 Patch available GHSA-c33x-vcv4-vg3g
- @cedar-policy/cedar-wasm (npm) Vendor— Affected 3.2.0 to before 3.4.3 Fixed in 3.4.3 Patch available GHSA-c33x-vcv4-vg3g
Remediation
Upgrade cedar-policy to 4.11.1 or 3.4.3, and @cedar-policy/cedar-wasm to 4.11.1 or 3.4.3, matching the release line in use.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
- Fix · GHSA-c33x-vcv4-vg3g cedar-policy (crates.io) Fixed in 4.11.1 Advisory →
- Fix · GHSA-c33x-vcv4-vg3g cedar-policy (crates.io) Fixed in 3.4.3 Advisory →
- Fix · GHSA-c33x-vcv4-vg3g @cedar-policy/cedar-wasm (npm) Fixed in 4.11.1 Advisory →
- Fix · GHSA-c33x-vcv4-vg3g @cedar-policy/cedar-wasm (npm) Fixed in 3.4.3 Advisory →
Timeline
- 2026-10-29 Threatist record created from GHSA-c33x-vcv4-vg3g
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences