/

CVE-2026-72841

Severity:

CRITICAL RISK

(9.9)

Path Traversal (CWE-73) in luci-app-openvpn Upload

CVE-2026-72841

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Arbitrary File Write and Persistent Root Code Execution

Severity:

CRITICAL RISK

(9.9)

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

A path traversal vulnerability in luci-app-openvpn allows authenticated users to bypass the intended upload directory through insufficient validation of the instance_name2 parameter. An attacker may write arbitrary files to accessible system locations, potentially enabling persistent root code execution when malicious files are processed during reboot.

Affected context

The issue occurs in luci-app-openvpn file-upload functionality when the instance_name2 parameter influences the destination path without adequately restricting it to the intended directory. Exploitation depends on an authenticated account being able to reach the upload endpoint and the target system allowing the written file to affect startup, authentication, or another privileged execution path.

Exploit preconditions

  • Attack surface: Authenticated web-based file-upload functionality in luci-app-openvpn
  • Required access: Valid credentials with permission to access the affected upload operation
  • Trigger point: Processing of an upload request containing a path-manipulating instance_name2 value
  • Why exploitation is possible: The destination path is not sufficiently constrained, allowing uploaded content to be written outside the designated directory
  • Additional condition for persistence: A writable system location must be linked to a privileged startup, authentication, or reboot-time processing path

Why this happens

The vulnerability results from treating a user-controlled filename or instance identifier as a trusted filesystem path. When path components are not canonicalized and constrained to an approved directory, an attacker can influence path resolution and escape the intended upload location. This behavior maps to CWE-73: External Control of File Name or Path, because external input controls filesystem access without adequate boundary enforcement.

Potential impact

  • Arbitrary files may be written outside the intended upload directory
  • System configuration or authentication-related files could be modified
  • Persistent access may be established across reboots
  • The attacker may gain root-level code execution
  • Device confidentiality, integrity, and availability could be compromised

General mitigation guidance

Mitigation generally focuses on making upload destinations independent of untrusted path input and enforcing strict filesystem boundaries.

Common defensive patterns include:

  • Generate server-side storage names rather than accepting path components from clients
  • Canonicalize candidate paths and verify that they remain within an approved directory
  • Reject traversal markers, absolute paths, symbolic-link escapes, and unexpected separators
  • Apply strict allowlists for instance identifiers and uploaded file types
  • Store uploads in non-executable locations with restrictive ownership and permissions
  • Run the management service with the minimum privileges required for its operations
  • Separate upload handling from privileged system directories and startup mechanisms

How teams detect issues like this

Detection can combine application testing, source review, and filesystem monitoring.

Useful approaches include:

  • Static analysis rules that flag user-controlled values passed to file path construction or file-write APIs
  • Code review checks for missing canonicalization, directory-boundary validation, and symlink handling
  • Dynamic tests using benign path-boundary cases to verify that uploads cannot leave the approved directory
  • Web application logs that identify unusual upload destinations, rejected path values, or repeated traversal attempts
  • File-integrity monitoring for unexpected changes to system, startup, and authentication-related locations
  • Policy enforcement requiring centralized upload helpers and approved path-validation libraries

Sources

SourceLink
github.comgithub.com/openwrt/luci/security/advisories/GHSA-jjcx-c284-2qv8
vulncheck.comvulncheck.com/advisories/luci-app-openvpn-path-traversal-rce-via-instance-name2

Frequently asked

questions

It can be reachable through the luci-app-openvpn management interface when that interface is exposed and the attacker has valid authentication. Exposure is therefore dependent on network access and access-control configuration.

The attacker needs authenticated access to the affected file-upload operation, along with sufficient permissions to submit or modify the relevant upload request.

Keep upload destinations server-controlled, restrict all writes to a canonical approved directory, and prevent uploaded content from reaching privileged or executable system locations.

Use allowlisted identifiers, canonical path-boundary checks, safe upload storage, least-privilege service accounts, and testing that covers traversal and symlink-based filesystem escapes.

Find out what's already
exploitable in your codebase.