Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 8ae210c

Browse files
committed
Revert #333
Revert https://github.com/matrix-org/matrix-react-sdk/pull/333/files since sanitizer blindly allows urls with no scheme, meaning // links can be used to fetch images over whatever scheme you serve vector over (ie. normally http/https).
1 parent b83d1db commit 8ae210c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/HtmlUtils.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var sanitizeHtmlParams = {
8787
// deliberately no h1/h2 to stop people shouting.
8888
'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
8989
'nl', 'li', 'b', 'i', 'u', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
90-
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'img',
90+
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre'
9191
],
9292
allowedAttributes: {
9393
// custom ones first:
@@ -101,9 +101,7 @@ var sanitizeHtmlParams = {
101101
selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ],
102102
// URL schemes we permit
103103
allowedSchemes: [ 'http', 'https', 'ftp', 'mailto' ],
104-
allowedSchemesByTag: {
105-
img: [ 'data' ],
106-
},
104+
allowedSchemesByTag: {},
107105

108106
transformTags: { // custom to matrix
109107
// add blank targets to all hyperlinks except vector URLs

0 commit comments

Comments
 (0)