See: https://www.drupal.org/SA-CORE-2015-003
http://cgit.drupalcode.org/drupal/commit/?h=7.x&id=731dfacab8bf39918c135...
A vulnerability was found that allows a malicious user to perform a cross-site scripting attack by invoking Drupal.ajax() on a whitelisted HTML element.
This vulnerability is mitigated on sites that do not allow untrusted users to enter HTML.
Drupal 6 core is not affected, but see the similar advisory for the Drupal 6 contributed Ctools module: SA-CONTRIB-2015-141.
Credit for the D6/D7 version of this patch (the security release):
regilero, droplet, japerry, samuel.mortenson, Pere Orga, nod_, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, tim.plunkett, David_Rothstein, larowlan, pwolanin, neclimdul, EclipseGc, znerol
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | core-xss-ajax-2554219-followup.patch | 543 bytes | effulgentsia |
| #9 | interdiff.txt | 8.62 KB | nod_ |
| #9 | core-xss-ajax-2554219-9.patch | 12.85 KB | nod_ |
| #6 | xss-ajax-2554219.6.patch | 12.61 KB | larowlan |
| #6 | interdiff.txt | 3.86 KB | larowlan |
Comments
Comment #2
webchickAdding folks from the CTools SA to the credit section as well.
Comment #3
tim.plunkettFirst pass at porting it, done with @effulgentsia.
Comment #5
larowlanthis function is gone now right? - we should reference AjaxResponseSubscriber now.
nit: >80
Will look at the fails next
Comment #6
larowlanshould fix fail, and addresses #5
Comment #7
nod_Originally wanted to put that on Drupal.url.
Any objection to renaming the functions ?
Comment #8
dawehner+1 for isAbsolute and isLocal
Comment #9
nod_Couple of updates:
Comment #10
tim.plunkettMy work in #3 was a straight port, the changes in #6 and #9 look great, thanks @larowlan and @nod_!
Comment #12
arlinsandbulte commentedLooks like this was committed, but not marked fixed...
Comment #13
effulgentsia commentedI reviewed and manually tested #9 and agree with #10, so committed and pushed to 8.0.x. Thanks for the nice improvements!
Here's some things that I think could use one or more non-critical follow-up issues, if someone cares to open it/them.
+1 to this name over the D7 version of urlIsAjaxTrusted. However, with this new name, should we pluralize it?
Both of these could benefit from test coverage. That test coverage would be nice to backport to 7.x as well.
D8 uses a version of jquery.form that only uses IFRAME transport for browsers that don't support XHR2, which I think is just IE9 at this point (among what D8 supports). Would be nice to improve this comment to mention that.
Elsewhere in D8's JS, we don't translate the message when throwing an error. I don't see why this one needs to be different.
D8 doesn't support IE 6 or 7, so can this function be simplified?
Comment #14
effulgentsia commentedOops.
drupalSettings.basePathisn't a thing in D8. We havedrupalSettings.path.baseUrlinstead. So, this broke all the modal links in Views UI. But the nojs fallbacks of those links still seem to work, so not sure whether to revert this, or try to get a quick fix in for that line instead. I'll check back in a couple hours to see if the latter is ready, and if not, will revert.Comment #16
effulgentsia commentedI didn't want to revert, so committed this instead.