cve.bz

CVE-2022-36085 openpolicyagent open policy agent: Protection Mechanism Failure

9.8 criticalExploit referenceEPSS 1.6%Fix available

Critical (9.8) in openpolicyagent open policy agent. EPSS 1.6% estimated probability of exploitation activity in the next 30 days. Fixed in github.com/open-policy-agent/opa 0.43.1, 0.44.0.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
1.6% (unchanged from 1.6% a week ago; 1.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 77th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2025-04-22. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-20 Improper Input Validation
CWE-693 Protection Mechanism Failure
OWASP Top 10
A05:2025 Injection, A06:2025 Insecure Design
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-36085 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-36085?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-36085?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-36085 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
openpolicyagent:open_policy_agentfrom 0.40.0 before 0.43.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-f524-rf33-2jjrGogithub.com/open-policy-agent/opa>=0.40.0 <0.43.10.43.1
GO-2022-0978Gogithub.com/open-policy-agent/opa>=0.40.0 <0.44.00.44.0

Red Hat

Red Hat rates this Important.

ProductPackageStateAdvisory
Logging Subsystem for Red Hat OpenShiftopenshift-logging/lokistack-gateway-rhel8Not affected
Logging Subsystem for Red Hat OpenShiftopenshift-logging/opa-openshift-rhel8Not affected
OpenShift Serverlessopenshift-serverless-1/client-kn-rhel8Not affected
OpenShift Service Mesh 2.0servicemeshNot affected
Red Hat Advanced Cluster Management for Kubernetes 2rhacm2/gatekeeper-rhel8Not affected
Red Hat Advanced Cluster Security 3advanced-cluster-security/rhacs-main-rhel8Not affected
Red Hat Advanced Cluster Security 3advanced-cluster-security/rhacs-scanner-db-rhel8Not affected
Red Hat Advanced Cluster Security 3advanced-cluster-security/rhacs-scanner-db-slim-rhel8Not affected
Red Hat Advanced Cluster Security 3advanced-cluster-security/rhacs-scanner-rhel8Not affected
Red Hat Advanced Cluster Security 3advanced-cluster-security/rhacs-scanner-slim-rhel8Not affected
Red Hat OpenShift Container Platform 4openshift4/cnf-tests-rhel8Not affected
Red Hat OpenShift Container Platform 4openshift4/ztp-site-generate-rhel8Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-36085.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-693 (17), CWE-20 (51).

References

Check your stackJSON