The dangerouslySetInnerHTML React property was being used by Notification components to allow formatting of the message by embedding HTML elements directly in the message. This flexibility can become a security issue because messages might include data provided by users (e.g. document IDs), in which case it can be used for HTML injection.
This PR removes uses of dangerouslySetInnerHTML in the Notification components in favor of embedding the input msg as a normal React node, which then is properly sanitized by React.
Testing recommendations
Test notifications: e.g. create or delete a document and validate the notification is still displayed.
GitHub issue number
n/a
Related Pull Requests
n/a
Checklist
[x] Code is written and works correctly;
[ ] Changes are covered by tests;
[ ] Documentation reflects the changes;
[ ] Update rebar.config.script with the correct tag once a new Fauxton release is made
Overview
The
dangerouslySetInnerHTML
React property was being used by Notification components to allow formatting of the message by embedding HTML elements directly in the message. This flexibility can become a security issue because messages might include data provided by users (e.g. document IDs), in which case it can be used for HTML injection.This PR removes uses of
dangerouslySetInnerHTML
in the Notification components in favor of embedding the input msg as a normal React node, which then is properly sanitized by React.Testing recommendations
Test notifications: e.g. create or delete a document and validate the notification is still displayed.
GitHub issue number
n/a
Related Pull Requests
n/a
Checklist