CVE-2026-71268: CWE-22 in thiagoralves OpenPLC_v3
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.
AI Analysis
Technical Summary
The OpenPLC Runtime v3's compile_program() function in webserver/openplc.py parses `(*FILE:path content*)` directives from uploaded Structured Text (.st) files and writes the referenced content to a path under './core' without validating that the file path remains within this directory. This lack of validation enables an attacker to craft a .st file with a path traversal payload (e.g., `(*FILE:../../../etc/cron.d/x * * * * root <command>*)`) to write arbitrary files anywhere on the filesystem. Although a path validation function exists elsewhere in the codebase, it is never called in this context, leaving the sink unprotected. The vulnerability allows remote code execution vectors such as cron jobs or SSH authorized_keys manipulation. Additionally, OpenPLC ships with hardcoded default credentials (openplc:openplc), which reduces the difficulty of exploitation. There is no vendor advisory or patch information available at this time.
Potential Impact
Successful exploitation allows an attacker with at least limited privileges (due to the need for uploading .st files) to write arbitrary files anywhere on the filesystem, potentially leading to remote code execution. This can compromise confidentiality, integrity, and availability of the affected system. The presence of hardcoded default credentials increases the risk by making unauthorized access easier.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict access to the upload functionality, change default credentials, and monitor for suspicious file uploads. Avoid using OpenPLC Runtime v3 in untrusted environments until the vulnerability is addressed.
CVE-2026-71268: CWE-22 in thiagoralves OpenPLC_v3
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.
CVSS v3.1
Score 9.9critical
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The OpenPLC Runtime v3's compile_program() function in webserver/openplc.py parses `(*FILE:path content*)` directives from uploaded Structured Text (.st) files and writes the referenced content to a path under './core' without validating that the file path remains within this directory. This lack of validation enables an attacker to craft a .st file with a path traversal payload (e.g., `(*FILE:../../../etc/cron.d/x * * * * root <command>*)`) to write arbitrary files anywhere on the filesystem. Although a path validation function exists elsewhere in the codebase, it is never called in this context, leaving the sink unprotected. The vulnerability allows remote code execution vectors such as cron jobs or SSH authorized_keys manipulation. Additionally, OpenPLC ships with hardcoded default credentials (openplc:openplc), which reduces the difficulty of exploitation. There is no vendor advisory or patch information available at this time.
Potential Impact
Successful exploitation allows an attacker with at least limited privileges (due to the need for uploading .st files) to write arbitrary files anywhere on the filesystem, potentially leading to remote code execution. This can compromise confidentiality, integrity, and availability of the affected system. The presence of hardcoded default credentials increases the risk by making unauthorized access easier.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict access to the upload functionality, change default credentials, and monitor for suspicious file uploads. Avoid using OpenPLC Runtime v3 in untrusted environments until the vulnerability is addressed.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- TuranSec
- Date Reserved
- 2026-08-05T12:23:34.967Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a7336e4bf8831d539ed9141
Added to database: 08/05/2026, 13:13:08 UTC
Last enriched: 08/05/2026, 13:32:02 UTC
Last updated: 08/06/2026, 00:13:49 UTC
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.