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

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 www.google.com 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.

[ GARTNER SECURITY REPORT:McAfee up, Trend Micro down]

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, Live.com 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 Live.com 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."

Ellen Messmer is senior editor at Network World, an IDG publication and website, where she covers news and technology trends related to information security. Twitter: @MessmerE. Email: emessmer@nww.com.

Read more about wide area network in Network World's Wide Area Network section.

Join the CSO newsletter!

Error: Please check your email address.

Tags HTTP Strict Transport Security (HSTS)GitHubmcafeeGoogletrend microsecuritytwitterSSLFacebook

More about CSPeBayFacebookGoogleIDGMcAfee AustraliaNeohapsisPayPalScott CorporationTrend Micro Australia

Show Comments

Featured Whitepapers

Editor's Recommendations

Solution Centres

Stories by Ellen Messmer

Latest Videos

  • 150x50

    CSO Webinar: The Human Factor - Your people are your biggest security weakness

    ​Speakers: David Lacey, Researcher and former CISO Royal Mail David Turner - Global Risk Management Expert Mark Guntrip - Group Manager, Email Protection, Proofpoint

    Play Video

  • 150x50

    CSO Webinar: Current ransomware defences are failing – but machine learning can drive a more proactive solution

    Speakers • Ty Miller, Director, Threat Intelligence • Mark Gregory, Leader, Network Engineering Research Group, RMIT • Jeff Lanza, Retired FBI Agent (USA) • Andy Solterbeck, VP Asia Pacific, Cylance • David Braue, CSO MC/Moderator What to expect: ​Hear from industry experts on the local and global ransomware threat landscape. Explore a new approach to dealing with ransomware using machine-learning techniques and by thinking about the problem in a fundamentally different way. Apply techniques for gathering insight into ransomware behaviour and find out what elements must go into a truly effective ransomware defence. Get a first-hand look at how ransomware actually works in practice, and how machine-learning techniques can pick up on its activities long before your employees do.

    Play Video

  • 150x50

    CSO Webinar: Get real about metadata to avoid a false sense of security

    Speakers: • Anthony Caruana – CSO MC and moderator • Ian Farquhar, Worldwide Virtual Security Team Lead, Gigamon • John Lindsay, Former CTO, iiNet • Skeeve Stevens, Futurist, Future Sumo • David Vaile - Vice chair of APF, Co-Convenor of the Cyberspace Law And Policy Community, UNSW Law Faculty This webinar covers: - A 101 on metadata - what it is and how to use it - Insight into a typical attack, what happens and what we would find when looking into the metadata - How to collect metadata, use this to detect attacks and get greater insight into how you can use this to protect your organisation - Learn how much raw data and metadata to retain and how long for - Get a reality check on how you're using your metadata and if this is enough to secure your organisation

    Play Video

  • 150x50

    CSO Webinar: How banking trojans work and how you can stop them

    CSO Webinar: How banking trojans work and how you can stop them Featuring: • John Baird, Director of Global Technology Production, Deutsche Bank • Samantha Macleod, GM Cyber Security, ME Bank • Sherrod DeGrippo, Director of Emerging Threats, Proofpoint (USA)

    Play Video

  • 150x50

    IDG Live Webinar:The right collaboration strategy will help your business take flight

    Speakers - Mike Harris, Engineering Services Manager, Jetstar - Christopher Johnson, IT Director APAC, 20th Century Fox - Brent Maxwell, Director of Information Systems, THE ICONIC - IDG MC/Moderator Anthony Caruana

    Play Video

More videos

Blog Posts