Two operators at a control-room desk with a row of monitors, a laptop and keyboards

OT/ICS security

Modbus protocol security: why it has none, and what to do about it

Last updated:

Modbus is the most widely deployed industrial protocol in the world, and it has no built-in authentication, no encryption, and no message-integrity check — a fact that was true of Modicon's original 1979 design and remains true of the Modbus Application Protocol specification the Modbus Organization publishes today. That gap is not a secret or a recent discovery: it is a documented, CVE-numbered finding in CISA's ICS advisory archive, and it is the reason every credible piece of Modbus security guidance, from CISA to NIST to the Modbus Organization's own add-on security specification, starts from the same premise — the protocol cannot protect itself, so something else has to.

Sources: the Modbus Organization's own specifications (Modbus Application Protocol V1.1b3, the Messaging on TCP/IP Implementation Guide and MB-TCP-Security v3.6), CISA ICS advisories, NVD records and NIST SP 800-82 Revision 3, each linked where it is used.

Key takeaways

  • Modbus was created by Modicon (now part of Schneider Electric) in 1979 as a simple, open, royalty-free way for a master device to poll and command PLCs over a serial line.
  • The specification states that a user-defined code carries "no guarantee that the use of the selected function code will be unique".
  • CISA's advisory ICSA-17-101-01, covering the Schneider Electric Modicon Modbus protocol and published 11 April 2017, turns "no authentication" into two scored vulnerabilities.
  • The second recurring class is parser bugs: a request whose declared quantity or length does not match the bytes that follow.

Why does Modbus have no security, by design?

Modbus was created by Modicon (now part of Schneider Electric) in 1979 as a simple, open, royalty-free way for a master device to poll and command PLCs over a serial line. It spread for the reasons that later became security liabilities: it is small, easy to implement on constrained hardware and vendor-neutral, so it is still the default protocol on a large share of installed PLCs, RTUs, sensors and gateways. Nothing in the base Modbus Application Protocol specification, maintained since 2004 by the Modbus Organization, includes a field for a credential, a session key or a signature. A Modbus server that receives a well-formed request simply executes it.

What does a Modbus/TCP request carry on the wire?

Per the Messaging on TCP/IP Implementation Guide, every Modbus/TCP message goes to registered port 502 and starts with a 7-byte MBAP header: a transaction identifier, a protocol identifier (0 for Modbus), a length field and a one-byte unit identifier used to reach serial devices behind a gateway. Then comes the PDU, at most 253 bytes, so a TCP ADU is at most 260 bytes. The PDU's first byte is the function code, and the Modbus Application Protocol V1.1b3 defines what each one does:

Function code Name Effect on the device
1, 2 Read Coils, Read Discrete Inputs Read only (up to 2,000 bits)
3, 4 Read Holding Registers, Read Input Registers Read only (up to 125 registers)
5, 6 Write Single Coil, Write Single Register Changes one output or setpoint
15, 16 Write Multiple Coils, Write Multiple Registers Changes a block (up to 123 registers for 16)
22 Mask Write Register Changes bits inside a register
23 Read/Write Multiple Registers Reads and writes in one request
8 Diagnostics (serial line only) Sub-function 04, Force Listen Only Mode, takes a device off the bus until restarted
43 / 14 Read Device Identification Returns vendor, product code and revision
65–72, 100–110 User-defined ranges Vendor-specific; meaning varies by product

The specification states that a user-defined code carries "no guarantee that the use of the selected function code will be unique". Vendor-specific functions are common in practice: Ovarro's TBox, for example, had proprietary Modbus file-access functions that let attackers read, alter or delete its configuration file (CVE-2021-22648). A filter built only on the public codes does not understand them.

What does that gap cost in practice?

CISA's advisory ICSA-17-101-01, covering the Schneider Electric Modicon Modbus protocol and published 11 April 2017, turns "no authentication" into two scored vulnerabilities. CVE-2017-6034 (CVSS v3.0 10.0, CWE-294, Authentication Bypass by Capture-Replay) covers the finding that "sensitive information is transmitted in cleartext in the Modicon Modbus protocol, which may allow an attacker to replay the following commands: run, stop, upload, and download." CVE-2017-6032 (CVSS v3.0 5.3, CWE-657) covers "a session-related weakness making it susceptible to brute-force attacks." Both describe the protocol's structure rather than one coding bug, which is why the same class of finding recurs across vendors in CISA's archive.

Which Modbus stack and firmware bugs keep reaching advisories?

The second recurring class is parser bugs: a request whose declared quantity or length does not match the bytes that follow. These sit in the firmware or library that handles Modbus, so a device maker fixes them by updating the stack.

