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 applicationsLearn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.
Start learningThere is no fix version for react-marked-markdown.
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') )
<>