Marked is a popular and speedy markdown parser designed for JavaScript environments, offering developers a quick way to convert Markdown syntax into HTML. Examining versions 0.3.13 and 0.3.14 reveals minimal differences, primarily in their release timestamps. Both versions share identical descriptions, development dependencies, licensing under the MIT license, and repository information, indicating a high degree of similarity in codebase and functionality. Developers relying on Marked for their Markdown processing needs will find both versions functionally equivalent, leveraging external libraries such as markdown, showdown, markdown-it, front-matter, glob-to-regexp, and uglify-js for handling various tasks.
Specifically, the devDependencies section suggests the library likely includes some features which might need markdown pre-processing or post-processing and minification using uglify-js. The file count (15) and unpacked size (75158 bytes) are consistent across both versions, suggesting no significant structural or size-related changes. The key differentiation lies in the releaseDate: version 0.3.14 was released shortly after 0.3.13. This likely means at least one non-breaking change happened between the versions.
For practical purposes, developers upgrading from 0.3.13 to 0.3.14 should expect the same core Markdown parsing abilities and dependency behavior. The upgrade is expected to be smooth.
All the vulnerabilities related to the version 0.3.14 of the package
Marked allows Regular Expression Denial of Service (ReDoS) attacks
Marked prior to version 0.3.17 is vulnerable to a Regular Expression Denial of Service (ReDoS) attack due to catastrophic backtracking in several regular expressions used for parsing HTML tags and markdown links. An attacker can exploit this vulnerability by providing specially crafted markdown input, such as deeply nested or repetitively structured brackets or tag attributes, which cause the parser to hang and lead to a Denial of Service.
Marked ReDoS due to email addresses being evaluated in quadratic time
Versions of marked
from 0.3.14 until 0.6.2 are vulnerable to Regular Expression Denial of Service. Email addresses may be evaluated in quadratic time, allowing attackers to potentially crash the node process due to resource exhaustion.
Upgrade to version 0.6.2 or later.
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: