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

CVE-2024-5000

CVE-2024-5000 Supply Chain Attack in Codesys
📅 PUBLISHED: 2024-06-04 08:54 UTC 🔄 UPDATED: 2026-08-12 14:53 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: 1.18%
👁️
1.18% probability
29.5× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1499
👁️
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 7.5
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: N Confidentiality None
I: N Integrity None
A: H Availability High
7.5
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-5000 is a high-severity (CVSS 7.5) denial-of-service vulnerability affecting CODESYS products that implement OPC UA server functionality. An unauthenticated remote attacker can send a crafted OPC UA request, causing incorrect buffer size calculation and leading to a crash or hang of the affected device. This vulnerability is particularly dangerous in industrial control system (ICS) environments where availability is critical. No public exploit code or proof-of-concept is currently available, and no official patch has been released by CODESYS. The EPSS score is 0.0%, indicating low exploitation likelihood at this time, but the risk remains significant due to the lack of mitigations.

⚡ 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

Supply Chain & Package Security

This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It affects CODESYS runtime systems and OPC UA stacks used in industrial automation.

CVSS Breakdown & Threat Level

  • Attack Vector (AV): Network (N) – Exploitable remotely.
  • Attack Complexity (AC): Low (L) – No special conditions required.
  • Privileges Required (PR): None (N) – No authentication needed.
  • User Interaction (UI): None (N) – No user action required.
  • Scope (S): Unchanged (U) – Impact confined to the vulnerable component.
  • Confidentiality (C): None (N) – No data exposure.
  • Integrity (I): None (N) – No data modification.
  • Availability (A): High (H) – Complete loss of service.

Threat Level: High. The vulnerability is remotely exploitable without authentication, and the impact is a full denial of service. In ICS environments, this can halt production lines or critical infrastructure.

Deep Dive & Mechanics

The vulnerability lies in the OPC UA server implementation within CODESYS runtime systems. When an unauthenticated attacker sends a specially crafted OPC UA request, the server incorrectly calculates the required buffer size for processing the request. This miscalculation leads to a buffer overflow or underflow, causing memory corruption and ultimately a denial of service (crash or hang).

Root Cause: Incorrect buffer size calculation (CWE-131) in the OPC UA stack. The server fails to validate the size of incoming data against the allocated buffer, allowing an attacker to trigger a memory safety issue.

Attack Vector: The attacker sends a malicious OPC UA binary message over TCP (typically port 4840) to the target device. The message contains crafted fields that cause the server to allocate an insufficient buffer or to write beyond the allocated buffer.

Impact: The device becomes unresponsive, requiring a manual restart or power cycle to recover. In some cases, the device may enter a persistent crash loop.

Vulnerable vs. Patched Code

Since no official patch is available, a code-level comparison is not possible. However, the vulnerability is expected to be fixed by implementing proper input validation and bounds checking in the OPC UA buffer allocation routine.

Vulnerable Code (Conceptual):

void process_opcua_request(uint8_t *data, size_t len) {
    // Incorrect: assumes fixed size
    uint8_t buffer[1024];
    memcpy(buffer, data, len); // No bounds check
}

Patched Code (Expected):

void process_opcua_request(uint8_t *data, size_t len) {
    if (len > MAX_BUFFER_SIZE) {
        // Reject oversized request
        return;
    }
    uint8_t *buffer = malloc(len);
    if (buffer == NULL) {
        return;
    }
    memcpy(buffer, data, len);
    // ... process buffer ...
    free(buffer);
}

Exploitation & Lab Setup

Red Team (Offensive)

Prerequisites:

  • A CODESYS runtime device (e.g., CODESYS Control Win, CODESYS Control for Raspberry Pi) with OPC UA server enabled.
  • Network access to the device on port 4840.
  • A custom OPC UA client capable of crafting malformed requests.

