-
Notifications
You must be signed in to change notification settings - Fork 6
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
HTML injection in phenogrid tooltips (and <AppNodeBadge> more generally) #902
Comments
The injection bug was introduced in c106f34. @kevinschaper, do you remember why you decided you needed to pass HTML rather than text? It looks like it's to support entity labels that contain HTML, like |
Yeah, it’s for display of html in genotype names, but it really is more that we want to allow sup tags than any html. |
I’m used to there being both html and ascii representations of genotypes, and it makes sense that they kind of require the opposite setting. Right now we’re using provided genotype names that are the html version where alleles are in sup tags (example here), and IMPC is passing the ascii equivalent where the alleles are in angle brackets. |
It's also worth noting that the phenogrid is rendered with SVG, and |
There are a couple more places where These two are node names, so they can use the new monarch-app/frontend/src/pages/node/SectionTitle.vue Lines 27 to 31 in ce0851b
monarch-app/frontend/src/pages/node/SectionOverview.vue Lines 74 to 78 in ce0851b
This one is a node's description. @kevinschaper, can you point to an example where a node description has HTML in it? monarch-app/frontend/src/pages/node/SectionOverview.vue Lines 30 to 35 in ce0851b
|
Oh, I see that there are a couple thousand entities with
|
There are 41 nodes that have HTML in the description. Additionally, there are two that include the text "..." that will be misrendered if passed as HTML text that will be misrendered if rendered as HTML (2)
|
As described in #887 (comment), there is an HTML injection bug in the phenogrid component. The offending code is here:
monarch-app/frontend/src/components/ThePhenogrid.vue
Lines 183 to 203 in ce0851b
The
name
property in<AppNodeBadge>
(which can be user generated for columns in the multicompare mode of phenogrid) is passed as raw HTML here:monarch-app/frontend/src/components/AppNodeBadge.vue
Lines 13 to 27 in ce0851b
This breaks on labels that contain strings that can be parsed as HTML tags, such as
66.45-Dsg2<tm1a(EUCOMM)Wtsi>/Dsg2<tm1a(EUCOMM)Wtsi>
, or, for script injection fun,Group Label <script type="text/javascript">console.alert('hi')</script>
. As a rule, it is not good to render user-generated text directly as HTML. (The Vue documentation agrees).This issue would also show itself if there were ever an entity in the monarch KG that had a name with some <angled brackets> in it.
The text was updated successfully, but these errors were encountered: