{"cve":"CVE-2022-36085","nvd":{"published":"2022-09-08T14:15:08.340","modified":"2026-06-17T04:52:53.230","status":"Modified","description":"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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8},"cwes":["CWE-20","CWE-693"],"references":["https://github.com/open-policy-agent/opa/commit/25a597bc3f4985162e7f65f9c36599f4f8f55823","https://github.com/open-policy-agent/opa/commit/3e8c754ed007b22393cf65e48751ad9f6457fee8","https://github.com/open-policy-agent/opa/pull/4540","https://github.com/open-policy-agent/opa/pull/4616","https://github.com/open-policy-agent/opa/releases/tag/v0.43.1"],"products":["openpolicyagent:open_policy_agent"],"source":"nvd","synced_at":"2026-10-19T21:35:14.992143698+00:00"},"epss":{"cve":"CVE-2022-36085","score":0.01593,"percentile":0.75705,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-f524-rf33-2jjr","url":"https://osv.dev/vulnerability/GHSA-f524-rf33-2jjr","summary":"OPA Compiler: Bypass of WithUnsafeBuiltins using \"with\" keyword to mock functions","modified":"2024-01-23T20:38:00Z","packages":[{"ecosystem":"Go","name":"github.com/open-policy-agent/opa","purl":"pkg:golang/github.com/open-policy-agent/opa","ranges":[">=0.40.0 <0.43.1"],"fixed":["0.43.1"]}]},{"id":"GO-2022-0978","url":"https://osv.dev/vulnerability/GO-2022-0978","summary":"Protection bypass in github.com/open-policy-agent/opa","modified":"2024-05-20T16:03:47Z","packages":[{"ecosystem":"Go","name":"github.com/open-policy-agent/opa","purl":"pkg:golang/github.com/open-policy-agent/opa","ranges":[">=0.40.0 <0.44.0"],"fixed":["0.44.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}