Data validation
Protecting sensitive data
false within crossdomain.xml filesallowInsecureDomain() method for SWF communicationallowDomain() settings to specific domainsexactSettings setting in Flash PlayerCross-domain communication
allowDomain() settingsLoader.loadBytes or setting the securityDomain in LoaderContextexactSettings flag in Flash PlayerloadPolicyFile()Preventing cross-site scripting attacks
allowScriptAccess and allowNetworking parameters
within the HTML codehttp:// and https:// protocols are
allowed; validate that the URL is for an allowed domain or use relative URLsSpoofing
Information Disclosures
Explicitly set the allowScriptAccess, allowNetworking,
and allowFullScreen settings for each SWF. By explicitly setting these
values for all SWF files, administrators can ensure that the SWF files only
have the access the administrator wants to grant and will not rely on Flash
Player defaults for the compiled version when the SWF interacts within the web page.
Link to untrusted SWF files from your own domain by IP address rather than domain name. Referencing the untrusted SWF files by IP address will put them in a separate Flash Player security domain than the SWF files that are referenced by their domain name (e.g., http://1.2.3.4/my.swf does not have access to http://www.mysite.com/myOtherSWF.swf even though they are on the same server). Avoid using the IP address that is associated with your domain name via DNS.
Avoid specifying wildcards
in cross-domain policy files. Use restrictive crossdomain.xml files for
allowing access to only sites that are explicitly trusted. Limit the number of headers you accept only to those necessary for your application. Use wildcards on
sub-domains such as *.mysite.com where possible avoid setting allow-access-from domain="*".
Use commas ("456,457,468") and ranges ("456-458") on port
settings to avoid setting to-ports="*" within the socket policy files.
Use sub-directory crossdomain.xml files to avoid
putting domain="*" in the root crossdomain.xml file. By
utilizing sub-directory crossdomain.xml files, web administrators can put domain="*" only in the parts of the website that really need to be accessible to all
domains.
Utilize the meta-policy directives. The meta-policy system can help to ensure that only the cross-domain policies created by the administrator are recognized by Flash Player. Placing a master socket policy file with meta-policies on port 843 can help restrict what ports are allowed to host additional socket policy files. If no access is intended for your site then create an HTTP cross-domain file with a site-control meta-policy of "none" and no allowed domains listed. It is better to use the HTTP meta-policy of "by-content-type" than "all" for sites that contain multiple cross-domain policy files. If you select "all" and your site provides end-user upload functionality, then you should take into account the threat of end-users who will try to upload malicious cross-domain policies to your site.
If a SWF application has already been authored and it is now necessary to review the code looking for potential vulnerabilities, the methods listed below perform critical data operations that are useful to examine as part of your review process.
Functions that display HTML code:
TextArea.htmlText
Functions that make networking calls:
FileReference.download(), FileReference.upload(), Loader.load, LocalConnection.connect(), NetConnection.connect(), NetStream.play(), Security.loadPolicyFile(), SharedObject.getLocal(),SharedObject.getRemote(), Socket.connect, Sound.load(), URLLoader.load(), URLStream.load(), XMLSocket.connect(), ExternalInterface.call(), navigateToURL(), sendToURL()
Functions and objects that accept URLs:
URLRequest(), NetConnection.connect(), XMLSocket(), XMLSocket.connect(), NetStream.play(), TextFormat.url, FLVPlayback.load(), FLVPlayback.play(), FLVPlayback.source, FLVPlayback.skin, FLVPlaybackCaptioning.source, ImageCell.source
Functions that perform content-loading:
Loader.load(),Sound.load(),Netstream.play()
Functions that communicate with the web browser:
ExternalInterface.call(), ExternalInterface.addCallBack(), fscommand(), navigateToURL()
Functions for accessing FlashVars:
LoaderInfo.parameters(), paramObj()
Functions for accessing SharedObjects:
SharedObject.getLocal(), SharedObject.getRemote()
Functions and objects that accept URLs as strings:
MovieClipLoader.LoadClip, MovieClip.getURL(), getURL(), MovieCLip.loadMovie(), MovieClip.loadVariables(), NetConnection.connect(), LoadVars.load(), LoadVars.send(), LoadVars.sendAndLoad(), NetStream.play(), XML.load(), XML.send(), XML.sendAndLoad(), XMLSocket.connect, XMLSocket.send(), Sound.loadSound(), FileReference.download(), FileReference.upload(), System.security.loadPolicyFile(), LoadMovie(), LoadMovieNum(), loadVariables(), SharedObject.getRemote(), TextFormat.url
Functions that display or accept HTML:
TextField.html, TextField.htmlText, TextFormat.font
Functions that communicate with the web browser:
ExternalInterface.call(), ExternalInterface.addCallback(), fscommand(), getURL(), MovieClip.getURL()
Functions for accessing FlashVars:
_root., _level0. _global.
Functions for accessing shared objects:
SharedObject.getLocal(), SharedObject.getRemote()
Functions that make networking calls:
XML.load(), XML.send(), XML.sendAndLoad(), LoadVars.load(), LoadVars.send(), LoadVars.sendAndLoad(), loadVariables(), loadVariablesNum(), MovieClip.loadVariables(), NetConnection.connect(), NetStream.play(), loadMovie(), loadMovieNum(), MovieClip.loadMovie(), MovieClipLoader.loadClip(), Sound.loadSound(), LocalConnection.connect(), LocalConnection.send(), SharedObject.getLocal(), SharedObject.getRemote(), FileReference.upload(), FileReference.download(), System.security.loadPolicyFile(), XMLSocket.connect()
Generally risky:
eval()