CVE-2026-5857: Contiki-NG MQTT Client Out-of-Bounds Write in PUBLISH Topic Parser via Persistent State Between TCP Segments

Published Aug 6, 2026
·
Updated

Contiki-NG's MQTT client parsepublishvhdr() in os/net/app-layer/mqtt/mqtt.c sets topiclenreceived=1 before checking topiclen against the 64-byte limit, so an over-length topic returns early but leaves the flag set. On the next TCP segment, tcpinput() re-invokes the parser with topicreceived==0, and the persisted topiclenreceived==1 skips the length-reading block containing the guard, falling through directly to a memcpy() that uses the unvalidated 16-bit topiclen as the copy length. The 65-byte topic[] destination overruns into adjacent struct fields including the payloadchunk 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.

Affected Software

1 affected component
Contiki-NG MQTT client (parse_publish_vhdr / mqtt.c)

Event History

Aug 6, 2026
CVE Published
via MITRE·06:52 PM
Data Sourced
via MITRE·06:52 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:18 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-5857?

CVE-2026-5857 has a severity rating of high with a score of 8.1.

2

What are the risks associated with CVE-2026-5857?

CVE-2026-5857 can result in an out-of-bounds write vulnerability that may lead to memory corruption.

3

How do I fix CVE-2026-5857?

To fix CVE-2026-5857, ensure you apply the latest patches provided by the Contiki-NG project.

4

What software is affected by CVE-2026-5857?

CVE-2026-5857 affects the Contiki-NG MQTT client specifically in its parsing logic for incoming TCP segments.

5

How can CVE-2026-5857 be exploited?

CVE-2026-5857 can be exploited by sending a maliciously crafted PUBLISH packet with an over-length topic that bypasses validation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203