libmodbus
CVE-2024-10918
CRITICAL
Severity by source
Sources disagree (Medium–Critical)AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Unauthenticated network peer sends a malformed Modbus request (AV:N/AC:L/PR:N/UI:N); a stack overflow in the reply path plausibly yields code execution, so C/I/A:H, though demonstrated impact may be limited to availability.
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L
vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.
CVSS VectorNVD
Lifecycle Timeline
7DescriptionNVD
Stack-based Buffer Overflow vulnerability in libmodbus v3.1.10 allows to overflow the buffer allocated for the Modbus response if the function tries to reply to a Modbus request with an unexpected length.
AnalysisAI
Stack-based buffer overflow in libmodbus 3.1.10 lets an attacker overrun the fixed response buffer when the library builds a Modbus reply to a request whose declared length is unexpected. Any application embedding this widely-used Modbus TCP/RTU library - typically PLCs, gateways, SCADA/HMI components and IoT devices acting as Modbus servers - can be crashed or potentially made to execute code by an attacker able to reach the Modbus endpoint. There is no public exploit identified at time of analysis, and the EPSS probability is low (0.21%, 43rd percentile), but the flaw was reported by Nozomi Networks and a vendor fix is available.
Technical ContextAI
libmodbus is a portable open-source C library implementing the Modbus protocol over serial (RTU) and TCP, embedded in a large range of industrial control, energy and IoT firmware to speak to PLCs, sensors and actuators. The root cause is CWE-121 (Stack-based Buffer Overflow): when constructing a response, the code writes into a stack-allocated buffer sized for the expected reply, but a request carrying an unexpected/oversized length field drives more bytes into that buffer than it can hold, corrupting the stack. Because Modbus is a lightweight, historically unauthenticated field-bus protocol, the malformed length can be delivered by any peer that can open a Modbus/TCP (typically port 502) or serial session, and the CPE data confirms the affected component is precisely cpe:2.3:a:libmodbus:libmodbus:3.1.10.
RemediationAI
Patch is available per the vendor: upgrade libmodbus above 3.1.10 to a fixed release and rebuild/redeploy any product that bundles it, then confirm the embedded version rather than relying on the OS package alone. On Debian-based systems, apply the libmodbus updates referenced in the Debian LTS advisories (https://lists.debian.org/debian-lts-announce/2025/03/msg00010.html and https://lists.debian.org/debian-lts-announce/2026/08/msg00003.html) and consult the Nozomi Networks advisory (https://www.nozominetworks.com/labs/vulnerability-advisories-cve-2024-10918) for details. Where immediate patching of embedded/OT devices is not feasible, apply compensating controls: place Modbus endpoints on an isolated OT VLAN and restrict TCP/502 (and any serial-over-IP gateway) with firewall allow-lists so only trusted masters can send requests - this blocks arbitrary peers but requires accurate knowledge of legitimate Modbus clients; and deploy Modbus-aware deep-packet-inspection/IDS rules to drop requests with malformed or out-of-range length fields, accepting that DPI adds latency and may false-positive on non-standard-but-legitimate traffic. Exact fixed version numbers beyond 'greater than 3.1.10' are not enumerated in the provided data and should be taken from the vendor/distribution advisory.
A heap-based buffer overflow flaw was found in libmodbus in function modbus_reply() in src/modbus.c. Rated high severity
libmodbus v3.1.6 was discovered to contain a use-after-free via the ctx->backend pointer. Rated high severity (CVSS 7.5)
libmodbus v3.1.6 was discovered to contain a heap overflow via the modbus_mapping_free() function. Rated high severity (
libmodbus v3.1.10 is vulnerable to Buffer Overflow via the modbus_write_bits function. Rated high severity (CVSS 7.5), t
An issue was discovered in libmodbus before 3.0.7 and 3.1.x before 3.1.5. Rated critical severity (CVSS 9.1), this vulne
An issue was discovered in libmodbus before 3.0.7 and 3.1.x before 3.1.5. Rated critical severity (CVSS 9.1), this vulne
An invalid pointer in the modbus_receive() function of libmodbus v3.1.6 allows attackers to cause a Denial of Service (D
Same weakness CWE-121 – Stack-based Buffer Overflow
View allSame technique Buffer Overflow
View allVendor StatusVendor
SUSE
Severity: Medium| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Fixed |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Fixed |
Share
External POC / Exploit Code
Leaving vuln.today