Skip to content
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 XSS vulnerability via unsafe rendering of objects in link text #1483

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

mikesname
Copy link
Contributor

We (sloppily and unnecessarily) wrapped object toStrings in Html() when rendering links. This resulted in a vulnerability where a user could put XSS in their name and it would be rendered via name links.

This is fixed via a better separation between text and html content passed to the link renderering partial and by not arbitrarily assuming names are safe. Additionally, the highlighter has another method for explicitely non-tagged text which is sanitised.

TODO: more auditing of the existing highlighting method, which needs to handle mixed content. Possibly server-side scrubbing of some fields.

Fixes #1482

We (sloppily and unnecessarily) wrapped object toStrings in Html() when
rendering links. This resulted in a vulnerability where a user could put
XSS in their name and it would be rendered via name links.

This is fixed via a better separation between text and html content
passed to the link renderering partial and by not arbitrarily assuming
names are safe. Additionally, the highlighter has another method for
explicitely non-tagged text which is sanitised.

TODO: more auditing of the existing highlighting method, which needs
to handle mixed content. Possibly server-side scrubbing of some fields.

Fixes EHRI#1482
@mikesname mikesname merged commit 715b5e4 into EHRI:master Sep 21, 2023
1 check passed
@mikesname mikesname deleted the bugfix/fix_1482 branch September 21, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XSS Injection in profile name & notes
1 participant