Services like the XmlHttpProxy for Java are designed to return JavaScript that is evaluated on the
client. Unfortunately, if you are not careful with the design of your services, JSONP techniques could be used to hijack your services. While I’m not saying JSONP is bad, I do highly recommend you carefully track, limit, or restrict access to your application’s services to JavaScript clients. Here are some strategies for doing this.
1. Token Based Restriction - Limit a client access to server-side resources by using tokens. Resources may include URLs, databases, web services, or domain objects which that service may access to complete a request. Tokens may be configured in a file or by using your server’s built-in security features.
2. Unique Hash / Session Based Restriction - When generating a page that accesses the target service you can create a unique hash or key for each client and restrict access based on the existence of the hash. The session management facilities of the servlet API may easily used to track whether or not a conversation has been established.
3. URL Based Restriction - Based on the URL in which the JavaScript is executed you can restrict access to a service.
4. Application Key Based Restriction - An application key is a flexible means of providing access to your service to a set of JavaScript clients.
5. Content-Type / Authentication Based Restriction - You can restrict JavaScript clients outside of the domain from directly accessing your service by using XML possibly in combination with basic or digest authentication.
Let’s look at restricting service access in more detail and how it is handled by the XmlHttpProxy for Java. Greg Murray’s Blog: Restricting Access to your AJAX Services
From around the Web
- Windows Vista Service Pack 2 Latest Release Schedule
- Vista SP2: What is inside?
- NetWitness releases free version of security software
- Three Reasons Why Users Won’t Buy Into Security
- Automated security testing & its limitations
- Google Wants to Preinstall Chrome Browser on PCs
- Mozilla warns of Firefox China add on
- Firefox No Longer an Automatic Defense Against Browser Drive Bys
- Google patches Chrome file stealing bug
- Apple plays catch up, adds anti fraud safeguard to Safari
- Researchers find vulnerability in Windows Vista
- How to Use Network Behavior Analysis Tools
- The insider security threat in IT and financial services
- Windows 7 security: An overall improvement?
- Windows 7 UAC could be less of a nag