YOUR FEEDBACK
Werner Keil wrote: Java 6 update 10. If I'd be running Apple, I'd probably really drop dead...
AJAXWorld RIA Conference
$300 Savings Expire September 12th. Register Today and SAVE!

SYS-CON.TV

2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
TOP THREE LINKS YOU MUST CLICK ON


Application Security in AJAX
You probably have read or heard a great deal about AJAX security concerns

Security in AJAX
Unlike traditional Web applications that have a more or less static user interface, AJAX applications have an active client that uses the browser’s native XHR to fetch data from a server. There are two major risks to the browser regarding client-side JavaScript: browser bombing and cross-site scripting attacks:

  • Browser bombing is the client version of a denial of service (DoS) attack. During this type of attack, the client is kept busy with JavaScript processing, such as running endless loops that fill up an array with content. When the client consumes all computing resources, the desktop hangs.
  • Cross-site scripting has two facets. The first one, which was already mentioned, is where a script downloaded from one domain tries to access properties of a page downloaded from another domain. The second facet is where developers fail to validate user input, resulting in a JavaScript that is executed when the user-added input is rendered on a Web page. Imagine a discussion forum that does not encode JavaScript content or check for SQL keywords. A hacker could, for instance, add JavaScript that performs a runtime attachment of an image tag to the page in which the src attribute references a uniform resource locator (URL) on the hacker’s server. The script could, for example, append the client’s cookies as a request parameter. The application user does not recognize these changes because the HTML does not flag a missing image as an error.

While client-side security protects the end user from the application, application security protects the application from the user. Protection includes enforcement of authentication, authorization, and data privacy.

Though XSS and SQL injection attacks can be handled in AJAX on the client, you should not miss the opportunity to enforce the same policy on the back end in an additional layer of defense. In traditional Web applications, request filters implemented on the HTTP server (or in the application configuration) performed pattern searches using such things as Regular Expressions on the incoming request to detect technology keywords of JavaScript and SQL. In addition, filters were used to replace special characters with their encoded equivalent, such as when replacing < with &lt;. AJAX applications are like traditional Web applications, so the same security design patterns apply to them.

Security design patterns are recommendations of best practices to mitigate the risk of an identified threat. Patterns that exist for Web applications include defense in depth, limited view, least privileged access, checkpoint, and roles.

In addition to best security practices, there exists a sensitive balance between usability, performance, and security that needs to be considered when building AJAX applications. It is easy to risk vulnerabilities simply by annoying end users with too many security-related interruptions when they are working in an application. Such users soon turn into hackers on their mission to find a more convenient way to work with an application. AJAX applications are based on client-side JavaScript and only provide a minimum capability to maintain client-state in cookies and page variables. Unless the AJAX application is built on top of a server-side framework that manages the application state, AJAX applications risk losing state upon page reload and navigation, adding a need to re-request user security credentials.

The XHR Object
The XHR object is an Application Programming Interface (API) available in all modern Web browsers that allows scripts to asynchronously and synchronously perform HTTP client functionality, such as submitting form data or querying data from the server. The only exception to the list of browsers supporting XHR is Microsoft Internet Explorer (IE), versions 6.0 and below, which use the XMLHTTP ActiveX control. XHR is the AJAX-enabling technology. All the following HTTP request methods that are available for traditional Web applications can be used with XHR: POST, GET, HEAD, DELETE, and PUT.

The following security-related functionality and limitations exist for the XHR object:

  • The format of the content that can be exchanged between the XHR client and the server is restricted to plain text and XML, which is a useful limitation that prevents the download of binary executables without the user noticing.
  • While native JavaScript cannot access request headers, XHR provides this ability to AJAX, allowing it to exchange information (such as session keys) with the server without encoding it as part of the request URL. According to the latest W3C working draft for XHR [W3C], not all HTTP headers are configurable to avoid misuse.
  • One of the exposed methods of the XHR object allows developers to authenticate a user to the server before accessing restricted resources. The XHR authentication is handled by the server-side Web container that obtains the username and password pair from the request. By default, the username and password are not encrypted but sent in clear format. AJAX developers can use JavaScript encryption libraries that exist on the Web to protect the password, assuming that the server knows how to decrypt the string before performing the authentication.
  • The XHR object does not provide an API to handle secure communication using secure socket layer (SSL) technology. Instead, the XHR request uses the same protocol for security that is used to download the containing page. This limitation is the result of the same origin policy enforced on the server, which treats http as a different URL than https. This means that, for all sensitive communications, AJAX has to use a page reload to switch protocol before sending the information.
About Frank Nimphius
Frank Nimphius is a principal product manager for application development tools at Oracle Corporation. As a conference speaker, Frank represents the Oracle J2EE development team at J2EE conferences world wide, including various Oracle user groups and the Oracle Open World conference.

YOUR FEEDBACK
Java Application Development wrote: Good Post.... Java Application Development...
LATEST AJAXWORLD RIA STORIES
A round-up of the overall themes and topics being presented at the 6th International AJAXWorld RIA Conference & Expo at The Fairmont Hotel in San Jose, CA, October 20-22, 2008 - including AIR & Flex, AJAX, ASP.NET, Business Case for RIAs, Cloud Computing, Comet, Google Web Toolki...
Gomez announced the availability of cross-browser testing for Google’s new browser, Chrome, and Microsoft’s Internet Explorer (IE) 8 beta 2. Using Gomez’s Reality View XF service, developers can now visualize how new and existing web applications will appear and perform whe...
Chrome, the new Google browser, was released yesterday as a beta version for Windows Vista/XP and officially entered the browser war, where the primary competitors are currently Microsoft Internet Explorer and Mozilla Firefox. Chrome offers many interesting features, aimed at mak...
Aptana Jaxer is a new open source application server built especially for AJAX application development in JavaScript. To say that "Jaxer lets you do JavaScript on the server-side" would be accurate, but an understatement. The core concept of Jaxer is that it provides a parity of ...
Instantiations announced the release of GWT Designer 5.1. This major version upgrade of the product includes support for Google Web Toolkit (GWT) 1.5, released August 28, as well as basic support for GWT-Ext and MyGWT, both popular widget kits.
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE