Contiki NgApplication

CVE-2018-19417

CRITICAL · 10.0 CVSS v3.0 Published 2018-11-21
Fix available
A fix is available. Upgrade to 4.2 or later.
See remediation →
100/100
Remediation priority · Urgent
Public exploit Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
An issue was discovered in the MQTT server in Contiki-NG before 4.2. The function parse_publish_vhdr() that parses MQTT PUBLISH messages with a variable length header uses memcpy to input data into a fixed size buffer. The allocated buffer can fit only MQTT_MAX_TOPIC_LENGTH (default 64) bytes, and a length check is missing. This could lead to Remote Code Execution via a stack-smashing attack (overwriting the function return address). Contiki-NG does not separate the MQTT server from other servers and the OS modules, so access to all memory regions is possible.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The MQTT server in Contiki-NG before 4.2 has a stack-based buffer overflow in parse_publish_vhdr(). The function copies topic data via memcpy into a fixed 64-byte buffer (MQTT_MAX_TOPIC_LENGTH) without validating the input length first. An attacker can send a specially crafted MQTT PUBLISH message with a topic exceeding 64 bytes, overflowing the buffer and overwriting the return address to achieve remote code execution.

MitigationUpgrade to Contiki-NG 4.2 or later which includes bounds checking. If upgrading is not immediately possible, implement a length validation check in parse_publish_vhdr() to reject PUBLISH messages where topic length exceeds MQTT_MAX_TOPIC_LENGTH before the memcpy call.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Contiki NgApplication
Affected:< 4.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Contiki-NG usage
    Locate the Contiki-NG firmware or build system in your IoT device/environment. Check firmware files, build configurations, or system documentation for references to Contiki-NG.
    Affected if Contiki-NG is present in the environment
  2. Determine Contiki-NG version
    Inspect the firmware image, build metadata, or source code for the version identifier. Look for version strings, git tags, or release notes associated with the Contiki-NG codebase.
    Affected if Version is below 4.2 (e.g., 4.1, 4.0, 3.0, etc.)
  3. Verify MQTT server module is enabled
    Check the Contiki-NG configuration (project-conf.h or Makefile) for MQTT server compilation. Look for CONFIG_MQTT or similar MQTT-related build flags that indicate the MQTT server is built into the firmware.
    Affected if MQTT server module is compiled and running
  4. Inspect MQTT topic length configuration
    Locate the MQTT configuration header file (mqtt.h or mqtt-client.h) in the Contiki-NG source. Check the value of MQTT_MAX_TOPIC_LENGTH macro or constant.
    Affected if MQTT_MAX_TOPIC_LENGTH is set to 64 or not defined (using default of 64)
  5. Check for vulnerable parse_publish_vhdr function
    Search the MQTT source code for the parse_publish_vhdr() function. Verify it uses memcpy() to copy topic data into a fixed-size buffer without prior length validation.
    Affected if The function copies topic data via memcpy without bounds checking against MQTT_MAX_TOPIC_LENGTH

Environment is affected if Contiki-NG version is below 4.2, the MQTT server module is enabled, and the MQTT topic handling code lacks bounds checking before copying into the 64-byte buffer.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 4.2 or later
Fixed in 4.2
Interim mitigation

Upgrade to Contiki-NG 4.2 or later which includes bounds checking. If upgrading is not immediately possible, implement a length validation check in parse_publish_vhdr() to reject PUBLISH messages where topic length exceeds MQTT_MAX_TOPIC_LENGTH before the memcpy call.

Recommended fix High confidence

Contiki-NG 4.2

  1. 1. Identify the current Contiki-NG version by checking the Contiki-NG source code or build configuration in your project
  2. 2. Download or clone the Contiki-NG 4.2 release (or later) from the official repository: github.com/contiki-ng/contiki-ng
  3. 3. Replace the Contiki-NG submodule or source files in your project with the 4.2 version
  4. 4. Rebuild the firmware image using your build system (typically 'make' in the Contiki-NG project directory)
  5. 5. Deploy the updated firmware to all affected devices

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Contiki Ng Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing12.0 h
  • Review / QA4.0 h
28.0 hours of engineering $4,760
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $7,616.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2018-19417 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2018-19417 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data