4 ways to avoid the exploit in Facebook spam attack

The type of attack that spread violent and graphic images across the walls of Facebook users the past of couple days is one of the most common on the Web.

Cross-site scripting, commonly referred to as XSS, exploits vulnerabilities in Web pages, usually via a hyperlink that contains malicious code. It injects client-side script that can, among other things, be used to steal log-in credentials, track a user’s activity or exploit the browser’s activity. It’s frequently an element of phishing and other attacks.

In Facebook’s case, the attacks exploited some browsers — although Facebook hasn’t said which ones — to allow “self-XSS,” the security company Sophos said in a blog post. Users were tricked into copying and pasting URLs infected with JavaScript that led to the images appearing on their news feeds.

In addition to JavaScript, XSS attacks can inject VBScript, ActiveX, HTML or Flash into a vulnerable application, according to a FAQ on cross-site scripting by the CGISecurity.

Facebook says it has cleaned up the images and is investigating who was behind it. There have been reports that the company has identified the attacker(s) but has said only that it was not the hacker group Anonymous, which earlier this month had reportedly threatened an attack against the social media site.

The images, which included pornography and violence, spread for a couple days before Facebook took them down, although Chester Wisniewski noted on the Sophos blog that responding to the attack may have been difficult because the flaw itself was not on Facebook’s website.

Although XSS attacks are common, and often successful, there are ways to prevent them.

Administrators can take an number of filtering and other steps to protect their sites against XSS. Advice is available from The Open Web Application Security ProjectIBM, Microsoft (with regard to ASP.Net) and many others.

But what can users do?

Here are four basic, common-sense steps you can take to help prevent them from infecting your browser or spreading from there.

  1. Be smart, which means being at least a little suspicious of anything you come across. Wisniewski points out that XSS attacks often come in the form of giveaways or sweepstakes. You should know better than to click on these links. Because XSS often is used in phishing attacks, beware of e-mails asking for personal information.
  2. Go to the website you want to visit. If someone sends you a link to, say, CNN, go to CNN’s site and use its search engine rather than clicking on the link. CGISecurity says this step will likely eliminate 90 percent of the problem.
  3. If you don’t want to venture to a website and scrounge around for an article or post that might be old, at least check with the friend who sent you the link to see if it’s legitimate.
  4. You can adjust browser settings if you want to be really careful. XSS can sometimes be activated by opening an e-mail, clicking on an attachment, reading a guest book or reading a post on a public bulletin board, CGISecurity says. You can protect yourself by going to the browser setting and turning off JavaScript. In Internet Explorer, putting the security setting at high can prevent cookie theft as well.


About the Author

Kevin McCaney is a former editor of Defense Systems and GCN.


  • business meeting (Monkey Business Images/Shutterstock.com)

    Civic tech volunteers help states with legacy systems

    As COVID-19 exposed vulnerabilities in state and local government IT systems, the newly formed U.S. Digital Response stepped in to help. Its successes offer insight into existing barriers and the future of the civic tech movement.

  • data analytics (Shutterstock.com)

    More visible data helps drive DOD decision-making

    CDOs in the Defense Department are opening up their data to take advantage of artificial intelligence and machine learning tools that help surface insights and improve decision-making.

Stay Connected