ZeroClipboard 1.3.1 ZeroClipboard.swf XSS

2014.02.09
Credit: JamesMGreene
Risk: Low
Local: No
Remote: Yes
CWE: CWE-79


CVSS Base Score: 4.3/10
Impact Subscore: 2.9/10
Exploitability Subscore: 8.6/10
Exploit range: Remote
Attack complexity: Medium
Authentication: No required
Confidentiality impact: None
Integrity impact: Partial
Availability impact: None

Multiple cross-site scripting (XSS) vulnerabilities in ZeroClipboard.swf in ZeroClipboard before 1.3.2, as maintained by Jon Rohan and James M. Greene, allow remote attackers to inject arbitrary web script or HTML via vectors related to certain SWF query parameters (aka loaderInfo.parameters). src/flash/ZeroClipboard.as @@ -49,13 +49,13 @@ package { // Allow the SWF object to communicate with a page on a different origin than its own (e.g. SWF served from CDN) if (flashvars.trustedOrigins && typeof flashvars.trustedOrigins === "string") { - var origins:Array = flashvars.trustedOrigins.split("\\").join("\\\\").split(","); + var origins:Array = ZeroClipboard.sanitizeString(flashvars.trustedOrigins).split(","); flash.system.Security.allowDomain.apply(null, origins); } // Enable complete AMD (e.g. RequireJS) and CommonJS (e.g. Browserify) support if (flashvars.jsModuleId && typeof flashvars.jsModuleId === "string") { - jsModuleId = flashvars.jsModuleId.split("\\").join("\\\\"); + jsModuleId = ZeroClipboard.sanitizeString(flashvars.jsModuleId); } // invisible button covers entire stage @@ -83,6 +83,16 @@ package { dispatch("load", ZeroClipboard.metaData()); } + // sanitizeString + // + // This private function will accept a string, and return a sanitized string + // to avoid XSS vulnerabilities + // + // returns an XSS safe String + private static function sanitizeString(dirty:String): String { + return dirty.replace(/\\/g,"\\\\") + } + // mouseClick // // The mouseClick private function handles clearing the clipboard, and @@ -99,7 +109,7 @@ package { // signal to the page it is done dispatch("complete", ZeroClipboard.metaData(event, { - text: clipText.split("\\").join("\\\\") + text: ZeroClipboard.sanitizeString(clipText) })); // reset the text

References:

https://github.com/zeroclipboard/zeroclipboard/releases/tag/v1.3.2
https://github.com/zeroclipboard/zeroclipboard/pull/335
https://github.com/zeroclipboard/zeroclipboard/commit/2f9eb9750a433965572d047e24b0fc78fd1415ca


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top