Description
OpenPLC Runtime v3's compile_program function (webserver/openplc.py) parses directives from uploaded Structured Text (.st) program files and writes the referenced content to with no validation that file_path stays within the ./core directory. A path-validation function, validate_file_path, exists elsewhere in the codebase (webserver/credentials.py) but is never invoked from compile_program, leaving the sink unprotected.
Published: 2026-08-05
Score: 9.9 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

OpenPLC Runtime v3’s compile_program function in the Python webserver processes uploaded Structured Text (.st) files and writes the content referenced by a FILE directive. It does not verify that the file_path stays within the intended ./core directory, leaving an unprotected write sink. This omission permits a path‑traversal attack that can create or overwrite any file that the web server process can access, resulting in an arbitrary file write on the host.

Affected Systems

The flaw affects the OpenPLC v3 runtime developed by thiagoralves. No product version numbers are listed, so every deployed instance of OpenPLC v3 is potentially vulnerable.

Risk and Exploitability

The CVSS score of 9.9 classifies this issue as critical. However, the EPSS score of less than 1% indicates a very low yet non‑zero probability of exploitation at this time. The vulnerability is not included in CISA’s KEV catalog. An attacker can trigger the flaw remotely through the web server’s file upload interface by submitting a structured text file that contains a crafted FILE directive. When the server processes the upload, it writes the file using its own process user, which allows the attacker to overwrite configuration files, deploy malicious scripts, or otherwise modify the system filesystem.

Generated by OpenCVE AI on August 10, 2026 at 21:43 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply any vendor‑supplied patch or upgrade to a newer OpenPLC v3 release that validates the file path before writing.
  • Modify the compile_program logic to invoke the existing validate_file_path function or remove support for FILE directives entirely.
  • Restrict access to the web server to trusted networks or enforce secure authentication before allowing program uploads.
  • Monitor server logs for unexpected file operations and audit any files written outside the intended directory.

Generated by OpenCVE AI on August 10, 2026 at 21:43 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 10 Aug 2026 12:00:00 +0000

Type Values Removed Values Added
Description OpenPLC Runtime v3's compile_program() function (webserver/openplc.py) parses `(*FILE:path content*)` directives from uploaded Structured Text (.st) program files and writes the referenced content to `os.path.join('./core', file_path)` with no validation that file_path stays within the ./core directory. A crafted .st file containing a directive such as `(*FILE:../../../etc/cron.d/x * * * * root <command>*)` writes attacker-controlled content to an arbitrary filesystem path, enabling remote code execution (e.g. via cron or SSH authorized_keys). A path-validation function, validate_file_path(), exists elsewhere in the codebase (webserver/credentials.py) but is never invoked from compile_program(), leaving the sink unprotected. OpenPLC additionally ships with hardcoded default credentials (openplc:openplc), lowering the practical bar for exploitation. OpenPLC Runtime v3's compile_program function (webserver/openplc.py) parses directives from uploaded Structured Text (.st) program files and writes the referenced content to with no validation that file_path stays within the ./core directory. A path-validation function, validate_file_path, exists elsewhere in the codebase (webserver/credentials.py) but is never invoked from compile_program, leaving the sink unprotected.
Title OpenPLC Runtime v3 - Path Traversal in Structured Text FILE Directive Leading to Arbitrary File Write OpenPLC Runtime v3 Path Traversal in Structured Text FILE Directive Leading to Arbitrary File Write

Mon, 10 Aug 2026 11:45:00 +0000

Type Values Removed Values Added
Title OpenPLC Runtime v3 Path Traversal in Structured Text FILE Directive Leading to Arbitrary File Write OpenPLC Runtime v3 - Path Traversal in Structured Text FILE Directive Leading to Arbitrary File Write

Fri, 07 Aug 2026 10:30:00 +0000

Type Values Removed Values Added
First Time appeared Thiagoralves
Thiagoralves openplc V3
Vendors & Products Thiagoralves
Thiagoralves openplc V3

Wed, 05 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 05 Aug 2026 13:15:00 +0000

Type Values Removed Values Added
Description OpenPLC Runtime v3's compile_program() function (webserver/openplc.py) parses `(*FILE:path content*)` directives from uploaded Structured Text (.st) program files and writes the referenced content to `os.path.join('./core', file_path)` with no validation that file_path stays within the ./core directory. A crafted .st file containing a directive such as `(*FILE:../../../etc/cron.d/x * * * * root <command>*)` writes attacker-controlled content to an arbitrary filesystem path, enabling remote code execution (e.g. via cron or SSH authorized_keys). A path-validation function, validate_file_path(), exists elsewhere in the codebase (webserver/credentials.py) but is never invoked from compile_program(), leaving the sink unprotected. OpenPLC additionally ships with hardcoded default credentials (openplc:openplc), lowering the practical bar for exploitation.
Title OpenPLC Runtime v3 Path Traversal in Structured Text FILE Directive Leading to Arbitrary File Write
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 9.9, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H'}


Subscriptions

Thiagoralves Openplc V3
cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

Updated: 2026-08-10T11:46:39.944Z

Reserved: 2026-08-05T12:23:34.967Z

Link: CVE-2026-71268

cve-icon Vulnrichment

Updated: 2026-08-05T15:41:42.469Z

cve-icon NVD

Status : Received

Published: 2026-08-05T13:24:51.083

Modified: 2026-08-10T12:17:29.267

Link: CVE-2026-71268

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-10T21:45:03Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')