Description
Contiki-NG's MQTT client parse_publish_vhdr() in os/net/app-layer/mqtt/mqtt.c sets topic_len_received=1 before checking topic_len against the 64-byte limit, so an over-length topic returns early but leaves the flag set. On the next TCP segment, tcp_input() re-invokes the parser with topic_received==0, and the persisted topic_len_received==1 skips the length-reading block containing the guard, falling through directly to a memcpy() that uses the unvalidated 16-bit topic_len as the copy length. The 65-byte topic[] destination overruns into adjacent struct fields including the payload_chunk pointer, which subsequent MQTT code dereferences, giving a compromised or attacker-controlled broker an arbitrary-pointer-write primitive. Contiki-NG's MQTT implementation has no TLS support so the connection is plaintext. Impact ranges from information disclosure and denial of service to remote code execution on embedded targets without memory protection.
Published: 2026-08-06
Score: 9.2 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Contiki-NG’s MQTT client contains a parsing flaw that allows an attacker to craft a publish packet with a topic longer than the allowed 64-byte limit. The parser incorrectly handles the length field between TCP segments, resulting in an out-of-bounds write to the topic buffer and inadvertently overwriting a pointer in the message structure. This provides the attacker with an arbitrary-pointer-write primitive that can be leveraged to read or modify critical data, and ultimately execute arbitrary code on the target device.

Affected Systems

The vulnerability affects all Contiki-NG implementations that use the current MQTT client code. The specific commit that introduced the issue is recorded in the project’s repository. Versions of Contiki-NG prior to the merge of the fix in pull‑request 3163 are susceptible; precise version ranges are not listed, so any build that includes the unpatched mqtt.c module is at risk.

Risk and Exploitability

The flaw is high severity, with a CVSS score of 9.2. No EPSS data is available and the vulnerability is not in the KEV catalog, but the lack of TLS and the embedded nature of the software mean that an attacker who can act as a broker or otherwise send crafted MQTT packets stands a strong chance of exploiting it. The attack vector is via plain‑text MQTT traffic and does not require privileged access to the device; as such, the risk is substantial for exposed or poorly isolated deployments.

Generated by OpenCVE AI on August 7, 2026 at 00:34 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Contiki‑NG to the latest version that includes the patch from commit a34a2dbdc8bea784bd2ae5079aa4be520cd74f2d
  • If an immediate update is not possible, disable the MQTT client on the device or restrict connections to trusted brokers only
  • Apply network segmentation and firewall rules to prevent untrusted MQTT traffic from reaching devices running vulnerable Contiki‑NG

Generated by OpenCVE AI on August 7, 2026 at 00:34 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 14 Aug 2026 17:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:o:contiki-ng:contiki-ng:*:*:*:*:*:*:*:*

Thu, 13 Aug 2026 20:45:00 +0000

Type Values Removed Values Added
References

Sat, 08 Aug 2026 03:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 07 Aug 2026 01:30:00 +0000

Type Values Removed Values Added
First Time appeared Contiki-ng
Contiki-ng contiki-ng
Vendors & Products Contiki-ng
Contiki-ng contiki-ng

Thu, 06 Aug 2026 22:15:00 +0000

Type Values Removed Values Added
Description Contiki-NG's MQTT client parse_publish_vhdr() in os/net/app-layer/mqtt/mqtt.c sets topic_len_received=1 before checking topic_len against the 64-byte limit, so an over-length topic returns early but leaves the flag set. On the next TCP segment, tcp_input() re-invokes the parser with topic_received==0, and the persisted topic_len_received==1 skips the length-reading block containing the guard, falling through directly to a memcpy() that uses the unvalidated 16-bit topic_len as the copy length. The 65-byte topic[] destination overruns into adjacent struct fields including the payload_chunk pointer, which subsequent MQTT code dereferences, giving a compromised or attacker-controlled broker an arbitrary-pointer-write primitive. Contiki-NG's MQTT implementation has no TLS support so the connection is plaintext. Impact ranges from information disclosure and denial of service to remote code execution on embedded targets without memory protection.
Title Contiki-NG MQTT Client Out-of-Bounds Write in PUBLISH Topic Parser via Persistent State Between TCP Segments
Weaknesses CWE-787
References
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 9.2, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Contiki-ng Contiki-ng
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-14T16:50:27.644Z

Reserved: 2026-04-08T19:29:27.852Z

Link: CVE-2026-5857

cve-icon Vulnrichment

Updated: 2026-08-08T02:27:58.323Z

cve-icon NVD

Status : Received

Published: 2026-08-06T22:18:10.900

Modified: 2026-08-13T21:18:08.433

Link: CVE-2026-5857

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-07T01:15:04Z

Weaknesses