CVE-2026-137570

Description

A flaw was found in Open Policy Agent. When the persistence directory setting is unset, the service uses a fixed and predictable temporary directory path. A local attacker can exploit this vulnerability by pre-creating symbolic links in the shared temporary directory, causing the application to overwrite arbitrary files with its own permissions.

Statement

Red Hat rates this vulnerability as Moderate because exploitation requires local access to the host or container filesystem where Open Policy Agent executes, and it depends on omitting an explicit bundle persistence path. Although a local attacker sharing the temporary directory could overwrite files writable by the OPA process via pre-created symbolic links, the issue does not allow arbitrary code execution directly or compromise file confidentiality. Furthermore, in standard enterprise and containerized environments, untrusted local users generally do not have write access to shared temporary locations within the OPA execution context.

Mitigation

Define an explicit, dedicated persistence directory for bundle storage or isolate the temporary directory environment:

1. Configure an explicit bundle persistence directory:
Create a dedicated storage directory with restricted permissions accessible only by the user running Open Policy Agent:

mkdir -p /var/lib/opa/bundle-persistence
chmod 0700 /var/lib/opa/bundle-persistence
chown <opa-user>:<opa-group> /var/lib/opa/bundle-persistence
In the OPA configuration file, specify `persistence_directory: /var/lib/opa/bundle-persistence` within the relevant bundle configuration blocks.

2. Isolate temporary files using systemd:
If running OPA as a systemd service, configure temporary directory isolation by adding `PrivateTmp=yes` under the `[Service]` section of the unit file or drop-in configuration.

Warning: Modifying systemd service definitions or OPA configuration files requires restarting the OPA daemon (`systemctl daemon-reload && systemctl restart opa`), which will temporarily disrupt active policy evaluation requests. Ensure the designated directory has sufficient storage space and proper ownership, or bundle initialization will fail.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

The following CVSS metrics and score provided are preliminary and subject to review.

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score6.3N/A6.3
Attack VectorLocalN/ALocal
Attack ComplexityHighN/AHigh
Privileges RequiredLowN/ALow
User InteractionNoneN/ANone
ScopeUnchangedN/AUnchanged
ConfidentialityNoneN/ANone
Integrity ImpactHighN/AHigh
Availability ImpactHighN/AHigh

Vector

Red Hat: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H

cve.org: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H

Understanding the Weakness (CWE)

Confidentiality,Integrity,Access Control

Technical Impact: Read Files or Directories; Modify Files or Directories; Bypass Protection Mechanism

An attacker may be able to traverse the file system to unintended locations and read or overwrite the contents of unexpected files. If the files are used for a security mechanism then an attacker may be able to bypass the mechanism.

Other

Technical Impact: Execute Unauthorized Code or Commands

Windows simple shortcuts, sometimes referred to as soft links, can be exploited remotely since a ".LNK" file can be uploaded like a normal file. This can enable remote execution.

Frequently Asked Questions

Want to get errata notifications? Sign up here.