Skip to main content
Back to Blog
Security

Modbus TCP Security: Risks, Controls and Secure Alternatives

November 202614 min read
Modbus TCP control cabinet in an electrical room

Classic Modbus TCP offers no authentication, authorisation, integrity checking or encryption. If you can open a TCP connection to a device you can read it, and usually write to it. You bridge that gap using two methods. Move to Modbus Security, which encapsulates Modbus TCP in TLS using certificates, and place compensating network controls in front of every device that cannot upgrade. This guide addresses both, as well as how to adjust polling to prevent security monitoring from bogging down your devices.

PODTECH specializes in secure critical infrastructure integrations

We build custom software for telemetry, building integrations and legacy-connected systems across existing estates.Learn More About PODTECH

TL;DR

  • Modbus TCP was architected for reliability and speed in secured plants, not security. It transmits everything in plaintext over port 502, and trusts every client implicitly.
  • Modbus Security does not modify the Modbus message itself but transports it within TLS on port 802, including mutual X.509 certificates and role-based permissions.
  • Most networks still have legacy devices. Segmentation, firewalls, function-code filtering and logging provide protection for them.

Polling can impact visibility, stability and security. Employ block reads and tiered scan rates with only one polling master per device.

  • Treat the work as a lifecycle: inventory, zone, harden, monitor, then replace.

Table of Contents

Why Modbus TCP is insecure by design

These are design flaws, not bugs to be fixed in an update. As Campbell Scientific’s white paper details, Modbus TCP was designed for closed industrial environments and does not include any built-in encryption, authentication, or access control. It sends all of its traffic in plain text, leaving it vulnerable to snooping, unauthorized control, command injection, man-in-the-middle attacks, and denial of service.

In practice that means four gaps:

  1. No authentication. Any device that can connect to port 502 can issue any command, as explained in Beacon Security’s guide.
  2. Absence of authorisation. There is no distinction between a read-only user and a user that can write.
  3. No integrity checking. A device in the path can alter responses in transit.
  4. No encryption. Register values, addresses and function codes are readable on the wire.

The SANS white paper covering insecure industrial protocols adds that legacy protocols inherited from serial links are susceptible to replay attacks and unauthenticated command execution, allowing an attacker to manipulate PLC logic values. Research papers support that conclusion as well. A literature review of building automation security found that major building protocols lack strong authentication and encryption by design and references laboratory attacks using SYN flood DoS attacks and Ettercap MiTM attacks against Modbus TCP.

Port 502 is likewise famous. Campbell Scientific observes that attackers commonly scan it searching for open control systems. If you run a data centre, or have a building with BMS, power metering and cooling controllers on Modbus, that's important: a forged write to a setpoint or breaker status register is an operational incident, rather than merely a data event.

What Modbus Security changes

Released by the Modbus Organization in October 2018, the Modbus Security protocol describes a fusion of TLS with the existing protocol, X.509v3 certificates to verify both server and client identities, role-based access control information transported in a certificate extension, and port 802 instead of port 502.

TLS does not modify the Modbus application data unit itself. Instead, it encapsulates it entirely within TLS. This allows the requirements to remain simple and still maintain backwards compatibility with older equipment and fieldbuses through a gateway. TLS offers confidentiality for transport, data integrity and anti-replay.

PropertyModbus TCPModbus Security
Port502802
EncryptionNoneTLS 1.2 or newer
AuthenticationNoneMutual, X.509v3 certificates
AuthorisationNoneRole carried in client certificate
Replay protectionNoneProvided by TLS
Message formatMBAP ADUSame MBAP ADU inside TLS

Two details are worth knowing before you plan a rollout.

TLS version negotiated is floored. Control.com's technical write up states that the specification does not allow negotiation down to older TLS versions or SSL 3.0.

Pre-shared keys are not used because X.509v3 certificates allow carrying role information required for authorisation. TLS was selected after mapping industry data flows against IEC 62443-3-3 and IEC 62443-4-2.

How authentication and roles work

Each endpoint supplies a certificate as part of the TLS handshake. The server reads the role from an extension on the client certificate and applies a product-specific roles-to-rights function to determine whether to service each request. A monitoring client may possess a read-only role. An engineering workstation will have a role authorized to write.

Documentation from vendors illustrates how this works on physical devices. The Modbus TLS instructions from Riello UPS explicitly state that client certificates must contain the role extension (OID 1.3.6.1.4.1.50.316.802.1) and that read/write privileges can then be assigned separately based on role. The terms master/slave are also replaced with client/server.

