Read the docs
TI-2022-07681 Aliases CVE-2022-23628GHSA-hcw3-j74m-qc58

Array literal misordering in github.com/open-policy-agent/opa

Priority MEDIUM 61CWE-682Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
Low · Low · Low
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.

Summary

OPA is an open source, general-purpose policy engine. Under certain conditions, pretty-printing an abstract syntax tree (AST) that contains synthetic nodes could change the logic of some statements by reordering array literals. Example of policies impacted are those that parse and compare web paths. **All of these** three conditions have to be met to create an adverse effect: 1. An AST of Rego had to be **created programmatically** such that it ends up containing terms without a location (such as wildcard variables). 2. The AST had to be **pretty-printed** using the `github.com/open-policy-agent/opa/format` package. 3. The result of the pretty-printing had to be **parsed and evaluated again** via an OPA instance using the bundles, or the Golang packages. If any of these three conditions are not met, you are not affected. Notably, all three would be true if using **optimized bundles**, i.e. bundles created with `opa build -O=1` or higher. In that case, the optimizer would fulfil condition (1.), the result of that would be pretty-printed when writing the bundle to disk, fulfilling (2.). When the bundle was then used, we'd satisfy (3.). As a workaround users may disable optimization when creating bundles.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.01026 63rd percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Fixed opa (open-policy-agent): 0.37.0github.com/open-policy-agent/opa (Go): 0.37.2

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
open-policy-agentopa0.33.1 to before 0.37.00.37.0Patch availableCNA
—github.com/open-policy-agent/opa (Go)0.33.1 to before 0.37.20.37.2Patch availableGHSA-hcw3-j74m-qc58
  • opa Vendoropen-policy-agent Affected 0.33.1 to before 0.37.0 Fixed in 0.37.0 Patch available CNA
  • github.com/open-policy-agent/opa (Go) Vendor— Affected 0.33.1 to before 0.37.2 Fixed in 0.37.2 Patch available GHSA-hcw3-j74m-qc58

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:openpolicyagent:open_policy_agent:*:*:*:*:*:*:*:*0.33.1 to before 0.37.0Vulnerableopen-policy-agent
  • cpe:2.3:a:openpolicyagent:open_policy_agent:*:*:*:*:*:*:*:* Versions 0.33.1 to before 0.37.0 Vulnerable ·open-policy-agent

Remediation

  • Fix · CNA opa (open-policy-agent) Fixed in 0.37.0
  • Fix · GHSA-hcw3-j74m-qc58 github.com/open-policy-agent/opa (Go) Fixed in 0.37.2 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-23628
  2. 2026-10-03 Alias added: GHSA-hcw3-j74m-qc58

References

  • TI-2022-16508 OPA Compiler: Bypass of WithUnsafeBuiltins using `with` keyword to mock functions CVSS 3.1CRITICAL 9.8
  • TI-2022-14552 An issue in the AST parser (ast/compile.go) of Open Policy Agent v0.10.2 allows attackers… CVSS 3.1HIGH 7.5
  • TI-2022-11544 An issue in the component ast/parser.go of Open Policy Agent v0.39.0 causes the… CVSS 3.1HIGH 7.5
  • TI-2024-07657 OPA SMB Force-Authentication CVSS 3.1HIGH 7.3

Sources