Component CVE Weakness Affected / fixed
libmodbus CVE-2019-14462, CVE-2019-14463 Out-of-bounds read on Write Multiple Coils / Registers (CWE-125, CVSS 3.1 9.1) Before 3.0.7 and 3.1.0–3.1.4; fixed in 3.1.5, with the CVE-2019-14463 check corrected in 3.1.6
libmodbus CVE-2022-0367 Heap overflow in modbus_reply() (CWE-787, 7.8) Before 3.1.7
libmodbus CVE-2023-26793 Heap overflow in read_io_status (CWE-122, CISA-ADP 9.8) 3.1.10 listed
Rockwell MicroLogix 1400 firmware CVE-2021-22659, ICSA-21-033-01 Crafted Modbus packet, buffer overflow, denial of service (CWE-120, 8.6) Version 21.6 and below
Ovarro TBox CVE-2021-22642, ICSA-21-054-04 Invalid Modbus frames crash the device (CWE-400, 7.5) Per advisory
GPL Odorizers GPL750 CVE-2026-4436, ICSA-26-099-02 Modbus writes manipulate odorant-injection inputs (CWE-306, 8.6) Per advisory (9 April 2026)

The libmodbus project shipped v3.1.11 in October 2024, with a fix that checks request length in modbus_reply, and v3.2.0 in July 2026. A firmware SBOM that names the stack and its version is what tells you whether a row applies; see firmware SBOM.

What do CISA and NIST recommend instead?

NIST SP 800-82 Revision 3 (September 2023) treats the absence of authentication and integrity protection in legacy field protocols like Modbus as a structural OT risk to manage at the network and architecture layer. CISA's ICS recommended practices point at the same controls:

Control What it does for Modbus specifically
Minimize network exposure Modbus TCP (port 502) should never be directly reachable from the internet; CISA's recommended practice treats internet-facing control-system devices as a baseline failure, not an edge case
Segment and firewall Keep Modbus traffic inside the control network, behind an industrial DMZ — see the Purdue Model for OT/ICS network architecture for the segmentation pattern this implements
Restrict remote access Treat every vendor or contractor remote-access path as a specific, reviewed exception, not a standing connection
Filter by function code A protocol-aware firewall or gateway passes only the function codes a link needs — reads where that is enough, with writes such as Write Single Coil and Write Single Register blocked unless a link requires them
Monitor for anomalies Monitoring that decodes function codes can flag replay patterns, unexpected writes, or traffic from devices with no business issuing them

See NIST SP 800-82: OT Security for the fuller framework, and IEC 62443-3-3 for how a zone's target security level turns these ideas into testable requirements.

What does Modbus/TCP Security require of a device?

The Modbus Organization's specifications page describes the Modbus Security protocol as "the blending of Transport Layer Security (TLS) with the traditional Modbus protocol," using X.509v3 certificates to authenticate server and client, on port 802. IANA registers port 802 as mbap-s, "Modbus Application Protocol Secure". The MB-TCP-Security v3.6 specification (2021-07-30) calls the secured profile mbaps and numbers its requirements:

Requirement What it says
R-01, R-34 TLS 1.2 or newer; never negotiate down to TLS 1.1, 1.0 or SSL 3.0
R-02, R-44 Mutual authentication; the server rejects a client that sends no certificate
R-03, R-46 X.509v3 certificates as device credentials, sent with the full chain to the root CA
R-05 The Modbus protocol itself is unchanged inside TLS
R-14 At minimum TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 with an RSA key
R-16, R-21 Role-based client authorization should be offered; the role travels in a certificate extension under OID 1.3.6.1.4.1.50316.802.1
R-27, R-28 The roles-to-rights rules must be configurable by the end user, with no unchangeable hard-coded default roles
R-31 An unauthorized request gets exception code 01, Illegal Function
R-49, R-67 Where encryption is not required, a NULL-encryption, authentication-only cipher suite may be used
R-57, R-58 Support TLS Maximum Fragment Length negotiation down to 512 bytes, for small devices

Two details matter in practice. The authorization algorithm and the rules database are vendor-defined (R-24, R-25), so two vendors' "Operator" roles need not mean the same thing. And an authentication-only cipher suite gives integrity and peer authentication but leaves register values readable on the wire. A separate IETF Internet-Draft (draft-liu-iotops-modbus-seriallink-sec-spec) proposes an equivalent for serial-line Modbus, which has no TCP connection to wrap in TLS.

How widely mbaps runs in deployed field devices is not well documented. Treat a vendor's "Modbus Security" claim as something to verify per product and firmware version.

