|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP LINKS YOU MUST CLICK ON News Possible Solutions to Web Security Issues
Coach Wei's Direct from Web 2.0 Blog
By: Coach Wei
Mar. 13, 2008 11:15 AM
Coach Wei's Blog “Cross site scripting” “Cookie” As a result of “same domain policy”, a server does not have access to cookies issued by other servers, which is good. However, given that browsers always send cookies back to the server as part of every request, this “trust” relationship between client side “cookies” and server side state can be exploited for security breaches. As a result, the current security model manifests itself into the following problems:
1. Need a Security Sandbox for Cross-site ScriptsThe implication of XSS is that it can be intentionally or unintentionally exploited for security breaches. The followings are a few examples:
Reference 1 (http://en.wikipedia.org/wiki/Cross-site_scripting) has some detailed description of XSS and its problems. At the core of XSS problem is the lack of any security “sandbox” for cross-domain scripts. Cross-domain scripting is powerful and enables a lot of services that web users enjoy (for example, GoogleMap widget), the lack of any security sandbox for cross-domain scripts makes any websites that use such technique highly vulnerable, resulting either malicious or accidental damages. Possible Solutions:
2. Stronger Cross-site Request Forgery ProtectionReference http://www.owasp.org/index.php/Cross-Site_Request_Forgery described XSRF problem well: Cross-Site Request Forgery (CSRF) is an attack that tricks the victim into loading a page that contains a malicious request. It is malicious in the sense that it inherits the identity and privileges of the victim to perform an undesired function on the victim's behalf, like change the victim's e-mail address, home address, or password, or purchase something. CSRF attacks generally target functions that cause a state change on the server but can also be used to access sensitive data. For most sites, browsers will automatically include with such requests any credentials associated with the site, such as the user's session cookie, basic auth credentials, IP address, Windows domain credentials, etc. Therefore, if the user is currently authenticated to the site, the site will have no way to distinguish this from a legitimate user request. In this way, the attacker can make the victim perform actions that they didn't intend to, such as logout, purchase item, change account information, retrieve account information, or any other function provided by the vulnerable website. Sometimes, it is possible to store the CSRF attack on the vulnerable site itself. Such vulnerabilities are called Stored CSRF flaws. This can be accomplished by simply storing an IMG or IFRAME tag in a field that accepts HTML, or by a more complex cross-site scripting attack. If the attack can store a CSRF attack in the site, the severity of the attack is amplified. In particular, the likelihood is increased because the victim is more likely to view the page containing the attack than some random page on the Internet. The likelihood is also increased because the victim is sure to be authenticated to the site already. Synonyms: CSRF attacks are also known by a number of other names, including XSRF, "Sea Surf", Session Riding, Cross-Site Reference Forgery, Hostile Linking. Microsoft refers to this type of attack as a One-Click attack in their threat modeling process and many places in their online documentation. Possible Solutions: In general, I have not seen enough attention given to XSRF. The best way to prevent XSRF is to handle it on the server side and avoid storing sensitive information on the client side cookies. Some of the attempts to make cookie less vulnerable are: 1. Adding “httpOnly” cookie attribute: Internet Explorer adds a cookie attribute called “httpOnly” that cookies with such attribute are not accessible from scripts. Unfortunately other browsers do not support this. “httpOnly” makes web site less vulnerable from XSS, see reference 2. Joe Walker (see reference http://getahead.org/blog/joe/2007/08/07/fixing_browser_security_samerefereronly.html) proposed adding “sameRefererOnly” attribute to cookies so that such cookies will only be sent back to a server if the referring web page is from this server. “sameRefererOnly” will help make cookies more secure, and make it harder to carry out XSRF. 3. Access data from different serversThough “Same Origin Policy” allows cross-site scripting, it does not allow web applications accessing data on other servers. The next generation of web applications will be much more data intensive. They will want to exchange data with other servers than the originating server. There is no other way of achieving this except for exploiting the above “cross site scripting” loophole. In fact, the so called “Mashup” phenomenon like how people typically embed GoogleMap into their own web pages relies on this technique, leaving many web applications under significant security risks. Possible Solutions: 1. JSONRequest, as proposed in reference http://json.org/JSONRequest.html 2. Cross-domain Request (XDR), XDomainRequest, built into IE8 (http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/Dev...) 4. Mashup securityMashups mix and merge “mashup widgets” (data and code) from multiple sources in a user’s browser, to provide high-value web applications. Depending on how page authors assemble the mashup page, these widgets on the page may have unwanted access to the state of other widgets and the page. The issues of cross-site scripting and XSRF are even more proven to create major security holes in Mashups. In order to properly isolate these widgets from each other to prevent unwanted access, page authors can load each widget into its own “iframe”. For example, IBM researchers proposed “SMash” that uses iframe to isolate different widgets. However, due to the lack of cross frame communication mechanism, interaction between widgets is not possible. “Smash” uses <iframe>s to maintain isolation between components from different domains and to use the fragment ID of the URLs to enable communication between the frames, which is “hack” though it works on browsers. What would be ideal here is to have the “iframe” isolation and a high level secure messaging mechanism among the iframes without breaking the “same origin” policy. Possible Solutions: 1. OpenAjax Hub 1.1 (http://www.openajax.org/member/wiki/OpenAjax_Hub_1.1_Specification_Managed_Hub_APIs) from OpenAjax Alliance. ReferencesENTERPRISE OPEN SOURCE MAGAZINE LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||