CVE-2026-71268: OpenPLC Runtime v3 Path Traversal in Structured Text FILE Directive Leading to Arbitrary File Write
OpenPLC Runtime v3's compileprogram() 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', filepath) with no validation that filepath 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 authorizedkeys). A path-validation function, validatefilepath(), exists elsewhere in the codebase (webserver/credentials.py) but is never invoked from compileprogram(), leaving the sink unprotected. OpenPLC additionally ships with hardcoded default credentials (openplc:openplc), lowering the practical bar for exploitation.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-71268?
CVE-2026-71268 has a critical severity rating of 9.9.
What type of vulnerability is CVE-2026-71268?
CVE-2026-71268 is a Path Traversal vulnerability affecting OpenPLC Runtime v3.
How do I fix CVE-2026-71268?
To fix CVE-2026-71268, ensure that file path validation is implemented for the compile_program() function in OpenPLC Runtime.
What software is affected by CVE-2026-71268?
CVE-2026-71268 affects OpenPLC Runtime v3.
What can be the impact of CVE-2026-71268?
CVE-2026-71268 could lead to arbitrary file writes, potentially compromising system integrity.