What should a device maker build into Modbus firmware?

  1. Bounds-check every requestagainst the specification's limits: quantity fields (2,000 bits, 125 or 123 registers), byte counts against the actual payload, and the 253-byte PDU. The libmodbus and MicroLogix rows above are all this bug.
  2. Fuzz the Modbus parserin CI, including user-defined function codes and malformed MBAP length fields.
  3. Ship a configurable function-code allowlistand a read-only mode, so an operator can disable writes, diagnostics and vendor functions per port.
  4. Offer mbaps on port 802with a per-device key and certificate, and user-configurable roles (R-27, R-28).
  5. Limit connections and rate, so a flood of requests degrades gracefully instead of faulting the controller.
  6. List the Modbus stack in the SBOMwith its exact version, and track its advisories. IEC 62443-4-2 gives the component-level requirements these steps feed.

How do you monitor Modbus passively?

Zeek's built-in parser writes modbus.log, and CISA's ICSNPP-Modbus package adds four logs, including modbus_detailed.log with the function, addresses and values of each request and response, plus logs for Mask Write Register, Read/Write Multiple Registers and Read Device Identification. Useful alert rules:

  • any write (5, 6, 15, 16, 22, 23) from a host that is not an engineering workstation or HMI;
  • Diagnostics sub-function 04 (Force Listen Only Mode), or user-defined codes, outside a maintenance window;
  • Modbus/TCP on port 502 crossing a zone boundary, or from an address outside the private range;
  • bursts of exception responses, which often mean scanning or a malformed-packet test.

Worked example: what does a Modbus review of one line find?

Synthetic example, for illustration only. A one-hour passive capture on a packaging line shows:

  1. InventoryFourteen hosts; six answer on port 502 (four PLCs, a drive gateway, an energy meter). No traffic on port 802.
  2. WritesThe HMI writes holding registers on two PLCs, as expected. A maintenance laptop also writes coils on the drive gateway, an undocumented path.
  3. ExposureThe energy meter's port 502 is reachable from the office VLAN, which fails the segmentation control.
  4. ComponentsThe drive gateway's firmware SBOM lists libmodbus 3.1.6, inside the CVE-2022-0367 range.
  5. ActionsBlock the office-VLAN path, restrict coil writes to the HMI at the gateway firewall, and ask the gateway vendor for a stack update; mbaps is offered on one PLC model only.

What should an operator do first?

  1. Assume every Modbus link has zero built-in security, because per its own specification it does.
  2. Segment before anything elseNo Modbus device should be reachable from the internet or directly from corporate IT.
  3. Filter by function code, not just by IP addressPassing only the codes a link needs stops much of the replay and unauthorized-command risk CISA's advisories describe.
  4. Check for Modbus Security per device, not per vendor, and prefer mbaps where it is supported.
  5. Monitor what segmentation misses: replayed commands and unauthorized writes that a firewall configured only on IP and port would let through.

What are the common pitfalls?

  • Filtering on port 502 alone, which allows every write and diagnostic function.
  • Forgetting the unit identifier: one gateway IP can front many serial devices.
  • Leaving vendor function codes open because a public-code allowlist does not recognize them.
  • Running mbaps with an authentication-only cipher and assuming register values are confidential.
  • Shipping one certificate or role set for every unit, which R-28 rules out for roles.

What does a SoftWSP OT Snapshot show for Modbus?

Modbus's lack of built-in security is why CISA's Secure by Demand guidance for OT products asks owners to question vendors directly about authentication and segmentation support. SoftWSP's OT Snapshot reads Zeek and ICSNPP logs from a passive capture of a mirror port: it lists hosts, the ports and services they serve, remote-access sessions, and labels the server side of a Modbus session as a PLC. It does not decode function codes or identify a device's firmware from traffic; advisory matching against NVD, CISA KEV, FIRST EPSS and CISA CSAF ICS advisories runs on a component list or firmware SBOM, and an engineer reviews every report. See OT Snapshot, and our DNP3 and BACnet guides for the same pattern in other protocols.

This guide is not a substitute for the Modbus Organization's specifications, CISA's or NIST's publications, or an engineer's assessment of a specific network.

Put this guide to work

Frequently asked questions

Does Modbus have any built-in security at all?

No. Modbus — in its original serial RTU/ASCII form and in Modbus TCP/IP — was designed in 1979 by Modicon as a simple request-response protocol for talking to PLCs, with no field for authentication, no encryption, and no message-integrity check anywhere in its application-layer specification. Any device that can reach a Modbus server over the network or serial line can issue any function code that server accepts — read a register, write a coil, stop a process — and the protocol itself has no way to tell whether that command came from an authorized engineering workstation or an attacker. This is not an oversight that was later patched into the base protocol; the standard Modbus Application Protocol specification published by the Modbus Organization is unchanged on this point, which is exactly why a separate add-on specification, Modbus Security, exists.

What does a real Modbus security failure actually look like?

