/

CVE-2026-55773

Severity:

HIGH RISK

(8.8)

Policy Expression Injection (CWE-94) in CedarJava

CVE-2026-55773

Deferred

Vulnerability type

Category:

Code Injection / Expression Injection

CWE:

CWE-94

Impact:

Authorization Policy Manipulation and Bypass

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Improper handling of special characters in CedarJava's toCedarExpr() method can enable injection of arbitrary Cedar policy expressions when policy text is built from user input at runtime.

If integrators concatenate unescaped, user-controlled values into Cedar source, an attacker may alter authorization logic, turning permits unconditional or disabling forbids under specific conditions.

Affected context

This vulnerability appears in applications that:

  • Use CedarJava for fine-grained authorization decisions, and
  • Dynamically construct Cedar policy text at runtime, and
  • Call toCedarExpr() on Cedar Value types with user-controlled data, and
  • Insert the resulting strings directly into permit/forbid clauses or other Cedar expressions.

It does not affect deployments that treat policies as static, pre-authored artifacts or that safely escape and validate interpolated values before using toCedarExpr().

Exploit preconditions

  • Attack surface: Application endpoints, configuration interfaces, or APIs that accept policy-related or attribute values from users.
  • Required access: Ability to influence the values passed into toCedarExpr() (e.g., through request parameters, form fields, tenant configuration, or delegated admin tools).
  • Trigger point: Runtime construction of Cedar policy source by concatenating toCedarExpr() output into policy text, followed by evaluation by CedarJava.
  • Why exploitation is possible: The toCedarExpr() method does not escape special characters such as " or \, nor does it constrain operators (e.g., ||, &&). When treated as literal Cedar source, attacker-controlled content can break out of the intended value context and inject additional logical expressions into authorization rules.

Why this happens

The underlying issue is a classic expression/code injection pattern mapped to CWE-94: Improper Control of Generation of Code ('Code Injection').

CedarJava's toCedarExpr() API produces raw Cedar source text representing values without escaping or quoting special characters. When integrators treat this output as safe and embed it directly into policy strings derived from user input, they unintentionally merge data and code domains. Attacker-controlled values can thus introduce new operators or expressions into permit and forbid clauses, modifying the behavior of authorization checks rather than simply providing data. The absence of output escaping, context-aware encoding, or strict separation between data values and policy code enables this injection vector.

Potential impact

  • An attacker may cause a permit clause to become effectively unconditional (e.g., injecting || true).
  • An attacker could disable or weaken forbid clauses by inserting expressions like && false so they never trigger.
  • Authorization checks can be bypassed, granting access to resources, operations, or data that should remain restricted.
  • Policy behavior may diverge from the integrator's intent, eroding trust in authorization decisions and compliance controls.
  • Multi-tenant or delegated administration environments could see lateral abuse where one tenant modifies shared policy logic if inputs are insufficiently isolated.

General mitigation guidance

Effective mitigation focuses on enforcing a strict separation between user-controlled data and Cedar policy code.

Recommended defensive patterns include:

  • Treat toCedarExpr() output as potentially unsafe when derived from untrusted input and avoid using it to construct policy source strings directly.
  • Use structured policy construction mechanisms that operate on typed values or abstract syntax trees rather than string concatenation.
  • Apply robust, context-aware escaping or encoding to special characters before interpolating values into Cedar source, ensuring injected operators cannot alter policy logic.
  • Restrict who can supply or modify values involved in policy generation, favoring configuration-time controls over runtime user input.
  • Design policies such that user-provided attributes are always treated as data fields evaluated by the engine, not as part of the policy's logical expression.

How teams detect issues like this

To detect and monitor for this vulnerability pattern, organizations can:

  • Review code for dynamic policy generation that uses string concatenation, templates, or builders with toCedarExpr() applied to user-controlled values.
  • Employ static analysis rules that flag calls to toCedarExpr() where arguments originate from HTTP request parameters, form inputs, configuration APIs, or other untrusted sources.
  • Introduce secure coding guidelines and PR checks that prohibit constructing Cedar policies via raw strings; instead mandate structured policy APIs or vetted templating schemes with strict escaping.
  • Instrument logging around policy compilation and evaluation to identify unusual expressions, including injected operators (||, &&) or always-true/always-false conditions.
  • Leverage automated code review tools to enforce policies about separating authorization logic from user inputs and highlight violations early in the development process.

Sources

SourceLink
github.comgithub.com/cedar-policy/cedar-java/security/advisories/GHSA-qmch-v2q9-wg4p

Frequently asked

questions

Exploitability depends on how the consuming application uses CedarJava. It is most dangerous in systems that dynamically build Cedar policy text from user-supplied values using toCedarExpr() without escaping or validation. If policies are static or user input never participates in policy source generation, the practical exposure is limited.

An attacker needs the ability to control data that flows into toCedarExpr() and is subsequently incorporated into policy source—for example, through configuration fields, request parameters, or administrative interfaces that influence authorization rules. Direct code execution is not required, but control over policy-related inputs is.

The safest pattern is to stop constructing Cedar policy source via string concatenation of toCedarExpr() output derived from user input. Instead, use structured policy-building APIs or treat policies as static artifacts, and ensure that any user-provided values are passed to the engine as typed data or attributes, never as raw Cedar expressions.

Adopt a design where authorization logic is defined by developers or trusted administrators using controlled mechanisms, and user input is always treated as data evaluated by the policy engine. Enforce context-aware escaping for any values interpolated into policy-like templates, avoid mixing code and data in strings, and integrate static analysis and code review checks that specifically look for dynamic policy generation from untrusted input.

Find out what's already
exploitable in your codebase.