/

CVE-2026-14480

Severity:

CRITICAL RISK

(9.9)

Path Traversal File Write (CWE-73) in OpenPLC Runtime

CVE-2026-14480

Deferred

Vulnerability type

Category:

Path Traversal / Arbitrary File Write

CWE:

CWE-73

Impact:

Arbitrary File Write leading to 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

OpenPLC Runtime v3's legacy web UI allows authenticated users to control the filesystem path where uploaded program files are stored, without validation or restriction.

By supplying an absolute or crafted path, an attacker can write files anywhere the webserver can, and in default builds may escalate this into arbitrary native code execution via malicious C++ sources.

Affected context

This vulnerability occurs in OpenPLC Runtime v3 deployments using the legacy web UI's program-upload workflow.

It is relevant when the application:

  • Persists attacker-supplied filenames directly in the Programs.File database field
  • Uses these stored values as destination paths for file uploads
  • Runs with filesystem write access to sensitive directories, such as the runtime core source tree

Risk is heightened in environments where uploaded C++ source files are automatically included in the build pipeline and compiled into the runtime executable.

Exploit preconditions

  • Attack surface: HTTP interface of the legacy OpenPLC web UI program-upload endpoint
  • Required access: Valid authenticated user session capable of uploading PLC programs
  • Trigger point: Submission of a crafted prog_file value and corresponding file upload, followed by operator-initiated compilation and runtime start
  • Why exploitation is possible: The application trusts the attacker-supplied filename, storing it in the database and later using it as a destination path via os.path.join() without enforcing a safe base directory, normalization, or path restrictions. Python's path handling honors absolute paths, enabling writes outside the intended upload directory and into the core runtime source tree.

Why this happens

The underlying bug is an improper neutralization of special elements used in a file path, mapped to CWE-73.

Instead of treating the filename as untrusted input and constraining it to a specific directory, the application:

  • Stores the raw attacker-provided prog_file value in the database
  • Uses this value directly as the target path for saving an uploaded file
  • Relies on os.path.join() without enforcing that the result stays within an allowed directory

This pattern allows absolute paths or traversal sequences to escape expected locations and reach arbitrary filesystem locations, including directories that participate in the compilation pipeline.

Because the OpenPLC build process compiles all C++ source files in the runtime core directory into the executable, a malicious file placed there turns the file write primitive into native code execution when a normal compilation and start sequence is performed.

Potential impact

  • Authenticated users may write arbitrary files to any location writable by the OpenPLC webserver process.
  • Attackers could plant malicious C++ source files that are compiled into the runtime binary.
  • Successful exploitation can lead to arbitrary native code execution under the privileges of the OpenPLC runtime.
  • Runtime compromise may allow modification of PLC logic, unsafe system behavior, or further lateral movement within the control network.
  • Attackers could overwrite configuration, logs, or auxiliary scripts, affecting availability and integrity of the control system.

General mitigation guidance

Effective mitigation focuses on restricting file-write behavior and decoupling uploaded content from sensitive build pipelines.

General defensive patterns include:

  • Constraining all uploaded file paths to a single, fixed base directory and rejecting absolute paths or traversal components.
  • Separating user-uploaded program files from the runtime core source tree so they are not automatically compiled into privileged binaries.
  • Normalizing and validating filenames against an allowlist pattern (e.g., alphanumeric plus simple extensions) before storage and use.
  • Using derived, server-side filenames (such as UUIDs) instead of trusting client-supplied names for filesystem operations.
  • Running the webserver and build processes with least privilege and limiting write access only to directories explicitly needed for uploads and compilation.
  • Applying defense-in-depth around build workflows, such as requiring explicit review or signed sources before inclusion in the runtime.

How teams detect issues like this

Detection commonly involves examining both application code and operational behavior:

  • Static analysis or manual review for patterns where user-controlled filename or path values are persisted and later passed to file APIs (e.g., open, os.path.join, shutil operations) without path validation.
  • Look for missing checks that enforce a canonical upload directory, absence of normalization, or acceptance of absolute paths.
  • Review database schemas and usage patterns where fields like Programs.File are derived directly from HTTP request parameters.
  • Implement runtime monitoring and logging of file writes, especially in critical directories such as the runtime core source tree and configuration paths, and alert when unexpected writes occur.
  • Enforce policy checks in CI/CD or security gateways around build inputs, rejecting new source files created from unreviewed or user-upload directories.
  • Automated security testing tools can be configured to fuzz upload endpoints with crafted filenames to surface path traversal and arbitrary write behavior.

Sources

SourceLink
github.comgithub.com/cisagov/CSAF/blob/develop/csaf_files/OT/white/2026/icsa-26-190-01.json
cisa.govcisa.gov/news-events/ics-advisories/icsa-26-190-01

Frequently asked

questions

It is typically exploitable over the network through the legacy OpenPLC web UI, as long as an attacker can authenticate and access the program-upload workflow. No local shell access to the host is required to trigger the arbitrary file write.

Exploitation requires an authenticated account with permission to upload programs. The exact role depends on how access control is configured, but full administrative privileges are not inherently necessary if standard users can perform uploads.

The safest pattern is to stop trusting user-supplied file paths entirely. Use server-generated, sanitized filenames mapped to a dedicated upload directory, enforce strict path validation, and ensure that uploaded files cannot be written into or automatically consumed by core runtime source or configuration directories.

Treat all filenames and paths from clients as untrusted data. Apply canonicalization and validation against a fixed base directory, avoid mixing user-controlled paths with build or execution pipelines, and incorporate security reviews or automated checks focused on filesystem operations whenever new upload or storage features are introduced.

Find out what's already
exploitable in your codebase.