Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/open-policy-agent/opa/server
  4. ›
  5. CVE-2025-46569

CVE-2025-46569: OPA server Data API HTTP path injection of Rego

May 1, 2025 (updated May 5, 2025)

When run as a server, OPA exposes an HTTP Data API for reading and writing documents. Requesting a virtual document through the Data API entails policy evaluation, where a Rego query containing a single data document reference is constructed from the requested path. This query is then used for policy evaluation.

A HTTP request path can be crafted in a way that injects Rego code into the constructed query. The evaluation result cannot be made to return any other data than what is generated by the requested path, but this path can be misdirected, and the injected Rego code can be crafted to make the query succeed or fail; opening up for oracle attacks or, given the right circumstances, erroneous policy decision results. Furthermore, the injected code can be crafted to be computationally expensive, resulting in a Denial Of Service (DoS) attack.

Users are only impacted if all of the following apply:

  • OPA is deployed as a standalone server (rather than being used as a Go library)
  • The OPA server is exposed outside of the local host in an untrusted environment.
  • The configured authorization policy does not do exact matching of the input.path attribute when deciding if the request should be allowed.

or, if all of the following apply:

  • OPA is deployed as a standalone server.
  • The service connecting to OPA allows 3rd parties to insert unsanitised text into the path of the HTTP request to OPA’s Data API.

Note: With no Authorization Policy configured for restricting API access (the default configuration), the RESTful Data API provides access for managing Rego policies; and the RESTful Query API facilitates advanced queries. Full access to these APIs provides both simpler, and broader access than what the security issue describes here can facilitate. As such, OPA servers exposed to a network are not considered affected by the attack described here if they are knowingly not restricting access through an Authorization Policy.

References

  • github.com/advisories/GHSA-6m8w-jc87-6cr7
  • github.com/open-policy-agent/opa
  • github.com/open-policy-agent/opa/commit/ad2063247a14711882f18c387a511fc8094aa79c
  • github.com/open-policy-agent/opa/security/advisories/GHSA-6m8w-jc87-6cr7
  • nvd.nist.gov/vuln/detail/CVE-2025-46569
  • pkg.go.dev/vuln/GO-2025-3660

Code Behaviors & Features

Detect and mitigate CVE-2025-46569 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.4.0

Fixed versions

  • 1.4.0

Solution

Upgrade to version 1.4.0 or above.

Weakness

  • CWE-770: Allocation of Resources Without Limits or Throttling
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

go/github.com/open-policy-agent/opa/server/CVE-2025-46569.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 13 May 2025 12:16:03 +0000.