Marked is a lightweight and speedy markdown parser designed for developers who need efficient and reliable conversion of markdown text into HTML. Examining versions 0.1.0 and 0.1.1, we see a quick iterative improvement in this early stage of the library's development. While both versions share the same core description and author, "Christopher Jeffrey," the primary difference lies in their releaseDate, showing a roughly month-long gap between versions. Version 0.1.0 was released on September 15, 2011, and version 0.1.1 followed on October 14, 2011. This suggests that version 0.1.1 likely contains bug fixes, minor performance enhancements, or small feature additions implemented based on initial user feedback or internal testing within that timeframe. Developers considering using Marked should note the simplicity of the package. It is dependency-free, offering a clean and unbloated solution for markdown parsing. Both versions point to the same Git repository on GitHub, indicating the project was already open-source and community-driven. The tarball URLs provided in the dist sections allow direct download of each version from the npm registry. While the specific changes between these versions aren't explicitly listed in this metadata, upgrading from 0.1.0 to 0.1.1 is generally recommended to benefit from any potential stability improvements and fixes.
All the vulnerabilities related to the version 0.1.1 of the package
Multiple Content Injection Vulnerabilities in marked
Versions 0.3.0 and earlier of marked
are affected by two cross-site scripting vulnerabilities, even when sanitize: true
is set.
The attack vectors for this vulnerability are GFM Codeblocks and JavaScript URLs.
Upgrade to version 0.3.1 or later.
VBScript Content Injection in marked
Versions 0.3.2 and earlier of marked
are affected by a cross-site scripting vulnerability even when sanitize:true
is set.
[xss link](vbscript:alert(1))
will get a link
<a href="vbscript:alert(1)">xss link</a>
Update to version 0.3.3 or later.
Regular Expression Denial of Service in marked
Versions 0.3.3 and earlier of marked
are affected by a regular expression denial of service ( ReDoS ) vulnerability when passed inputs that reach the em
inline rule.
Update to version 0.3.4 or later.
Sanitization bypass using HTML Entities in marked
Affected versions of marked
are susceptible to a cross-site scripting vulnerability in link components when sanitize:true
is configured.
This flaw exists because link URIs containing HTML entities get processed in an abnormal manner. Any HTML Entities get parsed on a best-effort basis and included in the resulting link, while if that parsing fails that character is omitted.
For example:
A link URI such as
javascript֍ocument;alert(1)
Renders a valid link that when clicked will execute alert(1)
.
Update to version 0.3.6 or later.
Marked vulnerable to XSS from data URIs
marked version 0.3.6 and earlier is vulnerable to an XSS attack in the data: URI parser.
Regular Expression Denial of Service in marked
Affected versions of marked
are vulnerable to a regular expression denial of service.
The amplification in this vulnerability is significant, with 1,000 characters resulting in the event loop being blocked for around 6 seconds.
Update to version 0.3.9 or later.
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.
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: