Nytro Posted November 27, 2011 Report Posted November 27, 2011 XCS: Cross Channel Scripting and its Impact on Web ApplicationsHristo BojinovStanford Universityhristo @ cs.stanford.eduElie BurszteinStanford Universityelie @ cs.stanford.eduDan BonehStanford Universitydabo @ cs.stanford.eduABSTRACTWe study the security of embedded web servers used in con-sumer electronic devices, such as security cameras and photoframes, and for IT infrastructure, such as wireless accesspoints and lights-out management systems. All the deviceswe examine turn out to be vulnerable to a variety of webattacks, including cross site scripting (XSS) and cross siterequest forgery (CSRF). In addition, we show that consumerelectronics are particularly vulnerable to a nasty form ofpersistent XSS where a non-web channel such as NFS orSNMP is used to inject a malicious script. This script islater used to attack an unsuspecting user who connects tothe device's web server. We refer to web attacks which aremounted through a non-web channel as cross channel script-ing (XCS). We propose a client-side defense against certainXCS which we implement as a browser extension.1. INTRODUCTIONCurrent consumer electronic devices often ship with anembedded web server used for system management. Thebenets of providing a web-based user interface are twofold:rst, the user does not need to learn a complicated command-line language, and second, the vendor does not need to shipclient-side software. Instead the user interacts with the de-vice through a familiar browser UI.While this is a cost-eective and convenient solution, itcan introduce considerable security risk due to the largenumber of potential vulnerabilities in a weak web applica-tion. Moreover, securing Web applications on a consumerelectronics device can be difficult due to the large number ofsupported network protocols and the interactions betweenthem. For example a user might upload a le to a networkstorage device by using the SMB protocol, manage its per-missions through the web interface, and eventually share itwith his friends through FTP.In this complex environment, it is not surprising thatmany embedded devices are vulnerable to web attacks. Infact, all the 23 devices we evaluated [3] were vulnerable toseveral types of Web attacks, including cross site scripting(XSS) [6], cross site request forgeries (CSRF) [30, 2], andmany others.Recall that in a type 1 (reected) cross site scripting at-tack, the user follows a malicious link to a victim site. Avulnerability in the site causes an attack script to be embed-ded into the resulting HTTP response. This script can thentake over the page and perform arbitrary actions on behalfof the attacker. A type 2 XSS, called persistent XSS, en-ables the attacker to inject a malicious script into persistentstorage at the victim site. When an unsuspecting user viewsa page that contains the script, the script can take over thepage. For example, type 2 XSS can aect message boards;an attacker can post a message containing a script that islater executed by the browser of every user that happens toview the attacker's post. A recent example of such an attackis the XSS Twitter worm that struck in the middle of April2009 [31].Cross Channel Scripting attack. Many of the embeddeddevices we examined were vulnerable to a type of persistentXSS that we call cross channel scripting (XCS). In anXCS attack a non-web channel, such as SNMP or FTP, isused to inject a persistent XSS exploit which is activatedwhen the user connects to the web interface. For exam-ple, several NAS devices we examined allow an attacker toupload a le with an almost arbitrary lename via SMB.The attacker takes advantage of this lack of restrictions andcrafts a lename that contains a malicious script. When theNAS administrator views the NAS contents through the webinterface, the device happily sends an HTTP response to theadmin's browser containing a list of le names including themalicious lename, which is then interpreted as a script bythe browser. The script executes on the admin's browser giv-ing the attacker full control of the admin session. In Sec. 3we present the most interesting XCS attacks we discovered.We also founded a related class of attacks in which a webvulnerability is used to attack a non-web channel. We referto this as a reverse XCS vulnerability. We give examplesin Section 4.XCS and reverse XCS are more likely to aect embeddeddevices than traditional web sites because these devices of-ten provide a number of services (e.g. web, SNMP, NFS,P2P) which are cobbled together from generic components.The interaction between the components may not be com-pletely analyzed, leading to an XCS vulnerability. In con-trast, many Internet web sites only provide a web interfaceand hence are less likely to be aected by XCS. Interestingly,large web sites such as Facebook and Twitter, provide non-web cloud APIs for third party applications which presentXCS opportunities, as discussed in Section 5.Detecting an XCS or reverse XCS vulnerability can be dif-cult because these attacks abuse the interaction betweenthe web interface and an alternate communication chan-nel. Simply inspecting the web application code and theother service code is not enough to detect the vulnerability.The web application and the other service, such as an FTPserver, can be completely secure in isolation and becomevulnerable only when used in conjunction.Download:citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.149.9782&rep=rep1&type=pdf&rct=j&q=XCS%20paper&ei=RY_UTM2XIZC2sAOOxM2NCw&usg=AFQjCNFIjZGE0NFLqFsbij713Ii3dRYv-Q&sig2=xEE5GtB7lZOH-zNQ6VND-Q&cad=rjaMirror:http://www.multiupload.com/49EW25WAJV Quote