Internet Security Tips and Advice

Cross Site Scripting – the Web’s lurking danger

July 23rd, 2008 by Igor Pankov

Introduction

There are some areas of computer security over which a user has almost no control; from involuntary exposure to software vulnerability exploits to hijacked DNS servers that divert visitors to infective locations, there is little that a user alone can do to avoid becoming a victim.

These challenges - as well as a multitude of others - require action by software vendors to design less vulnerable products and by responsible authorities to deploy an Internet infrastructure that’s less vulnerable to abuse - or at least enable fast mitigation when flaws are found.

The same principle can be applied to cross site scripting attacks. This type of web compromise cannot be solved by individual Web users alone but should be the responsibility of web application and browser developers. However, it appears this level of prevention won’t be available for some time, so it’s important to recognize the impact of cross site scripting vulnerabilities and minimize inadvertent exposure wherever possible. That’s the topic of this article.

What is cross-site scripting?

A script is a set of machine language commands processed on a user’s computer or by a web server. Cross-site scripting (XSS) vulnerabilities occur when scripts originating on one website (usually a malicious site) are permitted to interact with the content of another website, or an HTML page stored locally – hence the term “cross-site”. Unlike other types of attack, the perpetrators of cross-site scripting attacks use vulnerable servers as an intermediary to stage attacks on visitors to compromised websites; they do this by forcing the user’s browser to run the scripts placed on those vulnerable web servers.

XSS vulnerabilities first appeared at the turn of the century, when a number of security experts reported concerns over the potential use of JavaScript code with malicious intent in a cross-boundary attack.

In an XSS attack, after the script has been executed on the user’s PC, it starts issuing commands and remotely controlling the behavior of the target browser window in such a way that it appears the user is performing these actions himself. The script may execute locally on the user’s computer or lie dormant on the web server, attacking other users as they access this page.

The problem with XSS is so significant because, as a result of an XSS exploit, the script takes control of the victim’s web session while the attack is carried out in the background, leaving no footprint behind and thus making it extremely hard to detect.

In order for XSS attacks to succeed, certain criteria must be met: the use of flawed browser software that does not validate the script’s origins and permissions, or poorly-written Web server code that does not exercise proper validation routines. Social engineering is also widely used to lure victims into clicking the link containing the malicious script.

To give an idea of the scale of the problem, it is estimated that more than half of all websites today have XSS holes, and XSS flaws account for more than 80 percent of all documented web vulnerabilities. Almost every well-known web portal has been compromised by XSS attacks at some time - the likes of Google, MSN, Facebook and other prominent sites have experienced XSS exploits first-hand.

Different types of XSS

There are currently three types of cross-site scripting vulnerabilities:

  • Local, or Type 0, XSS, where the problem exists in the client-side script of a web page. To exploit the vulnerability, an attacker constructs a web page with malicious JavaScript code in it and sends potential victims a link to it (via email, IM, etc.). Once the link has been clicked, the script executes and serves up a locally-created vulnerable HTML page which contains JavaScript code that can be run with the the current user’s privileges (most users log on as Administrators). After that, an attacker can gain access to the victim’s local computer, including viewing files and other sensitive data.
  • Non-persistent, or Type1, XSS is one of the most common, and involves vulnerabilities of server-side scripts that do not sufficiently validate user input. Non-persistent XSS occurs when a user receives a link with malicious script while logged on to a web site. After the link is clicked and the malicious script executed, it hijacks the user’s session and controls the activity of the page the user is currently on. This type of compromise can be executed in the current browser session only.
  • Persistent, or Type2, XSS is the most blatant and dangerous vulnerability because it can affect many users without the use of much social engineering. The vulnerability is in the server-side scripts but can exist for a long time, so it can affect a much greater number of users. It arises when a legitimate server persistently stores portions of malicious scripts placed on it by the hacker and later feeds that code to the visitors’ browsers for the latter to execute.

What the perpetrators are after

Most attacks target session cookies – files loaded onto users’ machines by the web sites they connect to. Cookies are easy mechanisms for identification on the site, so once the perpetrators get hold of your cookie files, they can impersonate you and act on your behalf. Cookies are transferred to attackers by the commands in the script.

What victims can lose

As a result of successful exploitation of an XSS hole, victims may lose important data and be exposed to ID theft. Once your session has been hijacked, the “script masters” can perform any activity that a legitimate owner of the compromised account can do - read and delete emails, perform financial transactions and credit payments, create postings on social networking sites - just about anything the legitimate user is authorized to do.

What makes XSS attacks possible?

XSS attacks happen for two reasons: sloppy programming and haphazardly-created website engines that do not filter user input. Either of these situations can enable a malicious user to insert a piece of a JavaScript code in, for instance, a search field; the server would return a results page along with the original search query, which could be interpreted by the client software as executable code. So it’s important that web developers create code that filters user input and translates certain characters used in JavaScript into plain text, not executable commands.

Another contributing factor to XSS vulnerability is the use of outdated web browsers that don’t apply the necessary security policies when processing (parsing) code coming from different sources.

How can users protect themselves?

While developers carry much of the blame for the majority of XSS attacks, there is still something a web user can do to minimize vulnerability. The key element is preventing client-side code from being sent to the browser by untrusted websites. Internet Explorer users can do this by raising their security slider to “High” in the Security tab, restricting the ability of any potentially malicious code on any website to run, and specifying a list of sites that are still allowed to run code. Firefox users can use the NoScript addon to block JavaScript and only allow it on sites specified in the exclusion list, as it is the case for IE. Another option would be to increase the Privacy setting in IE so that no permanent cookies are stored by the browser, and to specify a set of exclusions.

Another useful habit to get into is to always log off from a web session when it’s completed, and to open unknown links only after the user has left the site (the cookie file is removed from local storage and no attack is possible).

It’s also important to keep your browser and Windows up to-date so that any past vulnerabilities won’t apply to leave you vulnerable.

Summary

XSS attacks arise because of errors in web code that does not sufficiently check user input for malicious executable code. Vulnerability is avoided if potentially-malicious data that a user submits to a server is extracted and returned as plain text (non-executable) data. While we wait for a solution from web application developers, there are actions users can take to minimize their exposure to XSS: logging off from a session before clicking and following any links, disabling JavaScript code for unknown sites, using the latest versions of web browsers. And lastly, continue to follow the ‘rules of the web’ - don’t open links from strangers and don’t trust contacts you don’t know.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Security Insight | 3 Comments »

Welcome to the securityteacher.com research section

July 3rd, 2008 by Igor Pankov

In the first of our series of research, we decided to pit against each other three popular security products – Kaspersky Internet Security, Agnitum Outpost Security Suite Pro and Eset Smart Security to find out which demonstrated the best aptitude to counter threats with the help of onboard proactive protection instruments – those that monitor system activity and alert to new or unknown program operations.

The testing methodology was quite straightforward: disabling all signature-related scanners, running the test malware sample and tracking how each product managed to prevent activation of malware after system restarted. All prompts were given the “block action” response, and the tools used for testing were Sysinternals Autoruns and Process Explorer.

Click the corresponding video file to see the products in action.


View

Video 1 - Product in action:
Outpost Security Suite Pro

View Video

View

Video 2 – Product in action:
ESET Smart Security

View Video

View

Video 3 – Product in action:
Kaspersky Internet Security 7.0

View Video

 

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Research | 14 Comments »

Useful Security Links (June 2008), Part 3

June 26th, 2008 by Igor Pankov
  1. Malicious Trojan Horse Plagues Apple Mac OS Users
  2. 20 million Firefox 3 downloads in a week, ~4% market share
  3. Trend Micro’s CEO says ‘AV industry sucks’
  4. Software update snafus block Microsoft patches
  5. Cisco IOS Rootkit Demonstrated
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Useful Security Links | No Comments »

Encryption

June 20th, 2008 by Igor Pankov

Encryption is a way of securely storing or transferring data by using special encryption key or algorithm to cipher its contents. For anyone else except the target recipient, the encrypted source will appear as a piece of unreadable, garbled data, making encryption a valuable instrument to hide private or secret information from strangers.

The target recipient possesses the unique decryption key which enables to decipher encrypted data and thus arrive at the original content. If someone manages to get hold of the unique decryption key, he/she can read that data as well. That’s why it’s important to keep the key in secure, tightly guarded location.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Security Glossary | No Comments »

Useful Security Links (June 2008), Part 2

June 16th, 2008 by Igor Pankov
  1. How to Remove Your Browser Hijacker
  2. Trojan Makers Block PC Functions To Promote Rogue Anti-Spyware Programs
  3. McAfee CEO: Adware is killing AV blacklisting
  4. Keeping our Technology-Savvy Kids Safe Online
  5. Obama Campaign Hopes for Better Web Security
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Useful Security Links | No Comments »

The Perils of Social Networking

June 16th, 2008 by Igor Pankov

Preface

According to some estimates, more than thirty percent of US web traffic is taken up by users interacting on social networks like Facebook, Myspace and LinkedIn. Social networks (SN) can be fun and useful places to be when you want to hang out with your friends online, meet new colleagues, discuss a news event or engage in hot-button debate. The primary benefit of social networking is that it connects people with common interests or occupations and provides an easy way to share information, opinions, photos, videos, and just about everything else.

But there are also drawbacks to the open environments that constitute social networking. As you may have guessed from the title, the dark side of social networking is the focus of today’s article.

Basic guidelines

Registering with a social network

When you first sign up, you’re required to provide your real name and a valid email address that your future account will be associated with (your email address is usually used as your username for the SN). Make it a rule to choose at least a six-character strong password for your account. Also remember that passwords for your registration email address and SN login should be different, so that in the unfortunate event your account is compromised, you can always reset the password by using your email to restore your SN credentials; this presumes that the perpetrator cannot access your email inbox and read incoming messages.

Minimizing vulnerability exposure

Whereas Windows is your offline desktop platform that you can manage and secure to the best of your knowledge or expertise, your online social networking platform resides on remote servers over which you have no control; your SN identity and activities are only as well-protected as the underlying SN engine.

So, it is up to you to protect yourself – we suggest following these ‘safe practices’:

  • Use the latest browser software and install Windows Updates as soon as they become available.
  • Use a firewall to protect your system against unknown threats; use up-to-date antivirus to block known threats and intrusion prevention software to alert you to potentially dangerous activities on your computer.
  • Do not download, open or respond to content published or sent by unknown people. There has recently been a virus outbreak in the Russian portion of an SN that resulted from unwary users clicking on a reference to a fake image file that led to the activation of a virus that then wiped user data from the affected computers.
  • Remember that SN is still in its infancy: the engines are still immature and the platforms are vulnerable to determined attackers. Reports of faulty SN code appear regularly in the media, and you cannot rely on the integrity and non-disclosure of your personal details due to multiple weaknesses in SN systems. Cross-scripting errors (XSS) enabling attackers to view restricted sections of user data have affected almost every SN site, much like the way spyware targeted Windows systems that had not been patched with SP2 back in 2003.
  • The 3rd party applications (widgets) that Facebook and Myspace offer as additional downloads are even more problematic. These programs are not tested for compatibility or security defects, so be sure you understand exactly what you are installing when you choose to use one of these applications.
  • Don’t access your online profile from public computers – such actions are fraught with additional risk because of the potential for theft or malware compromise. Your log-in details might be stored in a local cache and later extracted and used to illegally access your profile, or the computer may be infected with keylogger that will silently capture any piece of information, including log-ins and dialog sessions, and relay this data to unauthorized third parties.

Privacy precautions

Do not disclose sensitive information – ever!

A recent British survey revealed that more than half the SN users interviewed publish contact details and private details in their online profiles, making them the easy targets to ID thieves and other miscreants.

