/

CVE-2026-41433

Severity:

HIGH RISK

(8.4)

Path Traversal and Insecure File Handling in OpenTelemetry

CVE-2026-41433

Analyzed

Vulnerability type

Category:

Path Traversal and Insecure File Handling

CWE:

CWE-22, CWE-59

Impact:

Arbitrary File Overwrite with Potential Privilege Escalation

Severity:

HIGH RISK

(8.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenTelemetry eBPF Instrumentation's Java agent injection path from versions 0.4.0 to before 0.8.0 allows a local attacker who controls a Java workload to overwrite arbitrary files on the host when injection is enabled and the injector runs with elevated privileges.

By trusting the target process's TMPDIR and using unsafe file creation semantics, the injector can be tricked into escaping intended filesystem boundaries and following symlinks, resulting in host file clobbering.

Affected context

This vulnerability arises in environments where OpenTelemetry eBPF Instrumentation is used to inject a Java agent into monitored Java workloads, and the injector component executes with higher privileges than the target application (for example, with root or host-level access).

It is particularly relevant when:

  • Java injection is explicitly enabled for workloads
  • The injector relies on environment variables (like TMPDIR) from the target process
  • Temporary or staging files are created on shared or host-mounted filesystems

In these conditions, a compromised or malicious Java workload can influence the injector's filesystem behavior beyond its intended scope.

Exploit preconditions

  • Attack surface: Local, via a Java workload being instrumented by the OpenTelemetry eBPF Java injector.
  • Required access: Ability to run or control code in a Java process targeted for injection (e.g., compromised application, malicious container, or untrusted tenant workload).
  • Configuration requirements:
  • Java agent injection enabled in OpenTelemetry eBPF Instrumentation
  • Injector running with elevated or host-level privileges relative to the Java workload
  • Trigger point: The moment the injector prepares or writes files based on paths derived from TMPDIR or related environment state of the target process.
  • Why exploitation is possible:
  • The injector trusts TMPDIR and related path information from the target Java process.
  • File creation uses unsafe semantics, allowing:
  • Escape from intended directories (CWE-22: Path Traversal)
  • Use of symlinks or pre-created paths to redirect writes to arbitrary host files (CWE-59: Improper Link Resolution)
  • No robust checks enforce that the final resolved path remains within a safe, controlled directory.

Why this happens

The core issue is insecure file handling combined with trust in untrusted environment-controlled paths.

The Java injector reads TMPDIR (and potentially similar environment hints) from the target Java process and uses it directly to construct file paths for agent-related artifacts. It then creates or writes to these files without:

  • Constraining them to a dedicated, trusted directory
  • Ensuring that path resolution does not escape intended boundaries
  • Protecting against symlink and hard-link attacks

This maps primarily to:

  • CWE-59: Improper Link Resolution Before File Access ('Link Following'), as symlinks created by the attacker can redirect injector writes to arbitrary locations.
  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), since attacker-controlled paths can lead the injector outside its expected temporary directory.

Abstractly, this represents an insecure pattern where privileged components rely on untrusted path input for file creation and do not enforce strict directory or link resolution guarantees.

Potential impact

  • Overwrite of arbitrary files on the host filesystem, subject to injector privileges
  • Clobbering of configuration files, service scripts, or binaries, possibly leading to code execution on the host
  • Denial of service by corrupting critical system or application files
  • Escalation from a compromised Java workload to broader node or host compromise
  • Tampering with logs, telemetry, or security controls residing on the host

General mitigation guidance

Mitigation focuses on hardening file handling and isolating trust boundaries between monitored workloads and privileged instrumentation components.

Common defensive patterns include:

  • Do not trust environment-derived paths from untrusted workloads:
  • Ignore TMPDIR and similar variables from the target process.
  • Use injector-side, fixed, and well-defined directories for all temporary and agent-related files.
  • Enforce safe directory constraints:
  • Normalize and validate paths before use, ensuring they remain within a dedicated, restricted directory.
  • Reject or sanitize any path that attempts to traverse up the directory tree or resolve outside the allowed root.
  • Harden file creation semantics:
  • Use file APIs that prevent following symlinks where possible.
  • Open files with flags that fail if the target already exists, preventing clobbering of existing files.
  • Avoid honoring user-controlled symlinks, hard links, or bind mounts for privileged writes.
  • Apply least-privilege principles:
  • Run injector components with the minimum filesystem permissions needed.
  • Segment host filesystem access so that even if paths are misused, only a constrained area is writable.
  • Operational defenses:
  • Separate tenants and untrusted workloads into environments where they cannot influence privileged instrumentation.
  • Document and review injection enablement policies, especially in multi-tenant or shared-node contexts.

How teams detect issues like this

Effective detection combines code-level analysis with configuration and runtime monitoring.

Potential strategies include:

  • Static analysis and code review:
  • Flag any use of environment variables (e.g., TMPDIR, TEMP) from untrusted processes to construct privileged file paths.
  • Identify file operations performed by privileged components that:
  • Write into directories shared with untrusted workloads
  • Do not use safe file creation flags
  • Fail to check for symlinks or validate the resolved path location
  • Review injection or instrumentation code for assumptions about "safe" temporary directories on shared hosts.
  • Security testing and hardening checks:
  • Include tests that simulate symlink and path traversal scenarios against instrumentation components.
  • Use threat modeling to identify where privileged agents interact with untrusted workloads and their filesystems.
  • Policy and CI/CD enforcement:
  • Enforce coding standards requiring use of secure temp directory APIs and safe file-opening patterns.
  • Integrate automated analysis tools that highlight CWE-22 and CWE-59 patterns in instrumentation and agent code.
  • Runtime monitoring:
  • Observe privileged processes for unexpected writes to sensitive system paths originating from injection operations.
  • Alert on abnormal file access patterns, such as agents writing into configuration directories unrelated to their core function.

Sources

SourceLink
github.comgithub.com/open-telemetry/opentelemetry-ebpf-instrumentation/releases/tag/v0.8.0
github.comgithub.com/open-telemetry/opentelemetry-ebpf-instrumentation/security/advisories/GHSA-8gmg-3w2q-65f4

Frequently asked

questions

It is primarily a local privilege escalation issue. An attacker must control or compromise a Java workload that is being instrumented. Remote exploitation is possible only if an attacker can remotely gain control of such a workload and the injector runs with higher privileges on the host.

The attacker needs the ability to run or control code in a Java process that is targeted by the OpenTelemetry eBPF Java injector. They do not need direct host access, but they benefit if the injector has elevated filesystem permissions compared to the workload.

The safest pattern is to decouple privileged file operations from untrusted workload state:

  • Use fixed, trusted directories determined by the injector, not by the target process.
  • Enforce strict path validation and safe file creation semantics that avoid symlink following and prevent overwriting existing files.
  • Reduce injector privileges so that even if file paths are misused, the damage is limited.

Prevention relies on secure design for instrumentation and privileged agents:

  • Treat all input from workloads—environment variables, paths, configuration—as untrusted, even when running on the same node.
  • Establish and enforce secure file-handling guidelines focusing on temp files, symlinks, and directory traversal.
  • Embed checks for CWE-22 and CWE-59 patterns into code review and automated scanning.
  • Regularly threat-model privileged observability components, since they bridge untrusted workloads and the host.
Find out what's already
exploitable in your codebase.