{"id":"CVE-2026-5857","aliases":["CVE-2026-5857"],"related":[],"kind":"vulnerability","state":"published","title":"Contiki-NG MQTT Client Out-of-Bounds Write in PUBLISH Topic Parser via Persistent State Between TCP Segments","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2026-08-06T18:52:40.005Z","modified":"2026-11-08T14:07:09.910Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","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","score":9.2,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:4.0","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","score":9.2,"rating":"CRITICAL"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"custom","introduced":"0","fixed":"a34a2dbdc8bea784bd2ae5079aa4be520cd74f2d","status":"affected"}],"vendor":"Contiki-NG","product":"Contiki-NG","source":"cvelist"}],"references":[{"url":"https://github.com/contiki-ng/contiki-ng","tags":["product"],"sources":["cvelist","nvd"]},{"url":"https://github.com/contiki-ng/contiki-ng/pull/3163","tags":["issue-tracking","patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/contiki-ng/contiki-ng/commit/a34a2dbdc8bea784bd2ae5079aa4be520cd74f2d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://y637f9qq2x.com/posts/cve-2026-5857/","tags":["technical-description"],"sources":["cvelist","nvd"]}],"credits":["Kazuma Matsumoto, a security researcher at GMO Cybersecurity by IERAE, Inc."],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-08-08T02:27:49.447Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-5857","url":"https://www.cve.org/CVERecord?id=CVE-2026-5857","licence":"CVE Terms of Use","modified":"2026-11-08T14:07:09.910Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-5857","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5857","licence":"Public domain","modified":"2026-09-24T20:06:30.133Z"}],"updatedAt":"2026-11-25T22:59:31.388Z","epss":{"score":0.00537,"percentile":0.46688,"date":"2026-12-01T12:00:22.000Z"}}