For operators, the practical consequences are:

  • You require a certificate process. Issue, renew and revoke certificates for clients and devices. Manage who has control of the certificate authority.
  • Roles must be created. Specify the minimum set, such as monitor, operator and engineer, and associate each with the function codes and registers it should have access to.
  • Devices vary. Roles-to-rights is applied at the product level, so verify the behavior of each model yourself.
  • Legacy port 502 can operate concurrently. Leaving this enabled prevents the secure port from protecting anything. Disable it after migrating clients.

Campbell Scientific notes limited uptake is partially due to incompatibility with older devices, cumbersome certificate management, and processing load on small devices. This is why most real estates operate under a mixed model for years.

Securing legacy Modbus TCP devices

Most controllers, meters and power equipment installed in the past 20 years will not speak TLS. SANS believes that because industrial components have such a long operating life insecure protocols will remain in use for years to come but that attackers can be made to work much harder through configuration changes, programming practice and network controls.

Begin with the architecture. ODVA provides guidance stating that IEC 62443 is risk-based and lifecycle-oriented: you determine risk per zone and conduit, select a target security level, and implement only the controls necessary to meet that target. That same publication advises use of protocols with inherent security where possible, and compensating controls where not.

Network controls that carry the load

What you must do as a minimum really comes down to NIST’s Guide to Operational Technology Security (SP 800-82 Rev. 3, September 2023). Here's the baseline for a US operator:

  • Architect a tiered network topology with your most important communications running in the most secure and reliable tier.
  • Segment corporate and OT networks with a DMZ of firewalls in-between so traffic never flows directly between them.
  • Use separate credentials and authentication for OT and corporate networks.
  • Disable unused ports and services on OT devices.
  • Restrict user privileges to what each role needs, following least privilege.
  • Restrict physical access to the OT network.

Applied to Modbus, that translates into concrete rules:

  1. Explicitly allow-list source and destination pairs. Only the polling master/gateway may open port 502 to a given device. Drop everything else.
  2. Never allow 502 to be accessible from the internet or corporate LAN. Access from remote locations is only through a VPN or jump host with strong authentication requirements.
  3. Filter on function code and register range. You can allow reads to monitoring systems, but block writes except from a named engineering host, with a deep-inspection firewall/proxy.
  4. Place a secure gateway in front of legacy devices. The gateway exposes Modbus Security northbound and regular Modbus TCP southbound on a segregated network segment.
  5. Block ARP spoofing on the segment. Static ARP entries or switch-level protections should be enabled on the small VLANs containing the legacy devices.

If your building or data hall project requires broader IT hardening around the OT perimeter, look to a managed provider like us to secure the external network and identity layers.

Secure northbound access for legacy Modbus estatesCorporate / RemoteVPN / Jump HostFirewall + DMZAllow-listsFunction filteringLoggingSecure GatewayTLS on 802 northboundCerts + rolesPlain Modbus southboundMeterPLC / RTUBMS Controllerauthenticated accessinspected trafficisolated OT VLANPrinciple:legacy devices stay untrusted and unreachable directly;the gateway and firewall absorb authentication, encryption, filtering and audit duties.

Monitoring and logging

CISA's guidelines for securing industrial control systems recommend you establish a baseline of normal traffic and alert on anything that deviates from the baseline. They also recommend keeping audit trails of critical areas and correlating logs in a SIEM solution. Applied to Modbus this means:

  • Log every write function code with timestamp, source and destination.
  • Trap on a new client speaking to a controller, on an unknown function code, and on writes outside of business cycles.
  • Forward gateway and firewall events to your SIEM.
  • Watch for scanning patterns against port 502.

Our guidance document on identity-first controls for remote monitoring includes recommendations on how to translate this to remote access routes. The Industrial IoT Security Roadmap provides a 3–12 month prioritized plan you can customize.

A practical migration path

You don't have to swap everything out at once. Here is one order that works for many estates:

  1. Inventory. Make a list of every device that responds on port 502, what firmware it is running, who owns it and what it controls. If it is not listed, you cannot protect it.
  2. Zone. Devices should be divided into zones by function and criticality. Identify conduits between zones, and specify the flows that are permitted.
  3. Isolate. Move legacy devices onto dedicated VLANs behind a firewall with allow-lists.
  4. Gateway. If the device cannot be modified, insert a gateway or proxy that terminates TLS and applies roles.
  5. Certificates. Establish a certificate authority and lifecycle process prior to enabling Modbus Security on capable devices.
  6. Monitor. Baseline traffic, then alarm on deviations.
  7. Replace. Wherever possible, specify Modbus Security, or some other secured protocol, with every new purchase and replacement cycle.

