Skip to main content

Contiki-NG CVE-2026-5857

| EUVDEUVD-2026-54226 CRITICAL
Out-of-bounds Write (CWE-787)
2026-08-06 disclosure@vulncheck.com GHSA-x5g5-4jq8-vj28
9.2
CVSS 4.0 · Vendor: vulncheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Operate malicious broker or MITM plaintext MQTT
  2. Delivery
    Send PUBLISH with over-length topic_len
  3. Exploit
    Split header across TCP segments to bypass guard
  4. Install
    Fall through to unguarded memcpy overflow
  5. C2
    Overwrite adjacent payload_chunk pointer
  6. Execute
    Trigger dereference as arbitrary write
  7. Impact
    Crash device or execute code

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the Contiki-NG device to be acting as an MQTT client with an active PUBLISH-receiving session to an attacker-controlled or compromised broker; because the MQTT stack has no TLS, a network man-in-the-middle on the plaintext connection can equally deliver the payload. The concrete trigger is a PUBLISH packet whose advertised 16-bit topic_len exceeds the 64-byte MQTT_MAX_TOPIC_LENGTH, delivered fragmented across TCP segments so the first invocation sets topic_len_received=1 and returns early and a later invocation skips the length guard and reaches the memcpy. Limiting factors that reduce real-world risk: the attacker must control or MITM the broker (there is no purely unsolicited path against an arbitrary device), the multi-segment timing needed to defeat the guard raises attack complexity (CVSS AC:H), and reliable code execution versus a mere crash depends on the target lacking memory protection and having a favorable struct layout; no user interaction and no client-side authentication are required (UI:N, PR:N).

Impact

The vendor CVSS 4.0 base score is 9.2 (Critical), vector AV:N/AC:H/AT:N/PR:N/UI:N with high VC/VI/VA, consistent with the CWE-787 memory-corruption-to-RCE potential. The key nuance is the attack model: PR:N reflects that no client-side authentication is required, but exploitation requires the victim device to connect to an attacker-controlled or compromised broker - or, because MQTT here is plaintext with no TLS, a network man-in-the-middle. AC:H appropriately captures the non-trivial precondition of splitting the malicious topic across TCP segments to defeat the guard on re-entry. No EPSS score, KEV listing, or public POC was provided, so real-world exploitation pressure is currently unquantified: the signals show high theoretical severity but no evidence of active exploitation. This is a genuine priority for anyone running the Contiki-NG MQTT client against untrusted or internet-exposed brokers, and lower priority where brokers are trusted and network-isolated. One conflict worth flagging: the severity assumes RCE, but on many embedded builds the practical outcome may be limited to DoS/crash - impact varies with target memory protection and struct layout.

Exploit ScenarioDerived

An attacker who operates or has compromised the MQTT broker a Contiki-NG device connects to - or who can man-in-the-middle the unencrypted MQTT session - sends a PUBLISH message with an over-length topic, deliberately fragmenting it across two TCP segments so the first parser invocation sets the received flag and returns early and the second falls through to the unguarded memcpy. The oversized copy overruns topic[] and overwrites the adjacent payload_chunk pointer, which later MQTT code dereferences, giving an arbitrary-pointer-write that can crash the device or, on targets without memory protection, be steered toward code execution. No public exploit is identified at time of analysis.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 06, 2026

Out-of-bounds write in the Contiki-NG MQTT client (os/net/app-layer/mqtt/mqtt.c) lets a malicious or compromised MQTT broker overflow a 65-byte topic[] buffer and corrupt the adjacent payload_chunk pointer, producing an arbitrary-pointer-write primitive that can escalate to remote code execution on embedded targets lacking memory protection. The flaw stems from parse_publish_vhdr() setting topic_len_received=1 before enforcing the 64-byte topic length limit, so an over-length topic split across TCP segments bypasses the guard on parser re-entry and reaches a memcpy() that trusts the unvalidated 16-bit topic_len. Because the stack has no TLS, the plaintext channel also exposes devices to network man-in-the-middle injection; there is no public exploit identified at time of analysis and it is not in CISA KEV.

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - apply Contiki-NG commit a34a2dbdc8bea784bd2ae5079aa4be520cd74f2d (PR https://github.com/contiki-ng/contiki-ng/pull/3163), which validates topic_len against remaining_length and MQTT_MAX_TOPIC_LENGTH before the memcpy and aborts the connection on violation, then rebuild and reflash affected devices; since no tagged patched release is confirmed, rebuild from a repository state that includes this commit. Where firmware cannot be updated immediately, the most effective compensating controls are: restrict devices to connect only to a trusted, hardened broker and block outbound MQTT (typically TCP 1883) to any other destination, which removes the attacker-controlled-broker path but breaks connectivity to other brokers; and place the plaintext MQTT traffic on an isolated network segment or VPN tunnel to prevent man-in-the-middle injection, at the cost of added network complexity. Because the stack has no TLS, in-transit encryption is not available without external tunneling, and disabling or not compiling the MQTT client entirely eliminates exposure where the feature is unused.

Affected VersionsENISA

contiki-ng 0 <a34a2dbdc8bea784bd2ae5079aa4be520cd74f2d

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Contiki-NG is an open-source operating system for resource-constrained IoT and embedded devices (successor to Contiki), and the affected component is its application-layer MQTT client. The bug is a CWE-787 out-of-bounds write driven by a stateful TCP-stream parser: MQTT PUBLISH variable headers can arrive fragmented across TCP segments, so parse_publish_vhdr() carries cross-invocation state via flags such as topic_len_received. The root cause is a validation-ordering error - the received flag is set before the topic_len bounds check, so when tcp_input() re-invokes the parser on the next segment with topic_received0 but topic_len_received1, execution skips the entire length-reading block (and its guard) and falls straight into the memcpy() using the attacker-supplied 16-bit topic_len as the copy length, overrunning the 65-byte topic[] into adjacent struct fields. The upstream fix (commit a34a2dbdc8, PR #3163) reworks the state machine (adds topic_len_msb_received), validates topic_len against both remaining_length and MQTT_MAX_TOPIC_LENGTH before copying, aborts the connection on violation, and additionally hardens variable-byte-integer decoding and cross-packet payload bounding.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (vulncheck) PRIMARY 9.2 HIGH
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
vuln.today AI 8.1 HIGH

Network-reachable via a malicious broker or plaintext MITM (AV:N) with no client authentication (PR:N), but the multi-segment state trick raises complexity (AC:H); memory-corruption-to-RCE gives high C/I/A, scope unchanged.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (vulncheck).

CVSS VectorVendor: vulncheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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_received0, and the persisted topic_len_received1 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.

Executive ViewAI

Why It Matters

Contiki-NG's MQTT implementation contains a critical remote code execution vulnerability (CVE-2026-5857) enabling complete compromise of connected IoT devices, with no public exploit identified and no vendor patch currently available. Organizations deploying Contiki-NG across critical infrastructure, healthcare, manufacturing, and other sectors must immediately implement containment measures to prevent network-wide compromise.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include: (1) network segmentation to prevent lateral movement from compromised devices, (2) enforcement of encrypted MQTT connections (TLS) to prevent message injection attacks, (3) MQTT broker input validation to reject excessively large topic payloads, and (4) enhanced security monitoring to detect anomalous device communications and behavior. Expedited vendor engagement is essential to obtain a timeline for security patches.

Threat Intelligence Overview

EPSS Score
0.5%
Top 58% exploitable
Prevalence
Low
niche open-source IoT/embedded OS, limited production footprint
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.5%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Partial

Priority Score

47
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy