-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Decode some html entities #835
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
Conversation
@@ -121,34 +121,33 @@ describe('svg+text utils', function() { | |||
}); | |||
|
|||
it('wrap XSS attacks in href', function() { | |||
var node = mockTextSVGElement( |
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.
reverting a commit from PR #804, as now <
, >
and "
are now back in play.
'amp': '&', | ||
'lt': '<', | ||
'gt': '>', | ||
'quot': '\"', |
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.
"
support makes me really uncomfortable since it's been part of so many of our XSS attacks (inserting a "
sometimes allows an entity to be terminated early).
Is this definitely needed?
(The rest looks OK to me.)
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.
No, it isn't definitely needed. I thought it was common enough to be part of the list. I'll drop it.
💃 |
In #804, we dropped html entity decoding for performance reasons, but apparently some folks have been using
&
,
, etc in their graphs. We need to bring back support for these ASAP.So, I propose supporting a few entities by translating them one-by-one to unicode.
This PR also DRYs up some code by making sure that
svg_text_utils.js
(for svg text) andhtml2unicode
(for WebGL text) use the same mappings.