Due to the open nature of the Internet and the fact that your account can be hijacked, coupled with the vulnerabilities of SN platforms, you should NEVER publish any sensitive information about yourself, like your home address, Social Security or cell phone numbers. And don’t post anything that could backfire against you, like videos of your student parties, or anything else that you wouldn’t want a prospective employer to see.

Prevent anonymous users from viewing your profile

By making your profile private, you limit access to your online profile only to friends and people you know.

Authorize and add as friends only people you know

The smaller your inner circle of friends, the more private your online profile is.

Never trust online-only acquaintances

It’s important to keep in mind that people and their identities are not always what they claim to be, and you should not blindly trust people that you meet online. Don’t meet these people in real life except in very public, safe places, and you must strive to avoid any other physical contact with them.

You may have heard the dramatic story of a girl committing suicide after her online date supposedly let her down, whereas in fact the cheating partner was the mother of a teenager who didn’t want her son to date the girl. If she had been a little less trusting of what she read online, she would probably be alive today.

Favor sites that use encryption

Facebook, for example, encrypts your interactive sessions, whereas Myspace hasn’t yet followed suit. Encryption garbles data in transit so that no-one can read intercepted information, protecting your passwords and other information from outsiders.

Report abuse

Should you encounter cases of spam, harassment, stalking or other intrusions into your private life, you should report such incidents to the people responsible for proper conduct on the social networking site. Consult the FAQ or Contact Us section to find specific contact information.

Don’t access SNs from your workplace

Research indicates that half of the workforce access SNs during the workday, reducing productivity and distracting from work-related issues. Such activities may also be in violation of your employer’s “appropriate Internet use” policies.

Summary

Social networks are growing in scope and number of subscribers. People use it for business, personal and leisure contacts. It’s important to remember that the information you provide about yourself is easily available even if you designate your online profile as “private”, so never publish any information about yourself that can be used to hurt you. Remember, employing safe internet usage practices, common sense and knowledge is the best protection online.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Security Insight | 5 Comments »

Lower user privileges

June 13th, 2008 by Igor Pankov

Working with the rights of an Administrator is not advisable because admins are highest in a user hierarchy and therefore are allowed to exercise full control of a system. If the user is logged on with admin’s privileges, he/she can start any program, install any driver, register arbitrary service and do just about every other type of activity that could be dangerous to a PC. If malware is unknowingly started with the admin rights, it can do whatever it wants.

On the other hand, if a user is logged on as Restricted User, for instance, he is not allowed to make critical modifications to the system and run vulnerable services. This limits the impact of possible malware if it’s started from the limited account.

Users can designate/change account properties from the Control Panel’s User Accounts menu by clicking “Change my account type”.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Security Tip of the Week | 5 Comments »

Zero-day (0-day or 0day) malware

June 12th, 2008 by Igor Pankov

Zero-day is often referred to as unknown, or recently discovered samples of malicious code or exploits that are not yet covered by antivirus or security companies, consequently, there is no antidote to it. Zero-day malware or attacks are most dangerous because they cannot be tackled with the use of signatures that identify such threats and help block them.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Security Glossary | 1 Comment »

Proactive Protection

June 7th, 2008 by Igor Pankov

Any of the broad characteristics of a security system that centers on preempting a threat rather than removing it after the infection has ensued. Proactive Protection is the term often used interchangeably with technologies similar to HIPS when talking about blocking unauthorized activity or non-signature detection in antivirus programs that involves sample analysis for potential virus-like behavior.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Security Glossary | No Comments »

Useful Security Links (June 2008), Part 1

June 6th, 2008 by Igor Pankov
  1. Wal-Mart website hit by Flash hole
  2. Firm fights virtual worms that steal
  3. Bluetooth, IE to get critical Microsoft patches
  4. Hackers hijack hacking tools website
  5. Comcast Hijackers Say They Warned the Company First
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted in Useful Security Links | No Comments »

« Previous Entries