CVE-2022-36085Openpolicyagent Open Policy Agent
Critical 9.8 No auth needed
Follow: this CVE · Openpolicyagent · Openpolicyagent Open Policy Agent We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 1.6% probability of exploitation in 30 days · percentile 76
- Auth required
- No
- Published
- Sep 8, 2022
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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.
What to do
- Apply the vendor's security update for Open Policy Agent.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Go | github.com/open-policy-agent/opa |
≥ 0.40.0 < 0.43.1 |
0.43.1 |
go get github.com/open-policy-agent/opa@v0.43.1 |
| Go | github.com/open-policy-agent/opa |
≥ 0.40.0 < 0.44.0 |
0.44.0 |
go get github.com/open-policy-agent/opa@v0.44.0 |
Per OSV / GitHub Advisories (GHSA-f524-rf33-2jjr, GO-2022-0978). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| openpolicyagent | open_policy_agent | ≥ 0.40.0 < 0.43.1 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch Third Party Advisory
- github.com Patch Third Party Advisory
- github.com Exploit Patch Third Party Advisory
- github.com Exploit Patch Third Party Advisory
- github.com Third Party Advisory
- github.com Exploit Patch Third Party Advisory