CVE-2017-10910: Mqtt Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-h9mj-fghc-664w
CVSS 6.5
CWE-674
Published
Advisory Summary

CVE-2017-10910 is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-674: Uncontrolled Recursion) affecting Mqtt libraries in the npm ecosystem. The issue involves denial of service in mqtt. Remediation is available by upgrading affected packages to version 2.15.0.

CVE-2017-10910 at a Glance

CVE Identifier CVE-2017-10910
GHSA Identifier GHSA-h9mj-fghc-664w
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-674: Uncontrolled Recursion
Affected Product Mqtt
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2017-10910

To remediate this vulnerability, upgrade all affected Mqtt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mqtt fixed: 2.15.0
npm install mqtt@2.15.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mqtt

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2017-10910, inspect your project dependencies using npm:

npm ls mqtt

Analyze the terminal output to locate any version of Mqtt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.15.0), your application is affected.

Note: The npm ls mqtt command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. In Mqtt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Affected versions of `mqtt` do not properly handle PUBLISH packets returning from the server, leading to a Denial of Service condition. The vulnerability is completely mitigated if the only connected servers are trusted, guaranteed not to be under the control of a malicious actor. ## Proof of Concept The following is a demonstration of how to generate the malicious packet sequence, but does not include information on handling the initial network connections and MQTT overhead. ``` var mqttp = require('mqtt-packet'); var packets = []; for(var i=0; i<=1000;i++){ packets.push( mqttp.generate({ cmd:'publish', topic:Buffer.from('hello'), payload:Buffer.from('world'), retain: false, dup: false, messageId: ++i, qos: 1 }) ) } ``` ## Recommendation Update to version 2.15.0 or later.

CVE-2017-10910 Affected Mqtt Versions

1 component(s)
Fixed Versions:
2.15.0
Product / Package Ecosystem Affected Versions Fixed Version
mqtt
npm
≥ 2.0.0
< 2.15.0
2.15.0

References

Frequently Asked Questions

What is CVE-2017-10910?
CVE-2017-10910 is a security vulnerability in Mqtt involving Denial of Service in mqtt under CWE-674: Uncontrolled Recursion.
Which Mqtt versions are affected?
Affected versions include releases prior to 2.15.0 across affected packages: mqtt.
What version fixes CVE-2017-10910?
Upgrading to 2.15.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mqtt affected?
Yes, mqtt is affected in releases prior to 2.15.0. Upgrade your dependency to 2.15.0 or later.
What is the CVSS score of CVE-2017-10910?
CVE-2017-10910 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2017-10910?
CVE-2017-10910 is classified under CWE-674: Uncontrolled Recursion (The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.).
How can I check npm dependencies for CVE-2017-10910?
Run the dependency tree command: 'npm ls mqtt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h9mj-fghc-664w",
  "modified" : "2021-09-14T17:16:40Z",
  "published" : "2017-12-28T22:51:58Z",
  "aliases" : [ "CVE-2017-10910" ],
  "summary" : "Denial of Service in mqtt",
  "details" : "Affected versions of `mqtt` do not properly handle PUBLISH packets returning from the server, leading to a Denial of Service condition.\n\nThe vulnerability is completely mitigated if the only connected servers are trusted, guaranteed not to be under the control of a malicious actor.\n\n## Proof of Concept\n\nThe following is a demonstration of how to generate the malicious packet sequence, but does not include information on handling the initial network connections and MQTT overhead.\n```\nvar mqttp = require('mqtt-packet');\nvar packets = [];\nfor(var i=0; i<=1000;i++){\n    packets.push(\n        mqttp.generate({\n            cmd:'publish',\n            topic:Buffer.from('hello'),\n            payload:Buffer.from('world'),\n            retain: false,\n            dup: false, \n            messageId: ++i, \n            qos: 1\n        })\n    )\n}\n\n```\n\n\n## Recommendation\n\nUpdate to version 2.15.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mqtt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.15.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-10910"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mqttjs/MQTT.js/commit/403ba53b838f2d319a0c0505a045fe00239e9923"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-h9mj-fghc-664w"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mqttjs/MQTT.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mqttjs/MQTT.js/releases/tag/v2.15.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/security-wg/blob/master/vuln/npm/357.json"
  }, {
    "type" : "WEB",
    "url" : "https://jvn.jp/en/jp/JVN45494523/index.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/555"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-674" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:39:48Z",
    "nvd_published_at" : null
  }
}