☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 6.6 CVSS:3.1/AV:P/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-22
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-0694

CVE-2025-0694 Directory Traversal in Codesys
📅 PUBLISHED: 2025-03-18 11:04 UTC 🔄 UPDATED: 2026-08-12 14:52 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.17%
👁️
0.17% probability
4.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1068
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 6.6
AV: P Attack Vector Physical
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
6.6
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-0694 is a vulnerability in CODESYS Control runtime systems that allows a low-privileged attacker with physical access to bypass path validation and gain full filesystem access. The flaw resides in insufficient path validation, enabling directory traversal or arbitrary file read/write operations. With a CVSS score of 6.6 (Medium), the attack vector is physical, but the impact on confidentiality, integrity, and availability is high. No public exploit code or proof-of-concept is currently available, and no patch has been released by the vendor. This vulnerability is particularly dangerous in industrial control system (ICS) environments where physical access to controllers is possible.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

  • Attack Vector (AV): Physical (P) – Requires physical access to the device.
  • Attack Complexity (AC): Low (L) – No special conditions needed.
  • Privileges Required (PR): Low (L) – Attacker needs low-level access (e.g., user account).
  • User Interaction (UI): None (N) – No user action required.
  • Scope (S): Unchanged (U) – Vulnerability does not affect other components.
  • Confidentiality (C): High (H) – Full filesystem read access.
  • Integrity (I): High (H) – Full filesystem write access.
  • Availability (A): High (H) – Could lead to denial of service or system compromise.

Threat Level: Medium (6.6) – Physical access requirement reduces exploitability, but impact is severe in ICS contexts.

Deep Dive & Mechanics

The vulnerability exists in the file path handling logic of CODESYS Control runtime. When a low-privileged user interacts with the system via physical console or local interface, the application fails to properly validate user-supplied paths. This allows an attacker to use directory traversal sequences (e.g., ../) to escape restricted directories and access arbitrary files on the filesystem.

Root Cause: The application does not sanitize or canonicalize file paths before performing filesystem operations. This is a classic path traversal vulnerability (CWE-22). The attacker can read sensitive configuration files, modify runtime parameters, or overwrite critical binaries.

Attack Scenario:

  1. Attacker gains physical access to the CODESYS Control device (e.g., via USB, serial console, or local terminal).
  2. Attacker logs in with low-privileged credentials (default or brute-forced).
  3. Attacker uses a vulnerable function (e.g., file upload, configuration load) that accepts a file path.
  4. Attacker supplies a path like ../../etc/passwd or ../../config/system.cfg.
  5. The application processes the path without validation, granting access to the target file.

Vulnerable vs. Patched Code

Vulnerable Code (Conceptual):

// Vulnerable: No path validation
int load_config(const char *user_path) {
    char full_path[256];
    snprintf(full_path, sizeof(full_path), "/config/%s", user_path);
    FILE *f = fopen(full_path, "r");
    // ... read file
}

Patched Code (Conceptual):

// Patched: Validate and canonicalize path
int load_config(const char *user_path) {
    char full_path[256];
    char resolved[256];
    snprintf(full_path, sizeof(full_path), "/config/%s", user_path);
    if (realpath(full_path, resolved) == NULL) {
        return -1; // Error
    }
    if (strncmp(resolved, "/config/", 8) != 0) {
        return -1; // Path escape detected
    }
    FILE *f = fopen(resolved, "r");
    // ... read file
}

Key Differences:

  • Use of realpath() to resolve symlinks and .. sequences.
  • Check that the resolved path stays within the allowed directory.
  • Reject any path that escapes the sandbox.

Exploitation & Lab Setup

Red Team (Offensive)

Prerequisites:

  • Physical access to a CODESYS Control device (e.g., Raspberry Pi running CODESYS, WAGO PLC, etc.).
  • Low-privileged user account (e.g., user with default password user).

Exploitation Steps:

  1. Connect to the device via serial console or SSH (if enabled).
  2. Log in with low-privileged credentials.
  3. Identify a vulnerable endpoint (e.g., file upload, configuration load).
  4. Craft a path traversal payload:
    ../../etc/passwd
    
  5. Execute the command or API call to read the file.
  6. For write access, use a payload like:
    ../../tmp/backdoor.sh
    
    Then write malicious content.

Example Command (if shell access):

# Read sensitive file
cat /config/../../etc/shadow

# Write a backdoor
echo "malicious_code" > /config/../../usr/bin/backdoor

Blue Team (Defensive)

Detection:

  • Monitor for path traversal patterns in logs (e.g., ../, ..\\).
  • Alert on file access outside expected directories.
  • Use file integrity monitoring (FIM) on critical system files.

Prevention:

  • Restrict physical access to devices (locked cabinets, access control).
  • Enforce least privilege – remove default low-privileged accounts.
  • Implement application-level path validation and canonicalization.
  • Use chroot jails or containerization to isolate the runtime.

Hunting:

  • Search for file read/write events to sensitive paths (e.g., /etc/shadow, /etc/passwd).
  • Look for unusual process behavior (e.g., cat or echo accessing system files).

Indicators of Compromise (IOCs)

  • File Paths:
    • /etc/passwd
    • /etc/shadow
    • /config/../../etc/shadow
    • /var/log/auth.log (modified)
  • Process Names:
    • cat, echo, cp, mv executed by low-privileged user on system files.
  • Log Entries:
    • Repeated path traversal patterns in application logs.
    • Unauthorized file access attempts.
  • Network (if applicable):
    • Outbound connections from the device to unknown IPs (data exfiltration).

Detection Engineering

YARA Rule

rule CVE_2025_0694_PathTraversal {
    meta:
        description = "Detects path traversal attempts in CODESYS Control logs"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2025-0694"
    strings:
        $traversal1 = "../" ascii wide nocase
        $traversal2 = "..\\" ascii wide nocase
        $traversal3 = "/etc/" ascii wide nocase
        $traversal4 = "/var/" ascii wide nocase
    condition:
        any of ($traversal*) and filesize < 10KB
}

Sigma Rule

title: CVE-2025-0694 Path Traversal in CODESYS Control
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects path traversal attempts in CODESYS Control logs
author: Valters IT
date: 2025-04-10
logsource:
    category: application
    product: codesys_control
detection:
    selection:
        EventID: 1001
        Message|contains:
            - '../'
            - '..\\'
            - '/etc/'
            - '/var/'
    condition: selection
falsepositives:
    - Legitimate use of relative paths in configuration
level: high

Suricata Rule

alert tcp any any -> any 2455 (msg:"CVE-2025-0694 CODESYS Control Path Traversal"; flow:to_server,established; content:"../"; nocase; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Restrict Physical Access: Place CODESYS Control devices in locked cabinets or secure areas.
  2. Disable Unnecessary Accounts: Remove or disable default low-privileged accounts.
  3. Apply Vendor Patch: Monitor CODESYS security advisories for an official patch.
  4. Implement Workaround: If possible, use a reverse proxy or application firewall to filter path traversal patterns.

Long-Term Fixes:

  • Code Review: Ensure all file path operations use canonicalization and whitelist-based validation.
  • Least Privilege: Run the CODESYS runtime with minimal filesystem permissions.
  • Logging & Monitoring: Enable detailed logging of file access and alert on anomalies.

Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

CODESYS Control
CODESYS Runtime
port 2455

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-0694/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.