Skip to main content
Public proof of conceptFix available

CVE-2022-23628

A public proof of concept exists; no exploitation attested.

  • Published2022-02-09
  • Fixed in0.37.2
  • WeaknessCWE-682

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

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.

Timeline

dates in UTC
  1. 2022-02-0922:15CVE publishedNVD

Versions per branch

OSV · NVD
open-policy-agent/opa
BranchAffectedFixed in
0.x≥ 0.33.1, < 0.37.20.37.2
Openpolicyagent open policy agent
BranchAffectedFixed in
0.x≥ 0.33.1, < 0.37.00.37.0

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • open-policy-agent opa
    Affected
    • = >= 0.33.1, < 0.37.0no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE terms of useCVE recordupdated 2022-02-09

Fix

  1. Update open-policy-agent/opa to 0.37.2

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

  • CISA-ADPSSVC decisionpoc2025-04-22
  • CNACVSS 3.16.3known since 2026-10-23
  • NVDCVSS 3.15.3read 2026-10-23
  • NVDCVSS 2.04.3read 2026-10-23
  • CNAweakness (CWE)CWE-682known since 2026-10-23
  • FIRST EPSSEPSS score1.1 %2026-12-03
  • OSVaffected packages—
  • GitHub AdvisoriesadvisoryModerate2022-02-09

Identifiers

Technical details

CVSS v3 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Published
2022-02-09
Last modified
2026-06-17
NVD status
Modified
GitHub advisory
GHSA-hcw3-j74m-qc58

Frequently asked questions

What is CVE-2022-23628?

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.

Is CVE-2022-23628 actively exploited?

A proof-of-concept exploit exists for CVE-2022-23628, but active exploitation has not been confirmed at this time.

What is the CVSS score for CVE-2022-23628?

CVE-2022-23628 has a CVSS v3 base score of 5.3 (Medium severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.

Running open-policy-agent/opa? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website checks · 250 API requests/month

Sources for this record