CVE-2026-71268
JSON

9.9critical

OpenPLC Runtime v3 Path Traversal in Structured Text FILE Directive Leading to Arbitrary File Write

Severity
9.9critical CVSS:3.1 by TuranSec
Exploit likelihood
0.36% (higher than 32% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
TuranSec

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.

Affected

Product or packageVersionsReported by
thiagoralves OpenPLC_v3up to *CVE List

Classification

CWE-22

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

NVD (es)

La función compile_program() de OpenPLC Runtime v3 (webserver/openplc.py) analiza las directivas “(FILE:path content)” de los archivos de programa Structured Text (.st) cargados y escribe el contenido referenciado en “os.path.join(’./core’, file_path)” sin validación de que file_path permanezca dentro del directorio ./core. Un archivo .st manipulado que contiene una directiva como “(FILE:.. / .. / .. / etc/cron.d/x * * * * root [command]*)” escribe contenido controlado por el atacante en una ruta arbitraria del sistema de archivos, lo que permite la ejecución remota de código (por ejemplo, a través de cron o de las claves autorizadas de SSH). Una función de validación de rutas, validate_file_path(), existe en otra parte de la base de código (webserver/credentials.py) pero nunca se invoca desde compile_program(), dejando el ’sink’ desprotegido. OpenPLC se distribuye además con credenciales predeterminadas codificadas (openplc:openplc), lo que reduce la barrera práctica para la explotación.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-71268 changed 2026-08-10CVE Terms of Use
NVDCVE-2026-71268 changed 2026-10-24Public domain