Skip to content

Commit

Permalink
Merge pull request #283 from joker314/patch-1
Browse files Browse the repository at this point in the history
Prevent XSS in images
  • Loading branch information
alex authored Mar 3, 2018
2 parents 697b745 + 50bb41c commit 0c10790
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/client/src/util/mrk.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const withState = state => {
</a>`,

image({ metadata }) {
const src = mark.escapeHTML(metadata.src)
const src = mark.sanitizeURL(mark.escapeHTML(metadata.src))
const alt = mark.escapeHTML(metadata.alt)

return `<a href='${src}' target='_blank' class='Message-image'>
Expand Down

0 comments on commit 0c10790

Please sign in to comment.