Cross-site Scripting (XSS) Affecting react-marked-markdown package, versions *


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDnpm:react-marked-markdown:20180517
  • published22 May 2018
  • disclosed17 May 2018
  • creditRon Perris

Introduced: 17 May 2018

CVE NOT AVAILABLE CWE-79  (opens in a new tab)

How to fix?

There is no fix version for react-marked-markdown.

Overview

react-marked-markdown is a react components package that helps you use Markdown easily.

Affected versions of this package are vulnerable to cross-site scripting (XSS) via href attributes. It uses marked.Render() but overwrites the link method with a custom version that doesn't correctly escape values passed to the href prop of anchor components.

Proof of concept:

import React from 'react'
import ReactDOM from 'react-dom'
import { MarkdownPreview } from 'react-marked-markdown'

ReactDOM.render( <MarkdownPreview markedOptions={{ sanitize: true }} value={'[XSS](javascript: alert1)'} />, document.getElementById('root') )

Details

<>

CVSS Scores

version 3.1