Bypasses Same Origin Policy checks via toDataURL()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
WebApps: unity-chromium-extensions |
Fix Released
|
Undecided
|
Alexandre Abreu | ||
WebApps: unity-firefox-extension |
Fix Released
|
Undecided
|
Maxim Ermilov | ||
unity-chromium-extension (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Quantal |
Fix Released
|
Undecided
|
Unassigned | ||
unity-firefox-extension (Ubuntu) |
Fix Released
|
Undecided
|
Ken VanDine | ||
Quantal |
Fix Released
|
Undecided
|
Unassigned | ||
unity-webapps-amazoncloudreader (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
unity-webapps-facebookapps (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
unity-webapps-librefm (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
unity-webapps-pandora-com (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
webapps-applications (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This addon exposes a toDataURL() function to the web which allows content to convert an image (specified by a URL) to a data URI. It seems to work by drawing the image to a canvas and using the canvas.toDataURL() mechanism. However, this function seems to bypass all same-origin checks and returns valid data even if the image URL doesn't have the same origin as the document URL.
canvas.toDataURL() will throw a SecurityError exception if the canvas is not origin-clean. A canvas is not origin clean if you call ctx.drawImage() with a URL which does not have the same origin as the document that the canvas is in. However, the canvas used for the conversion is created in chrome context, so it has full privileges and the usual security mechanisms are bypassed completely.
[Test Case]
This can be reproduced with the following test case (I loaded this at http://
<html>
<head></head>
<body>
<p id="foo"/>
<script type="text/
window.external
});
</script>
</html>
In this example, you will see that toDataURL() throws as expected and an alert appears ("The operation is insecure"):
<html>
<head></head>
<body>
<p id="foo"/>
<script type="text/
var img = new Image();
var canvas = document.
var ctx = canvas.
img.onload = function() {
try {
} catch(e) { alert(e); }
};
img.src = "http://
</script>
</html>
[Regression Risks]
The fix consists mostly in removing code from the exposed API (toDataURL).
Related branches
- PS Jenkins bot (community): Approve (continuous-integration)
- WebApps: Pending requested
-
Diff: 66 lines (+25/-8)1 file modifiedunity-firefox-extension/content/unity-api.js (+25/-8)
- Alexandre Abreu (community): Approve
-
Diff: 66 lines (+23/-9)2 files modifiedchromium-extension/unity-api-page-proxy-builder-gen.js (+0/-4)
chromium-extension/unity-api.js (+23/-5)
CVE References
Changed in unity-firefox-extension: | |
assignee: | nobody → Maxim Ermilov (zaspire) |
Changed in unity-firefox-extension: | |
status: | New → Fix Committed |
Changed in unity-chromium-extension: | |
status: | New → Fix Committed |
assignee: | nobody → Alexandre Abreu (abreu-alexandre) |
description: | updated |
Changed in unity-chromium-extension: | |
status: | Fix Committed → Fix Released |
Changed in unity-firefox-extension: | |
status: | Fix Committed → Fix Released |
Changed in unity-firefox-extension (Ubuntu): | |
status: | Fix Committed → Fix Released |
no longer affects: | webapps-applications (Ubuntu Quantal) |
This is CVE-2012-0958