fix(editor): Prevent clipboard xss injection (#10894)

This commit is contained in:
Raúl Gómez Morales
2024-09-20 12:51:18 +02:00
committed by GitHub
parent 48294e7ec1
commit e20ab59c1d
4 changed files with 18 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
import xss, { friendlyAttrValue } from 'xss';
import xss, { escapeAttrValue } from 'xss';
import { ALLOWED_HTML_ATTRIBUTES, ALLOWED_HTML_TAGS } from '@/constants';
/*
@@ -22,7 +22,7 @@ export function sanitizeHtml(dirtyHtml: string) {
if (name === 'href' && !value.match(/^https?:\/\//gm)) {
return '';
}
return `${name}="${friendlyAttrValue(value)}"`;
return `${name}="${escapeAttrValue(value)}"`;
}
return;