Marked, a popular markdown parser known for its speed, released version 2.1.1 shortly after 2.1.0, offering subtle yet potentially impactful changes for developers. While both versions share the same core set of development dependencies, including tools for linting, bundling, testing, and semantic releases, a closer look reveals interesting differences.
One primary distinction lies in the dist object. Version 2.1.1 has an unpacked size of 309673 bytes, slightly smaller than version 2.1.0's 310303 bytes. This suggests potential optimizations or minor code adjustments that resulted in a reduced footprint. The release dates also pinpoint the timeframe: 2.1.0 was released on June 15, 2021, and 2.1.1 was released a day later on June 16, 2021, implying a quick hotfix or minor update.
For developers leveraging Marked, the choice between 2.1.0 and 2.1.1 hinges on the need for the most up-to-date, potentially optimized version. Although the differences are subtle, adopting 2.1.1 ensures access to any bug fixes addressed in the rapid update. Both versions benefit from a robust development ecosystem with tools like ESLint, Rollup, and semantic-release streamlining the development process and promoting code quality and automated releases. They both use the same MIT license, have the same author and the same repository. Ultimately, the upgrade offers developers the latest iteration of this efficient markdown parser.
All the vulnerabilities related to the version 2.1.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: