Home / open-policy-agent / opa / CVE-2022-36085
CVE-2022-36085: is it exploited, and which versions of open-policy-agent opa are affected and fixed?
CVE-2022-36085 is a protection mechanism failure vulnerability in open-policy-agent opa. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 10:08 UTC). Affected: github.com/open-policy-agent/opa from 0.40.0 before 0.43.1 (GitHub advisory GHSA-f524-rf33-2jjr). Fixed in 0.43.1 (GitHub advisory GHSA-f524-rf33-2jjr). Severity: High (7.4, CVSS 3.1, from GitHub_M).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 10:08 UTC, CVE record November 19, 2026, 07:14 UTC and NVD November 19, 2026, 07:45 UTC.
What is CVE-2022-36085?
OPA Compiler: Bypass of WithUnsafeBuiltins using `with` keyword to mock functions
Open Policy Agent (OPA) is an open source, general-purpose policy engine. The Rego compiler provides a (deprecated) `WithUnsafeBuiltins` function, which allows users to provide a set of built-in functions that should be deemed unsafe — and as such rejected — by the compiler if encountered in the policy compilation stage. A bypass of this protection has been found, where the use of the `with` keyword to mock such a built-in function (a feature introduced in OPA v0.40.0), isn’t taken into account by `WithUnsafeBuiltins`. Multiple conditions need to be met in order to create an adverse effect. Version 0.43.1 contains a patch for this issue. As a workaround, avoid using the `WithUnsafeBuiltins` function and use the `capabilities` feature instead.
From the CVE record by GitHub_M, last updated April 22, 2025, 17:23 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| open-policy-agent | opa | >= 0.40.0, < 0.43.1 |
As the CVE record by GitHub_M states it, last updated April 22, 2025. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| Go | github.com/open-policy-agent/opa | >= 0.40.0, < 0.43.1 | 0.43.1 | GHSA-f524-rf33-2jjr |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated January 23, 2024. Summary: OPA Compiler: Bypass of WithUnsafeBuiltins using "with" keyword to mock functions.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| openpolicyagent | open policy agent | from 0.40.0 before 0.43.1 | application |
NVD analysis (status Modified), last modified June 17, 2026, 04:52 UTC.
How severe is CVE-2022-36085?
| Score | Version | Vector | Source |
|---|---|---|---|
| High 7.4 | CVSS 3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N | GitHub_M |
| Critical 9.8 | CVSS 3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2022-36085 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: poc; automatable: no; technical impact: total (CISA ADP, April 22, 2025)
- EPSS
- 1.68% probability of exploitation activity in the next 30 days, percentile 77.6 (FIRST EPSS, scores of December 2, 2026)
What kind of flaw is it?
Where are the vendor advisories and references?
- https://github.com/open-policy-agent/opa/security/advisories/GHSA-f524-rf33-2jjr x_refsource_CONFIRM
- https://github.com/open-policy-agent/opa/pull/4540 x_refsource_MISC
- https://github.com/open-policy-agent/opa/pull/4616 x_refsource_MISC
- https://github.com/open-policy-agent/opa/commit/25a597bc3f4985162e7f65f9c36599f4f8f55823 x_refsource_MISC
- https://github.com/open-policy-agent/opa/commit/3e8c754ed007b22393cf65e48751ad9f6457fee8 x_refsource_MISC
- https://github.com/open-policy-agent/opa/releases/tag/v0.43.1 x_refsource_MISC
When was it published, and where is the official record?
- Reserved
- July 15, 2022
- Published
- September 8, 2022, 13:30 UTC
- CVE record updated
- April 22, 2025, 17:23 UTC by GitHub_M
- NVD
- Modified, last modified June 17, 2026, 04:52 UTC
- Last checked
- CVE list November 19, 2026, 07:14 UTC; NVD November 19, 2026, 07:45 UTC; KEV December 3, 2026, 10:08 UTC; EPSS December 2, 2026
- Official record
- cve.org · NVD
What other CVEs affect opa?
- Nov 26, 2026CVE-2026-137570 open-policy-agent opa: insecure temporary file
- May 1, 2025CVE-2025-46569 open-policy-agent opa: incorrect authorization
- Feb 9, 2022CVE-2022-23628 open-policy-agent opa: incorrect calculation
Questions about CVE-2022-36085
Is CVE-2022-36085 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 10:08 UTC. FIRST's EPSS gives it a 1.68% chance of exploitation activity in the next 30 days (scores of December 2, 2026).
Which versions of open-policy-agent opa are affected by CVE-2022-36085?
github.com/open-policy-agent/opa from 0.40.0 before 0.43.1, per the GitHub advisory GHSA-f524-rf33-2jjr. The tables above give every range the sources list.
Which version fixes CVE-2022-36085?
0.43.1, per the GitHub advisory GHSA-f524-rf33-2jjr. Check the vendor's advisory before you rely on it.
How severe is CVE-2022-36085?
High (7.4, CVSS 3.1, from GitHub_M). The severity table above shows each score with its source.
Where is the official record of CVE-2022-36085?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.