CISA's advisory ICSA-17-101-01, covering the Schneider Electric Modicon Modbus protocol (published 11 April 2017), is a concrete, documented example. It assigns CVE-2017-6034 (CVSS v3.0 base score 10.0, CWE-294 Authentication Bypass by Capture-Replay) to the finding that "sensitive information is transmitted in cleartext in the Modicon Modbus protocol, which may allow an attacker to replay the following commands: run, stop, upload, and download" — meaning an attacker who can observe traffic can capture a legitimate command and replay it later to the same effect, with no credential needed. The same advisory assigns CVE-2017-6032 (CVSS v3.0 base score 5.3, CWE-657 Violation of Secure Design Principles) to a separate finding that "the Modicon Modbus protocol has a session-related weakness making it susceptible to brute-force attacks." Neither finding is a coding bug in one vendor's firmware; both describe the protocol's own design, which is why the same class of finding recurs across Modbus-speaking products from multiple vendors in CISA's advisory archive.

Is there a secure version of Modbus, and does anything actually use it?

Yes — the Modbus Organization publishes a Modbus Security Protocol specification (the most recent version per the organization's own specifications index is MB-TCP-Security v3.6, dated 2021-07-30, updating an earlier v2.1 from 2018-07-24) that wraps a standard Modbus/TCP Application Data Unit inside a TLS session — a profile the spec calls MBAPS — running over TCP port 802 rather than the standard, unencrypted port 502. Per the Modbus Organization's own description, the protocol "provides protection through the blending of Transport Layer Security (TLS) with the traditional Modbus protocol," using TLS 1.2 or later and X.509v3 digital certificates for mutual authentication of client and server. A separate, still-unfinished IETF Internet-Draft (draft-liu-iotops-modbus-seriallink-sec-spec) proposes an equivalent for serial-line Modbus, which has no TCP/TLS transport to piggyback on. How widely either specification is actually implemented in deployed field devices is not well documented — treat any vendor's claim of "Modbus Security support" as something to verify against that specific device's documentation, not as something you can assume.

If a device can't do Modbus Security, is there anything else that actually helps?

Yes, and for most of the installed base — where devices are years old and will never get a TLS-capable firmware update — this is the real security model, not a fallback. NIST SP 800-82 Revision 3 explicitly treats the lack of authentication and integrity protection in legacy field protocols like Modbus as a structural OT risk to be managed with compensating controls at the network and architecture layer, not something to wait on the protocol to fix. CISA's long-standing ICS recommended practices point at the same controls: minimize network exposure so Modbus devices and the systems that talk to them are never reachable from the internet, segment control networks behind firewalls and an industrial DMZ, restrict and monitor remote access, and — specific to Modbus itself — filter at the function-code level so a firewall or protocol-aware gateway only passes the function codes a given link actually needs (read-only where that's all that's required, with write functions such as Write Single Coil and Write Single Register blocked unless specifically justified).

Sources

  1. CISA ICS Advisory ICSA-17-101-01: Schneider Electric Modicon Modbus Protocol (11 April 2017; CVE-2017-6034, CVE-2017-6032)
  2. Modbus Organization: Specifications and Implementation Guides (modbus-specifications index, incl. Modbus Security Protocol)
  3. Modbus Organization: Modbus Security Protocol specification, MB-TCP-Security v3.6 (2021-07-30), updating v2.1 (2018-07-24)
  4. IETF Internet-Draft: Modbus Serial Link Communication Security Protocol Specification (draft-liu-iotops-modbus-seriallink-sec-spec)
  5. NIST Special Publication 800-82 Revision 3, Guide to Operational Technology (OT) Security (September 2023)
  6. CISA: ICS Recommended Practices (control systems network segmentation, defense-in-depth, minimizing network exposure)
  7. Modbus Organization: MODBUS Application Protocol Specification V1.1b3 (function codes)
  8. Modbus Organization: MODBUS Messaging on TCP/IP Implementation Guide V1.0b (MBAP header, port 502)
  9. IANA Service Name and Transport Protocol Port Number Registry: mbap-s, port 802
  10. NVD: CVE-2019-14462 (libmodbus out-of-bounds read, Write Multiple Coils)
  11. NVD: CVE-2022-0367 (libmodbus heap overflow in modbus_reply)
  12. NVD: CVE-2023-26793 (libmodbus heap overflow in read_io_status)
  13. NVD: CVE-2021-22659 (Rockwell Automation MicroLogix 1400 crafted Modbus packet)
  14. CISA ICS Advisory ICSA-21-033-01 (Update A): Rockwell Automation MicroLogix 1400
  15. CISA ICS Advisory ICSA-21-054-04 (Update A): Ovarro TBox
  16. CISA ICS Advisory ICSA-26-099-02: GPL Odorizers GPL750 (9 April 2026; CVE-2026-4436)
  17. libmodbus: open-source Modbus library (GitHub)
  18. CISA ICSNPP-Modbus: Zeek parser extension for Modbus (GitHub)
Was this guide helpful?

In this cluster

Modbus protocol security: why it has none, and what to do about it