[FIX] Sanitize styles in message (#25744)

pull/25794/head
Yash Rajpal 4 years ago committed by GitHub
parent 707a62263e
commit b89ebfff4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/meteor/app/markdown/lib/parser/marked/marked.js

@ -100,7 +100,7 @@ export const marked = (message, { marked: { gfm, tables, breaks, pedantic, smart
const window = getGlobalWindow();
const DomPurify = createDOMPurify(window);
message.html = DomPurify.sanitize(message.html, { ADD_ATTR: ['target'] });
message.html = DomPurify.sanitize(message.html, { ADD_ATTR: ['target'], FORBID_ATTR: ['style'], FORBID_TAGS: ['style'] });
return message;
};

Loading…
Cancel
Save