CVE-2018-19417
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 · uneditedAn 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 confidenceThe 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.
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< 4.2CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Identify Contiki-NG usageLocate 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
-
Determine Contiki-NG versionInspect 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.)
-
Verify MQTT server module is enabledCheck 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
-
Inspect MQTT topic length configurationLocate 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)
-
Check for vulnerable parse_publish_vhdr functionSearch 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.
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 · scoped4.2
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.
Contiki-NG 4.2
- 1. Identify the current Contiki-NG version by checking the Contiki-NG source code or build configuration in your project
- 2. Download or clone the Contiki-NG 4.2 release (or later) from the official repository: github.com/contiki-ng/contiki-ng
- 3. Replace the Contiki-NG submodule or source files in your project with the 4.2 version
- 4. Rebuild the firmware image using your build system (typically 'make' in the Contiki-NG project directory)
- 5. Deploy the updated firmware to all affected devices
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation8.0 h
- Testing12.0 h
- Review / QA4.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2018-19417 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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