-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix stored XSS when rendering tooltips #4770
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Docker builds report
|
Uffizzi Preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this as I've tested all of the use cases described in the PR (and mentioned by a customer) so I'm happy that it fixes the immediate issue but I do think that the question I've added is a valid one that should be addressed at some point.
@@ -44,7 +45,7 @@ const Tooltip: FC<TooltipProps> = ({ | |||
) : ( | |||
<div | |||
style={{ wordBreak: 'break-word' }} | |||
dangerouslySetInnerHTML={{ __html: children }} | |||
dangerouslySetInnerHTML={{ __html: sanitize(children) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand why we're even using dangerouslySetInnerHTML
here at all? Shouldn't we be able to just render out the text as plain text?
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Fixes a stored XSS when rendering tooltips. This can be triggered with the following actions:
Example description payload:
How did you test this code?
Locally by performing the above actions and comparing them to the current release version of the frontend.