Information Assurance |
Dan Kahan |
Information AssuranceBugtraq AnalysisGoogle XSS Injection Vulnerability |
1. Problem Description>From the user’s point of view, the operation of Google’s search service accepts some query, either from a form on its Web site, a toolbar, a URL string, or various other sources. Some other parameters, such as the user’s preferred language, can also be passed on. The service then returns results for the query if any are available. Like any Web application that accepts input, Google’s search service must properly validate and clean input before processing it. Otherwise, both users and Google would be susceptible to malicious input. Indeed, with Google’s English-language search service, many cross-site scripting (XSS) vulnerabilities have been prevented or fixed. However, different versions of Google’s search service handle input differently. The Arabic-language version, for instance, has some XSS vulnerabilities that the English version does not. While Google does seem to prevent longer scripts from executing – which precludes a lot of malicious scripting attacks – it will currently allow multiple short scripts to run.
This URL will cause one alert box to appear:
one.
Limitations
2. PreventionIf the developers of each version of the search service had worked together or from the same codebase, then there would not be this disparity. Google’s XSS prevention mechanisms are generally effective, but not when they are used inconsistently.
3. WorkaroundsThere are two ways to prevent this problem from occurring. Users can disable JavaScript or just closely inspect Google URLs before clicking them, just as they should do for any URL. If there is any doubt about whether a URL might contain malicious code, the user should go to the main page for the site (in this case, http://www.google.com) and navigate from there.
4. Future preventionGoogle’s Arabic-language code ought to incorporate the same input-cleaning mechanisms that are employed in other versions of Google’s service. Those mechanisms basically sanitize all queries containing what code be server- or client-side code. While Google probably has written its own code in Python or C++ for this, many Web application development platforms have easily-accessible functions to do this. For instance, in PHP, the function htmlspecialchars() replaces all potentially malicious characters. |