Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

What Google, Facebook and Twitter are doing right with website security

Ellen Messmer | June 4, 2013
Google, Facebook and Twitter are improving security, Neohapsis Labs says.

The popular services of Google, Facebook and Twitter are improving in terms of security, says Scott Behrens, head of Neohapsis Labs, which took a security snapshot of them on May 28 through an analysis that included looking at server headers sent during responses to the websites.

Here are some observations Behrens makes about what Neohapsis Labs found:

1. Forcing browsers to use SSL
Companies like Google, Facebook and Twitter are using a technology called HTTP Strict Transport Security (HSTS) to forces browsers over SSL. For example, when users type in a browser, the request automatically goes over SSL, making the browsing user experience more secure on the transport layer and helping mitigate man-in-the-middle attacks.

2. Mitigating cross-site scripting
Companies like Facebook and GitHub are using Content-Security Policy (CSP), which severely cripples cross-site scripting (XSS). By blocking the JavaScript practices such as inline scripts and dynamic evals, attackers will have a much harder time triggering reflected and DOM-based XSS attacks. In addition, forcing developers to not use inline scripts will encourage better coding practices. Facebook has started to send CSP headers on certain requests, but it seems to be very permissive, potentially suggesting it is still testing this technology.

3. Rendering browser content only as explicitly stated
Facebook, and Gmail utilize X-Content-Type-Options: nosniff, which finally fixes an age old problem where content type is "sniffed" by the browser and rendered even when the Content-Type is explicitly stated. What this means is, when a document's content type is specified as a plain text document, but contains HTML, the browser "sniffs" the content and decides to actually render it as HTML. This can cause serious security issues. The nosniff header is strict and enforces the browser to render content only as explicitly stated.

4. Preventing clickjacking attacks
Clickjacking attacks take advantage of embedded content in iframes by placing elements over those frames and tricking users into clicking actions that seem innocuous, but may be performing malicious actions on the attacker's behalf. Companies like Google, Facebook, Twitter, PayPal, eBay and are using X-Frame-Options HTTP response header, which either permits or denies the rendering of a page in a frame or iframe element. Since this can block content from being embedded into other sites, it can prevent clickjacking attacks.

When asked if he noticed any deficiencies, Behrens said: "Facebook has explicitly disabled a header called X-XXS-Protection, when tells the browser (IE and Chrome only) to block cross-site scripting attacks. The header works in a few ways, depending on how it's configured. In Block mode, if a browser detects cross-site scripting, the browser will not render the page. In '1' mode, the browser loads the page but attempts to remove the malicious JavaScript. In '0' mode, the browser must disable XSS protection. Twitter, on the other hand, has this feature turned on in block mode. It is unclear why this is the case."


Sign up for MIS Asia eNewsletters.