mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(editor): Fixing XSS vulnerability in toast messages (#10329)
Co-authored-by: Adi <aditya@netroy.in>
This commit is contained in:
committed by
GitHub
parent
b6c47c0e32
commit
38bdd9f5d0
@@ -18,6 +18,10 @@ export function sanitizeHtml(dirtyHtml: string) {
|
||||
}
|
||||
|
||||
if (ALLOWED_HTML_ATTRIBUTES.includes(name) || name.startsWith('data-')) {
|
||||
// href is allowed but we need to sanitize certain protocols
|
||||
if (name === 'href' && !value.match(/^https?:\/\//gm)) {
|
||||
return '';
|
||||
}
|
||||
return `${name}="${friendlyAttrValue(value)}"`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user