Marked version 0.5.1 represents a minor but impactful update over its predecessor, version 0.5.0, focusing on enhanced developer tooling and dependency management. Both versions maintain their core function as "A markdown parser built for speed," offering developers a robust solution for rendering Markdown content. However, the changes under the hood are noteworthy.
Key improvements in 0.5.1 revolve around updated development dependencies. ESLint sees an upgrade from version 4.15.0 to 4.19.1, reflecting a commitment to code quality and adherence to modern JavaScript standards. Jasmine, the testing framework, is bumped from 3.1.0 to 3.2.0, bringing access to newer testing features and improvements. A significant change is the adoption of @markedjs/html-differ at version 2.0.0, replacing the older html-differ at 1.3.4, implying a potentially more streamlined or accurate HTML comparison for testing and validation. Several smaller updates occur in eslint-plugin-import, eslint-plugin-promise, eslint-config-standard, and eslint-plugin-standard, indicating a general effort to keep the development environment current and efficient. The showdown dependency, present in 0.5.0, is removed in 0.5.1 perhaps signaling a shift in testing or compatibility strategies within the project.
Developers choosing between these versions benefit from the updated tooling and potential bug fixes incorporated in the newer release. Version 0.5.1 promises a slightly more modern and refined development experience, which can translate to more stability and reliability in the long run. Both versions are MIT licensed and maintain the same author and repository, guaranteeing continuity in terms of project ownership and contribution.
All the vulnerabilities related to the version 0.5.1 of the package
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.
Regular Expression Denial of Service in marked
Affected versions of marked are vulnerable to Regular Expression Denial of Service (ReDoS). The _label subrule may significantly degrade parsing performance of malformed input.
Upgrade to version 0.7.0 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: