kbase / kbase-ui

kbase-ui components
MIT License
10 stars 22 forks source link

organizations: Add DOMPurify to sanitize markup. #1603

Closed dakotablair closed 2 years ago

dakotablair commented 2 years ago

Update organizations to 2.1.12

Description

Typically dangerouslySetInnerHTML is to be avoided, but by using Marked we need it. Before this PR, the HTML resulting from Marked is too permissive, so this PR introduces DOMPurify to sanitize it before rendering it for the user. This makes DOMPurify a new dependency for the organizations plugin.

Testing Instructions

Test by attempting to put unsafe markup into an organization description. Any unsafe markup should not render.

Dev Checklist