Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(928)

Issue 286220043: Sanitize Google Visualization API parameters. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 2 months ago by kpreid_google
Modified:
8 years ago
Reviewers:
felix8a, MarkM
CC:
Jasvir, ihab.awad, MikeSamuel, kpreid2, metaweta, caja-discuss-undisclosed_googlegroups.com, MarkM, felix8a, straka
Visibility:
Public.

Description

The existing taming attempted to prevent the allowHtml option from being set, but did not filter all of the means of setting options. Additionally, there are other parameters that can be used to enable interpretation of some fields as HTML. Therefore, introduce sanitization for inputs to the API, based on whitelists of allowed keys in objects. (This is not fully strict; many parameters are allowed to be arbitrary strings where their definition does not seem likely to later permit arbitrary HTML.) Also added some automated tests which will check for HTML leakage and could be extended to be general functionality tests. Committed as 01ed526f784ecf0121f64dd3c891faaaef6cf2fc .

Patch Set 1 #

Patch Set 2 : Sanitize Google Visualization API parameters. #

Total comments: 6

Patch Set 3 : Sanitize Google Visualization API parameters. #

Total comments: 15

Patch Set 4 : Sanitize Google Visualization API parameters. #

Total comments: 4

Patch Set 5 : Sanitize Google Visualization API parameters. #

Patch Set 6 : Sanitize Google Visualization API parameters. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1162 lines, -118 lines) Patch
M src/com/google/caja/apitaming/google.visualization.policyFactory.js View 1 2 3 4 30 chunks +907 lines, -88 lines 0 comments Download
D tests/com/google/caja/apitaming/test-onclick.html View 1 chunk +0 lines, -28 lines 0 comments Download
A tests/com/google/caja/apitaming/test-security.js View 1 2 3 1 chunk +89 lines, -0 lines 0 comments Download
A tests/com/google/caja/apitaming/test-security-guest.html View 1 2 3 4 1 chunk +154 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/apitaming-tests.json View 2 chunks +6 lines, -1 line 0 comments Download
M tests/com/google/caja/plugin/test-apitaming.js View 1 2 3 4 5 5 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 18
kpreid_google
8 years, 2 months ago (2016-02-09 17:00:57 UTC) #1
kpreid_google
Note: This is not yet complete; in addition to some TODOs, I just haven't finished ...
8 years, 2 months ago (2016-02-09 17:02:49 UTC) #2
metaweta
I won't have time to get to this for a few days. On Tue, Feb ...
8 years, 2 months ago (2016-02-09 17:08:49 UTC) #3
kpreid_google
On 2016/02/09 17:08:49, metaweta wrote: > I won't have time to get to this for ...
8 years, 2 months ago (2016-02-09 17:10:22 UTC) #4
kpreid_google
The existing taming attempted to prevent the allowHtml option from being set, but did not ...
8 years, 2 months ago (2016-02-10 01:49:05 UTC) #5
MarkM
Passed my eye over everything in case anything jumped out. Nothing did, but much I ...
8 years, 2 months ago (2016-02-10 04:54:30 UTC) #6
kpreid_google
The existing taming attempted to prevent the allowHtml option from being set, but did not ...
8 years, 2 months ago (2016-02-10 19:41:48 UTC) #7
kpreid_google
This is now complete — I've eyeballed all the manual side-by-side tests for as-good-as-they-used-to-be results. ...
8 years, 2 months ago (2016-02-10 19:43:16 UTC) #8
felix8a
meta: I haven't looked at the gviz taming before. This is punishingly difficult to audit, ...
8 years, 2 months ago (2016-02-11 09:53:11 UTC) #9
kpreid_google
The existing taming attempted to prevent the allowHtml option from being set, but did not ...
8 years, 2 months ago (2016-02-11 18:37:32 UTC) #10
kpreid_google
https://codereview.appspot.com/286220043/diff/40001/src/com/google/caja/apitaming/google.visualization.policyFactory.js File src/com/google/caja/apitaming/google.visualization.policyFactory.js (right): https://codereview.appspot.com/286220043/diff/40001/src/com/google/caja/apitaming/google.visualization.policyFactory.js#newcode638 src/com/google/caja/apitaming/google.visualization.policyFactory.js:638: 'type': String, // TODO(kpreid): tighten up to enum On ...
8 years, 2 months ago (2016-02-11 18:38:01 UTC) #11
felix8a
https://codereview.appspot.com/286220043/diff/40001/src/com/google/caja/apitaming/google.visualization.policyFactory.js File src/com/google/caja/apitaming/google.visualization.policyFactory.js (right): https://codereview.appspot.com/286220043/diff/40001/src/com/google/caja/apitaming/google.visualization.policyFactory.js#newcode650 src/com/google/caja/apitaming/google.visualization.policyFactory.js:650: case 'number': On 2016/02/11 18:38:01, kpreid_google wrote: > On ...
8 years, 2 months ago (2016-02-11 19:16:58 UTC) #12
kpreid_google
The existing taming attempted to prevent the allowHtml option from being set, but did not ...
8 years, 2 months ago (2016-02-11 19:44:16 UTC) #13
kpreid_google
https://codereview.appspot.com/286220043/diff/40001/src/com/google/caja/apitaming/google.visualization.policyFactory.js File src/com/google/caja/apitaming/google.visualization.policyFactory.js (right): https://codereview.appspot.com/286220043/diff/40001/src/com/google/caja/apitaming/google.visualization.policyFactory.js#newcode650 src/com/google/caja/apitaming/google.visualization.policyFactory.js:650: case 'number': On 2016/02/11 19:16:58, felix8a wrote: > I'd ...
8 years, 2 months ago (2016-02-11 19:44:54 UTC) #14
felix8a
lgtm
8 years, 2 months ago (2016-02-11 19:45:39 UTC) #15
kpreid_google
The existing taming attempted to prevent the allowHtml option from being set, but did not ...
8 years, 2 months ago (2016-02-11 20:45:24 UTC) #16
kpreid_google
New snapshot 6 just removes a useless assignment to an undefined variable, in test-apitaming.js, that ...
8 years, 2 months ago (2016-02-11 20:46:33 UTC) #17
felix8a
8 years, 2 months ago (2016-02-11 20:47:38 UTC) #18
lgtm
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b