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

Commit 01d7b79

Browse files
authored
Silence sanitize-html warning (#10334)
1 parent cef821c commit 01d7b79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/utils/Reply.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function stripPlainReply(body: string): string {
4444
return lines.join("\n");
4545
}
4646

47-
// Part of Replies fallback support
47+
// Part of Replies fallback support - MUST NOT BE RENDERED DIRECTLY - UNSAFE HTML
4848
export function stripHTMLReply(html: string): string {
4949
// Sanitize the original HTML for inclusion in <mx-reply>. We allow
5050
// any HTML, since the original sender could use special tags that we
@@ -56,6 +56,7 @@ export function stripHTMLReply(html: string): string {
5656
return sanitizeHtml(html, {
5757
allowedTags: false, // false means allow everything
5858
allowedAttributes: false,
59+
allowVulnerableTags: false, // silence xss warning, we won't be rendering directly this, so it is safe to do
5960
// we somehow can't allow all schemes, so we allow all that we
6061
// know of and mxc (for img tags)
6162
allowedSchemes: [...PERMITTED_URL_SCHEMES, "mxc"],

0 commit comments

Comments
 (0)