Skip to content

Conversation

@etpinard
Copy link
Contributor

@etpinard etpinard commented Aug 9, 2016

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) and html2unicode (for WebGL text) use the same mappings.

- use it in html2unicode and svg_text_utils to
  translate a limited set of HTML enitity to unicode
- list unicode-to-entities mappings
  (used in svg text style and anchors)
- this commit partly reverts 6cf80de
@etpinard etpinard added bug something broken status: reviewable labels Aug 9, 2016
});

it('wrap XSS attacks in href', function() {
var node = mockTextSVGElement(
Copy link
Contributor Author

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.

@etpinard
Copy link
Contributor Author

etpinard commented Aug 9, 2016

@scjody the most important commit is ba6320e

'amp': '&',
'lt': '<',
'gt': '>',
'quot': '\"',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&quot; 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.)

Copy link
Contributor Author

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.

@scjody
Copy link

scjody commented Aug 9, 2016

💃

@etpinard etpinard merged commit c47a2db into master Aug 9, 2016
@etpinard etpinard deleted the decode-some-html-entities branch August 9, 2016 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug something broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants