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

Issue 32092: Allow dynamic script loading via proxy (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years, 8 months ago by MikeSamuel
Modified:
17 years, 4 months ago
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Modifies domita to allow creation and manipulation of script elements. Cajoled code can now create a script element, set its "src" attribute to a URL passed through the url policy with the mime-type text/javascript, and add that script to the DOM. It cannot modify the textual content of a script element. Outstanding questions: do we need to prevent replay attacks and if so how? If code can get a handle to a script element from the container, it can clone it and add it to the DOM, possibly replaying script already executed by the container. Still TODO: http://code.google.com/p/google-caja/wiki/UrlPolicy Submitted @3406

Patch Set 1 #

Patch Set 2 : Allow dynamic script loading via proxy #

Patch Set 3 : Allow dynamic script loading via proxy #

Total comments: 4

Patch Set 4 : Allow dynamic script loading via proxy #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -72 lines) Patch
M src/com/google/caja/lang/html/HtmlDefinitions.java View 1 2 3 chunks +10 lines, -1 line 0 comments Download
M src/com/google/caja/parser/html/DomParser.java View 3 chunks +3 lines, -3 lines 1 comment Download
M src/com/google/caja/plugin/domita.js View 1 2 3 26 chunks +92 lines, -44 lines 3 comments Download
M src/com/google/caja/plugin/html-sanitizer.js View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/plugin/domita_test.html View 1 2 6 chunks +135 lines, -5 lines 0 comments Download
M tests/com/google/caja/plugin/domita_test_untrusted.html View 1 2 3 4 chunks +63 lines, -17 lines 0 comments Download
A tests/com/google/caja/plugin/whitelisted_script.js View 1 chunk +31 lines, -0 lines 0 comments Download

Messages

Total messages: 7
MikeSamuel
17 years, 8 months ago (2009-03-31 22:58:57 UTC) #1
MikeSamuel
This moots outstanding issue 28071. It probably makes sense to review domita_test_untrusted.html, then domita.js, and ...
17 years, 8 months ago (2009-03-31 23:01:10 UTC) #2
MikeSamuel
17 years, 8 months ago (2009-04-02 22:55:10 UTC) #3
metaweta
LGTM http://codereview.appspot.com/32092/diff/1008/1014 File src/com/google/caja/plugin/domita.js (right): http://codereview.appspot.com/32092/diff/1008/1014#newcode2832 Line 2832: classUtils.exportFields( whitespace http://codereview.appspot.com/32092/diff/1008/1014#newcode2889 Line 2889: return new ...
17 years, 8 months ago (2009-04-02 23:36:51 UTC) #4
MikeSamuel
http://codereview.appspot.com/32092/diff/1008/1011 File tests/com/google/caja/plugin/domita_test_untrusted.html (right): http://codereview.appspot.com/32092/diff/1008/1011#newcode944 Line 944: s.innerText = 'globalSideEffect()'; // IE only, so failsafe. ...
17 years, 8 months ago (2009-04-02 23:57:12 UTC) #5
MikeSamuel
Added tests and snapshotted
17 years, 8 months ago (2009-04-03 20:49:43 UTC) #6
ben
17 years, 8 months ago (2009-04-09 08:56:43 UTC) #7
Sorry for the delay (and puzzled that this issue is marked closed?)

http://codereview.appspot.com/32092/diff/20/25
File src/com/google/caja/parser/html/DomParser.java (right):

http://codereview.appspot.com/32092/diff/20/25#newcode277
Line 277: MessageType.MALFORMED_XHTML, FilePosition.span(start, last.pos),
Unrelated change?

http://codereview.appspot.com/32092/diff/20/27
File src/com/google/caja/plugin/domita.js (left):

http://codereview.appspot.com/32092/diff/20/27#oldcode2349
Line 2349: if (!this.editable___) { throw new Error(NOT_EDITABLE); }
Why remove this check?

http://codereview.appspot.com/32092/diff/20/27
File src/com/google/caja/plugin/domita.js (right):

http://codereview.appspot.com/32092/diff/20/27#newcode1706
Line 1706: editable = false;
Should throw an error rather than correct bad programming habit...

http://codereview.appspot.com/32092/diff/20/27#newcode2075
Line 2075: return listener;
This seems to be an unrelated change?
Sign in to reply to this message.

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