Marked version 2.0.1 is a minor release following closely on the heels of the 2.0.0 version, continuing the evolution of this popular and speedy markdown parser. Examining the changes between the two reveals a focus on dependency updates, indicating efforts to maintain compatibility, security, and potentially introduce performance improvements. Both versions share the same core description: "A markdown parser built for speed," reaffirming the library's primary goal.
Developers considering an upgrade should note the updated devDependencies. While these don't directly affect runtime code, they signal a commitment to modern development practices. Key updates include eslint jumping from version 7.19.0 to 7.20.0 and @babel/core moving from 7.12.10 to 7.12.17. highlight.js was upgraded from 10.5.0 to 10.6.0, and @rollup/plugin-babel went from 5.2.3 to 5.3.0. Even semantic-release was updated, which usually means a better build and packaging procedure.
The size of the unpacked code has also increased, as well as the release time between the two versions is considerable. While subtle, these dependency updates reflect a continuing effort to stay current with the JavaScript ecosystem which can be especially relevant for projects relying on the latest features or requiring specific toolchain compatibility.
All the vulnerabilities related to the version 2.0.1 of the package
Inefficient Regular Expression Complexity in marked
What kind of vulnerability is it?
Denial of service.
The regular expression inline.reflinkSearch
may cause catastrophic backtracking against some strings.
PoC is the following.
import * as marked from 'marked';
console.log(marked.parse(`[x]: x
\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](`));
Who is impacted?
Anyone who runs untrusted markdown through marked and does not use a worker with a time limit.
Has the problem been patched?
Yes
What versions should users upgrade to?
4.0.10
Is there a way for users to fix or remediate the vulnerability without upgrading?
Do not run untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
Are there any links users can visit to find out more?
If you have any questions or comments about this advisory:
Inefficient Regular Expression Complexity in marked
What kind of vulnerability is it?
Denial of service.
The regular expression block.def
may cause catastrophic backtracking against some strings.
PoC is the following.
import * as marked from "marked";
marked.parse(`[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} x`);
Who is impacted?
Anyone who runs untrusted markdown through marked and does not use a worker with a time limit.
Has the problem been patched?
Yes
What versions should users upgrade to?
4.0.10
Is there a way for users to fix or remediate the vulnerability without upgrading?
Do not run untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
Are there any links users can visit to find out more?
If you have any questions or comments about this advisory: