/

CVE-2026-25499

Severity:

HIGH RISK

(7.5)

Path Traversal / Insecure Authorization Configuration

CVE-2026-25499

Analyzed

Vulnerability type

Category:

Path Traversal / Insecure Authorization Configuration

CWE:

CWE-22, CWE-1188

Impact:

Privilege Escalation and Arbitrary File Modification

Severity:

HIGH RISK

(7.5)

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

The Proxmox Virtual Environment provider for Terraform/OpenTofu documented an insecure sudoers configuration that permits path traversal using ../, allowing edits to arbitrary files on the host system.

When operators copy this sudoers line into production environments, a user with SSH access and sudo rights under this rule could escape the intended directory restriction and modify any file, leading to system compromise.

Affected context

This issue affects environments where the Proxmox Terraform/OpenTofu provider's SSH configuration documentation is followed verbatim to create sudoers rules.

It is most relevant when:

  • A restricted sudoers entry is intended to limit file editing to a specific directory
  • Users are granted passwordless or semi-trusted sudo access based on the documented line
  • The command path is not properly constrained, allowing directory traversal via ../

The risk materializes only where these documentation-based sudo rules are applied on actual systems.

Exploit preconditions

  • Attack surface: SSH access to the host or management node where the insecure sudoers rule is installed.
  • Required access: Valid user account with sudo rights governed by the documented sudoers line (often intended as limited privilege).
  • Trigger point: Execution of the sudo-allowed command while specifying a path containing ../ segments.
  • Why exploitation is possible: The sudoers rule trusts user-supplied paths without constraining them to a fixed, canonical directory, enabling path traversal beyond the intended folder.

Why this happens

The root cause lies in an insecure sudoers configuration pattern presented in the provider documentation.

The documented rule attempts to grant narrowly scoped sudo rights for file editing within a specific directory, but it fails to:

  • Canonicalize or restrict the target path
  • Prevent directory traversal (../) in user-supplied arguments

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), because user-controlled paths are not constrained to the intended directory.

It also reflects CWE-1188: Insecure Default Initialization of Resource, as guidance effectively promotes an unsafe default configuration that can be widely replicated across deployments.

Potential impact

  • Arbitrary modification of system files beyond the intended directory
  • Escalation of privileges by altering configuration files (e.g., sudoers, service definitions, SSH configs)
  • Introduction of persistent backdoors via modified startup scripts or authorized_keys files
  • Disruption of service availability through corruption or deletion of critical configuration files
  • Facilitation of further lateral movement within the infrastructure

General mitigation guidance

Mitigation should focus on designing strict, argument-safe sudoers rules and minimizing the trust placed in user-controlled paths:

  • Constrain sudoers rules to specific, fully qualified commands without free-form path arguments where possible.
  • Use command whitelisting or wrapper scripts that internally validate and sanitize paths before file operations.
  • Apply directory traversal protections by rejecting or normalizing ../ sequences and enforcing that operations remain inside a known, canonical directory.
  • Prefer least-privilege patterns where automation components run under dedicated, minimally privileged accounts.
  • Regularly review documentation-derived configuration snippets before deploying them into production, treating them as untrusted until vetted.

How teams detect issues like this

Detection typically involves reviewing configuration and access control policies rather than application code:

  • Configuration review: Search sudoers files (including /etc/sudoers.d/) for rules that allow editors or shell commands with arbitrary path arguments, especially where directory restrictions are implied but not enforced.
  • Policy-based scanning: Use configuration management or compliance tooling to flag sudo rules that include wildcards or unbounded arguments in file paths.
  • Log analysis: Monitor sudo logs for commands that include ../ in paths, which may indicate attempted or successful directory traversal.
  • Security audits: Incorporate infrastructure-as-code and documentation-based configuration into security reviews, ensuring that sample snippets follow secure-by-default principles.

Automated policy-as-code tools can help codify and enforce safe sudoers patterns across environments.

Sources

SourceLink
github.comgithub.com/bpg/terraform-provider-proxmox/commit/bd604c41a31e2a55dd6acc01b0608be3ea49c023
github.comgithub.com/bpg/terraform-provider-proxmox/security/advisories/GHSA-gwch-7m8v-7544

Frequently asked

questions

It can be, but only indirectly. An attacker must first obtain SSH access to a system where the insecure sudoers configuration has been applied and then leverage the path traversal capability to modify files outside the intended directory.

The attacker needs a valid user account on the affected host and sudo privileges through the specific rule derived from the documentation. Without that sudo access, the path traversal in the sudoers rule cannot be leveraged.

Replace any documentation-derived sudoers entries with rules that strictly constrain commands and paths. Prefer fixed commands or wrapper scripts that internally validate targets, and avoid granting sudo rights that accept arbitrary path arguments.

Treat documentation and example configurations as code that must undergo security review, apply least-privilege principles to all sudoers rules, and enforce configuration policies that disallow unbounded arguments and path traversal in privileged commands.

Find out what's already
exploitable in your codebase.