Exploitation Steps:

  1. Identify the target device using Shodan or network scanning (e.g., nmap -p 4840 <target>).
  2. Use a tool like uaexpert or a custom Python script with the opcua-asyncio library to send a crafted request.
  3. Craft a request with an invalid MessageChunk size or a SequenceHeader that causes buffer miscalculation.
  4. Send the request repeatedly to ensure the device crashes.

Example Python Script (Conceptual):

import socket

def send_malformed_opcua(target_ip, target_port=4840):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect((target_ip, target_port))
    # Craft a malformed OPC UA binary message
    # This is a simplified example; actual payload requires deep OPC UA protocol knowledge
    malformed_payload = b"\x00\x00\x00\x00" * 1000  # Oversized chunk
    sock.send(malformed_payload)
    sock.close()

send_malformed_opcua("192.168.1.100")

Note: No public exploit code is available. The above is a conceptual example.

Blue Team (Defensive)

Detection:

  • Monitor for anomalous OPC UA traffic, especially oversized or malformed messages.
  • Use network intrusion detection systems (NIDS) to alert on OPC UA protocol violations.
  • Enable logging on CODESYS devices and monitor for crash events.

Mitigation:

  • Restrict network access to OPC UA ports (4840) using firewalls.
  • Implement network segmentation to isolate ICS devices.
  • Apply vendor patches when available.
  • Use OPC UA security features (e.g., authentication, encryption) to reduce attack surface.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • Unusually large OPC UA messages (> 64KB) on port 4840.
    • Repeated connection attempts from a single IP to multiple CODESYS devices.
    • OPC UA messages with invalid MessageChunk or SequenceHeader fields.
  • Host IOCs:

    • CODESYS runtime logs showing "buffer overflow" or "memory allocation failure" errors.
    • Device crash logs or unexpected reboots.
    • High CPU or memory usage on the CODESYS device prior to crash.
  • File IOCs:

    • No specific file-based IOCs identified.

Detection Engineering

YARA Rule

rule CVE_2024_5000_OPCUA_Malformed {
    meta:
        description = "Detects malformed OPC UA messages targeting CVE-2024-5000"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-5000"
    strings:
        $opcua_header = { 4F 50 43 55 41 } // "OPCUA" in hex
        $large_chunk = { 00 00 00 00 00 00 00 00 } // Placeholder for oversized chunk
    condition:
        $opcua_header and #large_chunk > 10
}

Sigma Rule

title: CVE-2024-5000 OPC UA DoS Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects potential exploitation of CVE-2024-5000 via malformed OPC UA messages
author: Valters IT
date: 2025-04-10
logsource:
    category: network_connection
    product: suricata
detection:
    selection:
        dest_port: 4840
        app_protocol: opcua
        payload_length: '> 65535'
    condition: selection
falsepositives:
    - Legitimate large OPC UA messages (rare)
level: high

Suricata Rule

alert tcp any any -> any 4840 (msg:"CVE-2024-5000 OPC UA DoS Attempt"; flow:to_server,established; content:"|4F 50 43 55 41|"; depth:5; byte_test:4,>,65535,0,relative; classtype:attempted-dos; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Network Segmentation: Isolate CODESYS devices on a separate VLAN with strict firewall rules.
  2. Access Control: Restrict OPC UA port (4840) access to trusted IPs only.
  3. Monitoring: Enable detailed logging on CODESYS devices and monitor for crash events.
  4. Vendor Contact: Reach out to CODESYS support for patch availability and workarounds.

Long-Term Fixes:

  • Apply vendor patch when released.
  • Upgrade to a patched version of CODESYS runtime.
  • Implement OPC UA security (e.g., authentication, encryption) to reduce attack surface.

Workarounds:

  • Disable OPC UA server if not required.
  • Use a reverse proxy or application-layer firewall to filter OPC UA traffic.

Report generated by Valters IT DevSecOps & CTI Division

👁️ 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 OPC UA
CODESYS Runtime
port:4840 CODESYS

💣 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-2024-5000/ · 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.