Skip to main content

Security Exposure

TLS on 8883 protects the connection but does not by itself decide who may connect, publish, or subscribe. The MQTT 5.0 standard lists threats including compromised devices, interception or alteration of traffic, spoofed control packets, and denial of service, and says implementations in hostile environments often need authentication and authorization. In Eclipse Mosquitto, allow_anonymous controls whether clients without a username may connect.

Hardening

  • Require client authentication on the broker, using client certificates or username and password over TLS.
  • Apply per-topic authorization so each device can only publish and subscribe to its own topics.
  • Disable anonymous access; in Eclipse Mosquitto, keep allow_anonymous false on any listener reachable from the network.
  • Retire plaintext 1883 listeners once clients have moved to 8883.

Monitoring

Log broker connections with client IDs and source addresses, and alert on authentication failures, unknown client IDs, and subscriptions to broad wildcard topics.

Frequently Asked Questions

What is the difference between port 1883 and 8883?→

Both are registered for MQTT. 1883 is for unencrypted MQTT and 8883 is for MQTT over TLS, according to the OASIS MQTT 5.0 standard.

Is port 8883 TCP or UDP?→

MQTT runs over TCP. IANA lists both transports for secure-mqtt, but the MQTT standard says connectionless transports such as UDP are not suitable on their own.

Does using port 8883 make an MQTT broker secure?→

It encrypts the connection. Authentication and topic authorization still have to be configured on the broker.

Port assignments from the IANA Service Name and Transport Protocol Port Number Registry. Services can be configured to run on any port, so traffic on port 8883 is not guaranteed to be MQTT over TLS. Exploited-in-the-wild data from the CISA KEV catalog (CC0).