Closed (fixed)
Project:
Visualization API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 May 2013 at 13:12 UTC
Updated:
5 Apr 2015 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
guillaumev commentedHere is the patch.
Comment #2
rooby commentedComment #3
troybthompson commentedHrm, this doesn't seem to have helped my problem, I have a single quote in the label of a pie chart through views and it's still showing up as ' after applying the patch, clearing caches, etc.
Comment #4
flocondetoileSame issue here and patch provided don't resolve it.
A quick (and dirty) fix is to replace
check_plainbystr_replace(''', "'",Comment #5
mradcliffeThere are two issues.
1. Views should already be making the field values safe, and Visualization is double-encoding the text.
2. Highcharts is also doing its own HTML entity encoding.
When I removed the check_plain, this solved #1, but not #2. Instead I changed check_plain to html_entity_decode with ENT_QUOTES flag. I also did a manual test for security using field api text fields configured for plain text and filtered html text formats.
I have attached a test and screenshots.
Steps to test:
AAA & BBBCCC's AAA<span>blah</span><script>alert(document.cookie);</script>Results:
Comment #7
Niremizov commentedThe same behaviour have Google-Visualization API library.
I have also tested, what would happen if strip_tags and check_plain would be removed and html_entity_decode() would be used instead: Everything seems to look fine, and secure. Beause actually, chart library should be responsible for the way it uses strings and numbers, and we must be sure that data that we send data of appropriate type (number or string).
Fix would arrive soon.
Comment #8
Niremizov commentedIssue title update.
Comment #10
Niremizov commented