CVE-2019-14462
📋 TL;DR
CVE-2019-14462 is an out-of-bounds read vulnerability in libmodbus that allows attackers to read sensitive memory contents when processing MODBUS_FC_WRITE_MULTIPLE_COILS function codes. This affects systems using vulnerable versions of libmodbus for industrial control and SCADA communications. The vulnerability could lead to information disclosure or be used as part of a larger attack chain.
💻 Affected Systems
- libmodbus
- Any software using libmodbus library
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Libmodbus by Libmodbus
Libmodbus by Libmodbus
⚠️ Risk & Real-World Impact
Worst Case
Memory disclosure leading to sensitive information leakage, potential system crash, or as a stepping stone for more severe attacks like remote code execution.
Likely Case
Information disclosure of adjacent memory contents, potentially exposing sensitive data or causing denial of service through application crashes.
If Mitigated
Limited impact if proper network segmentation and access controls prevent unauthorized access to MODBUS services.
🎯 Exploit Status
Exploitation requires sending specially crafted MODBUS packets to vulnerable endpoints. Public proof-of-concept code exists in the commit reference.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: libmodbus 3.0.7 or 3.1.5
Vendor Advisory: https://libmodbus.org/2019/stable-and-development-releases/
Restart Required: Yes
Instructions:
1. Identify libmodbus version on system. 2. Update to libmodbus 3.0.7 or 3.1.5. 3. Recompile and reinstall any applications using libmodbus. 4. Restart affected services or systems.
🔧 Temporary Workarounds
Network Segmentation
allIsolate MODBUS services from untrusted networks using firewalls and network segmentation.
Disable Vulnerable Function
allIf possible, disable MODBUS_FC_WRITE_MULTIPLE_COILS functionality in application configuration.
🧯 If You Can't Patch
- Implement strict network access controls to limit MODBUS traffic to authorized sources only.
- Deploy intrusion detection systems to monitor for anomalous MODBUS traffic patterns.
🔍 How to Verify
Check if Vulnerable:
Check libmodbus version: ldd /path/to/application | grep modbus, then check version in library or check package manager for libmodbus version.
Check Version:
pkg-config --modversion libmodbus or check library version in /usr/lib or /usr/local/lib
Verify Fix Applied:
Verify libmodbus version is 3.0.7 or higher for 3.0.x branch, or 3.1.5 or higher for 3.1.x branch.
📡 Detection & Monitoring
Log Indicators:
- Application crashes or abnormal termination when processing MODBUS requests
- Error logs mentioning out-of-bounds access or memory violations
Network Indicators:
- Unusual MODBUS traffic patterns, especially WRITE_MULTIPLE_COILS function codes with malformed parameters
- Traffic from unexpected sources to MODBUS ports (typically TCP/502)
SIEM Query:
source_port=502 AND (function_code=15 OR abnormal_packet_size)
🔗 References
- https://github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc
- https://libmodbus.org/2019/stable-and-development-releases/
- https://lists.debian.org/debian-lts-announce/2021/11/msg00020.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HAGHQFJTJCMYHW553OUWJ3YIJR6PJHB7/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PRAQZXGAZY6UGWZ6CD33QEFLL7AWW233/
- https://github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc
- https://libmodbus.org/2019/stable-and-development-releases/
- https://lists.debian.org/debian-lts-announce/2021/11/msg00020.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HAGHQFJTJCMYHW553OUWJ3YIJR6PJHB7/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PRAQZXGAZY6UGWZ6CD33QEFLL7AWW233/