Skip to content

Draft: Disallow style attrs and tags in DOMPurify's default Configuration

Dheeraj Joshi requested to merge djadmin-dompurify-forbid-styles into master

What does this MR do and why?

DOMPurify allows style tags and attributes by default.

This MR is adding a default configuration to DOMPurify to remove all the tags / attrs which can potentially mutate page stylings. This is to add defense-in-depth and avoid issues like phishing attacks with the help of HTML Injection.

Some related discussions at #342988 (comment 705893457).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #343207 (closed)

Edited by Dheeraj Joshi

Merge request reports

Loading