The same concept exists on every protocol used in a building. Check out our podcast episode on BACnet Secure Connect and blog post on MQTT TLS authentication for examples of how certificate-based security is implemented on the other protocols you will likely be working with. See our Modbus glossary entry for an explanation of the basic parts of the protocol itself.

Polling without overloading devices

Polling design is a security issue more than it may appear. An aggressive poller can overwhelm a small controller, cause disconnects and leave you in the dark when you need telemetry the most. Additional security devices that poll devices contribute to this load as well.

Three habits keep polling reliable:

Batch contiguous registers. One read of a block of holding registers is far cheaper than many single-register reads. This rate limiting and block read guide quantifies the difference at ~190 bytes on the wire vs ~2400 for 60 registers, and highlights a typical limit of 125 holding registers per request. Bigger blocks aren't always better, however. Read FlowFuse's polling best practices guide for why an efficient batch that wrecks your scan-rate strategy can end up costing you more overall.

Tier your scan rates. Values that change quickly, like power draw or alarm status, merit small intervals. Values that change slowly, like configuration and nameplate data, can be scanned once at start-up and cached. This same principle also reminds you that your scan rate must respect each device's real response capability, particularly on shared serial buses behind gateways.

Poll from one location. Multiple masters polling the same device causes extra load and ugly log files. Poll using one collector, then fan out the data over a message bus to other consumers.

Measure the impact by observing response times and exception codes prior to and after an adjustment, and maintain a benchmark for the slowest device in each group. If you upgrade to Modbus Security, re-measure your polling intervals: TLS handshakes and encryption will introduce additional processing overhead on tiny devices. Keep connections open instead of reconnecting for each poll.

Our perspective

“Modbus will be around data centers for decades to come. We believe the question isn't if we should keep it, but where can we safely place it.”

Across our data centre and building product projects we design the Modbus device to be untrusted. It exists within a highly restricted zone. It can only be reached through a single aggregation point. And everything leaving that zone is authenticated and encrypted. That is our philosophy around telemetry: the collector assumes the security burden, not the legacy device.

Polling and security are also a single design for us. Because a collector that reads in blocks, tiers scan rates and logs every write gives ops predictability. It also gives security an audit log they can trust, from the same source. Our 99.9% uptime SLA is constructed on that type of discipline.

If you are planning for a refresh someday, bake secure protocol support into the specification today. It costs more to retrofit than it does to select wisely the first time around.

Harry

Build secure Modbus integration with PODTECH

We build software for datacenter telemetry, building management systems (BMS), property management systems (PMS) and network management systems (NMS) integration and legacy modernisation. Our Podtech A1 Controller is a datacenter telemetry appliance. Our teams have completed more than 250 projects for mission critical customers.

Mapping a Modbus estate? Planning gateways or upgrading legacy monitoring? Discuss datacenter telemetry and master systems integration with us. We can also scope enterprise automation software around your secure data flows.

FAQ

Can Modbus TCP be encrypted?

No, not in its native form. Modbus TCP is unencrypted plaintext running on port 502. Modbus Security encapsulates the same messages within TLS 1.2+ on port 802 and secures it using certificates. If devices don't support it, you can secure the link with a gateway or VPN.

What port does Modbus Security use?

Port 802 is officially recommended to be used instead of traditional Modbus TCP port 502. See Modbus Organization. Both protocols can operate concurrently, disable port 502 after clients have been upgraded.

How does authentication work in Modbus TCP?

Standard Modbus TCP does not define any. Modbus Security enables mutual TLS with X.509v3 certificates. A role can be encoded in the client certificate that the server uses to determine which requests will be honored.

Is a firewall enough to secure Modbus TCP?

The foundational layer is a firewall plus allow-lists. But remember, NIST’s OT guidance marries this with layered topology, least privilege, disabled unused services and monitoring. It’s just one control in a suite.

How often should I poll Modbus devices?

Match your interval with how quickly the data changes and device capability. Fetch contiguous registers in block transactions, tier faster and slower data, and poll each device from one master device.

Sources