Read the docs
TI-2022-16508 Aliases CVE-2022-36085GHSA-f524-rf33-2jjr

OPA Compiler: Bypass of WithUnsafeBuiltins using `with` keyword to mock functions

Priority HIGH 76CWE-20Published · Updated

Key facts

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

Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-693.

Summary

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.01628 76th percentileScored 2026-11-07
Public exploit Yes 3 exploit referencesTagged by NVD
Fix Fixed opa (open-policy-agent): 0.43.1github.com/open-policy-agent/opa (Go): 0.43.1

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Total

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.40.0 to before 0.43.10.43.1Patch availableCNA
—github.com/open-policy-agent/opa (Go)0.40.0 to before 0.43.10.43.1Patch availableGHSA-f524-rf33-2jjr
  • opa Vendoropen-policy-agent Affected 0.40.0 to before 0.43.1 Fixed in 0.43.1 Patch available CNA
  • github.com/open-policy-agent/opa (Go) Vendor— Affected 0.40.0 to before 0.43.1 Fixed in 0.43.1 Patch available GHSA-f524-rf33-2jjr

CPE configurations NVD · 1

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

Remediation

  • Fix · CNA opa (open-policy-agent) Fixed in 0.43.1
  • Fix · GHSA-f524-rf33-2jjr github.com/open-policy-agent/opa (Go) Fixed in 0.43.1 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Important. Red Hat's page for this CVE →

Not affected: 6 products
  • Logging Subsystem for Red Hat OpenShift
  • OpenShift Serverless
  • OpenShift Service Mesh 2.0
  • Red Hat Advanced Cluster Management for Kubernetes 2
  • Red Hat Advanced Cluster Security 3
  • Red Hat OpenShift Container Platform 4

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-36085
  2. 2026-10-03 Alias added: GHSA-f524-rf33-2jjr

References

  • TI-2022-07681 Array literal misordering in github.com/open-policy-agent/opa CVSS 3.1MEDIUM 6.3
  • 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