Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-46569

CVE-2025-46569: Open Policy Agent (OPA) DoS Vulnerability

CVE-2025-46569 is a denial of service vulnerability in Open Policy Agent (OPA) that allows attackers to inject Rego code through crafted HTTP requests. This article covers technical details, affected versions, and mitigation.

Updated:

CVE-2025-46569 Overview

Open Policy Agent (OPA) is an open source, general-purpose policy engine widely used for policy enforcement in cloud-native environments. A critical code injection vulnerability exists in OPA versions prior to 1.4.0 that allows attackers to inject arbitrary Rego code through specially crafted HTTP request paths to the Data API. When OPA runs as a server, it exposes an HTTP Data API for reading and writing documents. Requesting a virtual document through this API triggers policy evaluation, where a Rego query is constructed from the requested path. This query construction process is vulnerable to injection attacks, enabling malicious actors to manipulate policy evaluation results, conduct oracle attacks, or cause Denial of Service conditions through computationally expensive injected code.

Critical Impact

Attackers can inject Rego code to manipulate policy decisions, potentially bypassing security controls, or cause service disruption through resource exhaustion attacks.

Affected Products

  • Open Policy Agent (OPA) versions prior to 1.4.0
  • OPA deployments running in server mode with exposed HTTP Data API
  • Systems relying on OPA for policy enforcement decisions

Discovery Timeline

  • May 1, 2025 - CVE-2025-46569 published to NVD
  • May 2, 2025 - Last updated in NVD database

Technical Details for CVE-2025-46569

Vulnerability Analysis

This vulnerability is classified as CWE-94 (Improper Control of Generation of Code - Code Injection). The core issue lies in how OPA constructs Rego queries from user-controlled HTTP request paths. When a client requests a virtual document through the Data API, OPA builds a query containing a single data document reference derived directly from the requested path. The insufficient sanitization of this path allows attackers to inject arbitrary Rego code into the query construction process.

While the evaluation result cannot directly return data beyond what the requested path would generate, attackers can manipulate the execution flow in several ways. The injected code can redirect queries to unintended paths, craft conditions that force queries to succeed or fail regardless of actual policy state, or introduce computationally expensive operations that exhaust server resources.

Root Cause

The root cause stems from improper input validation in the HTTP Data API path handling. The application fails to adequately sanitize or validate the HTTP request path before using it to construct Rego queries. This allows special characters and Rego syntax to be interpreted as code rather than data, enabling injection attacks.

Attack Vector

The attack vector is network-based, requiring the attacker to send specially crafted HTTP requests to the OPA server's Data API endpoint. An attacker can construct a malicious URL path that, when processed by OPA, injects Rego code into the policy evaluation query.

The exploitation process involves:

  1. Identifying an OPA server with an exposed Data API endpoint
  2. Crafting an HTTP request path containing Rego code injection payload
  3. Sending the request to the target server's Data API
  4. The injected code executes during policy evaluation, enabling oracle attacks where the attacker can infer information based on success/failure responses, or triggering DoS through expensive computations

For detailed technical information on the vulnerability mechanism and patch, refer to the GitHub Security Advisory.

Detection Methods for CVE-2025-46569

Indicators of Compromise

  • Unusual or malformed HTTP request paths to OPA Data API endpoints containing special characters or Rego syntax
  • Unexpected spikes in OPA server CPU or memory usage indicating potential DoS attempts
  • Anomalous policy evaluation results or unexpected authorization decisions
  • HTTP requests with unusually long or complex paths targeting /v1/data/ endpoints

Detection Strategies

  • Implement web application firewall rules to detect and block requests with Rego syntax in URL paths
  • Monitor OPA server logs for malformed or suspicious Data API requests
  • Deploy network intrusion detection systems with signatures for code injection patterns in HTTP paths
  • Enable detailed audit logging on OPA servers to track all policy evaluation requests

Monitoring Recommendations

  • Monitor OPA server performance metrics for sudden resource consumption spikes
  • Set up alerts for unusual patterns in policy decision outcomes
  • Track and analyze all HTTP requests to OPA Data API endpoints for anomalous paths
  • Implement rate limiting on Data API endpoints to mitigate potential DoS attacks

How to Mitigate CVE-2025-46569

Immediate Actions Required

  • Upgrade Open Policy Agent to version 1.4.0 or later immediately
  • Restrict network access to OPA's RESTful APIs to localhost and trusted networks only
  • Implement network segmentation to isolate OPA servers from untrusted networks
  • Review recent policy evaluation logs for signs of exploitation attempts

Patch Information

The vulnerability has been addressed in OPA version 1.4.0. The fix is available through the official GitHub commit. Organizations should upgrade to this version or later to remediate the vulnerability. For complete details on the security fix, consult the GitHub Security Advisory.

Workarounds

  • Limit network access to OPA's RESTful APIs to localhost only unless required for production
  • Deploy OPA behind a reverse proxy with strict input validation and path sanitization
  • Implement network-level access controls to restrict which hosts can communicate with OPA servers
  • Use a web application firewall to filter malicious request patterns before they reach OPA
bash
# Example: Restrict OPA to localhost binding
opa run --server --addr localhost:8181

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.