Web Application Security Consortium:
Threat Classification
www.webappsec.org
Version: 1.00
Copyright 2004, Web Application Security Consortium. All rights reserved.
Description
The Web Security Threat Classification is a cooperative effort to
clarify and organize the threats to the security of a web site. The
members of the Web Application Security Consortium have created
this project to develop and promote industry standard terminology for
describing these issues. Application developers, security
professionals, software vendors, and compliance auditors will have
the ability to access a consistent language for web security related
issues.
Goals
- Identify all known web application security classes of attack.
- Agree on naming for each class of attack.
- Develop a structured manner to organize the classes of attack.
- Develop documentation that provides generic descriptions of
each class of attack.
Documentation Uses
Further understand and articulate the security risks that threaten web
sites. Enhance secure programming practices to prevent security
issues during application development. Serve as a guideline to
determine if web sites have been designed, developed, and reviewed
against all the known threats. Assist with understanding the
capabilities and selection of web security solutions.
Table of Contents
DESCRIPTION
GOALS
DOCUMENTATION USES
TABLE OF CONTENTS
OVERVIEW
BACKGROUND
CONTRIBUTORS
CHECKLIST
CLASSES OF ATTACK
1 Authentication
1.1 Brute Force
1.2 Insufficient Authentication
1.3 Weak Password Recovery Validation
2 Authorization
2.1 Credential/Session Prediction
2.2 Insufficient Authorization
2.3 Insufficient Session Expiration
2.4 Session Fixation
3 Client-side Attacks
3.1 Content Spoofing
3.2 Cross-site Scripting
4 Command Execution
4.1 Buffer Overflow
4.2 Format String Attack
4.3 LDAP Injection
4.4 OS Commanding
4.5 SQL Injection
4.6 SSI Injection
4.7 XPath Injection
5 Information Disclosure
5.1 Directory Indexing
5.2 Information Leakage
5.3 Path Traversal
5.4 Predictable Resource Location
6 Logical Attacks
6.1 Abuse of Functionality
6.2 Denial of Service
6.3 Insufficient Anti-automation
6.4 Insufficient Process Validation
CONTACT
APPENDIX
1.1 HTTP Response Splitting
1.2 Web Server/Application Fingerprinting
LICENSE
Overview
For many organizations, web sites serve as mission critical systems
that must operate smoothly to process millions of dollars in daily
online transactions. However, the actual value of a web site needs to
be appraised on a case-by-case basis for each organization. Tangible
and intangible value of anything is difficult to measure in monetary
figures alone.
Web security vulnerabilities continually impact the risk of a web site.
When any web security vulnerability is identified, performing the
attack requires using at least one of several application attack
techniques. These techniques are commonly referred to as the class
of attack (the way a security vulnerability is taken advantage of).
Many of these types of attack have recognizable names such as
Buffer Overflows, SQL Injection, and Cross-site Scripting. As a
baseline, the class of attack is the method the Web Security Threat
Classification will use to explain and organize the threats to a web
site.
The Web Security Threat Classification will compile and distill the
known unique classes of attack, which have presented a threat to
web sites in the past. Each class of attack will be given a standard
name and explained with thorough documentation discussing the key
points. Each class will also be organized in a flexible structure.
The formation of a Web Security Threat Classification will be of
exceptional value to application developers, security professionals,
software vendors or anyone else with an interest in web security.
Independent security review methodologies, secure development
guidelines, and product/service capability requirements will all benefit
from the effort.
Background
Over the last several years, the web security industry has adopted
dozens of confusing and esoteric terms describing vulnerability
research. Terms such as Cross-site Scripting, Parameter Tampering,
and Cookie Poisoning have all been given inconsistent names and
double meanings attempting to describe their impact.
For example, when a web site is vulnerable to Cross-site Scripting,
the security issue can result in the theft of a users cookie. Once the
cookie has been compromised, this enables someone to perform a
session hijacking and take over the user's online account. To take
advantage of the vulnerability, an attacker uses data input
manipulation by way of URL parameter tampering.
This previous attack description is confusing and can be described
using all manner of technical jargon. This complex and
interchangeable vocabulary causes frustration and disagreement in
open forums, even when the participants agree on the core concepts.
Through the years, there has been no well-documented,
standardized, complete, or accurate resource describing these
issues. In doing our work, we've relied upon tidbits of information
from a handful of books, dozens of white papers and hundreds of
presentations.
When web security newcomers arrive to study, they quickly become
overwhelmed and confused by the lack of standard language present.
This confusion traps the web security field in a blur and slows
ongoing progress. We need a formal, standardized approach to
discuss web security issues as we continue to improve the security of
the Web.
Contributors
Robert Auger - SPI Dynamics
Ryan Barnett - Center for Internet Security (Apache Project Lead)
Yuval Ben-Itzhak - Individual
Erik Caso - NT OBJECTives
Cesar Cerrudo - Application Security Inc.
Sacha Faust - SPI Dynamics
JD Glaser - NT OBJECTives
Jeremiah Grossman - WhiteHat Security
Sverre H. Huseby - Individual
Amit Klein - Sanctum
Mitja Kolsek - Acros Security
Aaron C. Newman - Application Security Inc.
Steve Orrin - Sanctum
Bill Pennington - WhiteHat Security
Ray Pompon - Conjungi Networks
Mike Shema - NT OBJECTives
Ory Segal - Sanctum
Caleb Sima - SPI Dynamics
Checklist
Authentication
Brute Force:
A Brute Force attack is an automated process of trial and error used to
guess a person's username, password, credit-card number or
cryptographic key.
Insufficient Authentication:
Insufficient Authentication occurs when a web site permits an attacker to
access sensitive content or functionality without having to properly
authenticate.
Weak Password Recovery Validation:
Weak Password Recovery Validation is when a web site permits an
attacker to illegally obtain, change or recover another user's password.
Authorization
Credential/Session Prediction:
Credential/Session Prediction is a method of hijacking or impersonating a
web site user.
Insufficient Authorization:
Insufficient Authorization is when a web site permits access to sensitive
content or functionality that should require increased access control
restrictions.
Insufficient Session Expiration:
Insufficient Session Expiration is when a web site permits an attacker to
reuse old session credentials or session IDs for authorization.
Session Fixation:
Session Fixation is an attack technique that forces a user's session ID to
an explicit value.
Client-side Attacks
Content Spoofing:
Content Spoofing is an attack technique used to trick a user into believing
that certain content appearing on a web site is legitimate and not from an
external source.
Cross-site Scripting:
Cross-site Scripting (XSS) is an attack technique that forces a web site to
echo attacker-supplied executable code, which loads in a user's browser.
Command Execution
Buffer Overflow:
Buffer Overflow exploits are attacks that alter the flow of an application by
overwriting parts of memory.
Format String Attack:
Format String Attacks alter the flow of an application by using string
formatting library features to access other memory space.
LDAP Injection:
LDAP Injection is an attack technique used to exploit web sites that
construct LDAP statements from user-supplied input.
OS Commanding:
OS Commanding is an attack technique used to exploit web sites by
executing Operating System commands through manipulation of
application input.
SQL Injection:
SQL Injection is an attack technique used to exploit web sites that
construct SQL statements from user-supplied input.
SSI Injection:
SSI Injection (Server-side Include) is a server-side exploit technique that
allows an attacker to send code into a web application, which will later be
executed locally by the web server.
XPath Injection:
XPath Injection is an attack technique used to exploit web sites that
construct XPath queries from user-supplied input.
Information Disclosure
Directory Indexing:
Automatic directory listing/indexing is a web server function that lists all of
the files within a requested directory if the normal base file is not present.
Information Leakage:
Information Leakage is when a web site reveals sensitive data, such as
developer comments or error messages, which may aid an attacker in
exploiting the system.
Path Traversal:
The Path Traversal attack technique forces access to files, directories,
and commands that potentially reside outside the web document root
directory.
Predictable Resource Location
Predictable Resource Location is an attack technique used to uncover
hidden web site content and functionality.
Logical Attacks
Abuse of Functionality:
Abuse of Functionality is an attack technique that uses a web site's own
features and functionality to consume, defraud, or circumvents access
controls mechanisms.
Denial of Service:
Denial of Service (DoS) is an attack technique with the intent of
preventing a web site from serving normal user activity.
Insufficient Anti-automation:
Insufficient Anti-automation is when a web site permits an attacker to
automate a process that should only be performed manually.
Insufficient Process Validation:
Insufficient Process Validation is when a web site permits an attacker to
bypass or circumvent the intended flow control of an application.
Classes of Attack
1 Authentication
The Authentication section covers attacks that target a web site's
method of validating the identity of a user, service or application.
Authentication is performed using at least one of three mechanisms:
"something you have", "something you know" or "something you are".
This section will discuss the attacks used to circumvent or exploit the
authentication process of a web site.
1.1 Brute Force
A Brute Force attack is an automated process of trial and error used
to guess a person's username, password, credit-card number or
cryptographic key.
Many systems will allow the use of weak passwords or cryptographic
keys, and users will often choose easy to guess passwords, possibly
found in a dictionary. Given this scenario, an attacker would cycle
though the dictionary word by word, generating thousands or
potentially millions of incorrect guesses searching for the valid
password. When a guessed password allows access to the system,
the brute force attack has been successful and the attacker is able
access the account.
The same trial and error technique is also applicable to guessing
encryption keys. When a web site uses a weak or small key size, its
possible for an attacker to guess a correct key by testing all possible
keys.
Essentially there are two types of brute force attacks, (normal) brute
force and reverse brute force. A normal brute force attack uses a
single username against many passwords. A reverse brute force
attack uses many usernames against one password. In systems with
millions of user accounts, the odds of multiple users having the same
password dramatically increases. While brute force techniques are
highly popular and often successful, they can take hours, weeks or
years to complete.
Example
Username = Jon
Passwords = smith, michael-jordan, [pet names], [birthdays], [car
names],
Usernames = Jon, Dan, Ed, Sara, Barbara, .....
Password = 12345678
References
"Brute Force Attack", Imperva Glossary
http://www.imperva.com/application_defense_center/glossary/brute_f
orce.html
"iDefense: Brute-Force Exploitation of Web Application Session ID's",
By David Endler - iDEFENSE Labs
http://www.cgisecurity.com/lib/SessionIDs.pdf
1.2 Insufficient Authentication
Insufficient Authentication occurs when a web site permits an attacker
to access sensitive content or functionality without having to properly
authenticate. Web-based administration tools are a good example of
web sites providing access to sensitive functionality. Depending on
the specific online resource, these web applications should not be
directly accessible without the user required to properly verify their
identity.
To get around setting up authentication, some resources are
protected by "hiding" the specific location and not linking the location
into the main web site or other public places. However, this approach
is nothing more than "Security Through Obscurity". Its important to
understand that simply because a resource is unknown to an
attacker, it still remains accessible directly through a specific URL.
The specific URL could be discovered through a Brute Force probing
for common file and directory locations (/admin for example), error
messages, referrer logs, or perhaps documented in help files. These
resources, whether they are content or functionality driven, should be
adequately protected.
Example
Many web applications have been designed with administrative
functionality location directory off the root directory (/admin/). This
directory is usually never linked to anywhere on the web site, but can
still be accessed using a standard web browser.
Since the user or developer never expected anyone to view this page
since its not linked, adding authentication is many times overlooked.
If an attacker were to simply visit this page, they would obtain
complete administrative access to the web site.
1.3 Weak Password Recovery Validation
Weak Password Recovery Validation is when a web site permits an
attacker to illegally obtain, change or recover another user's
password. Conventional web site authentication methods require
users to select and remember a password or passphrase. The user
should be the only person that knows the password and it must be
remembered precisely. As time passes, a user's ability to remember
a password fades. The matter is further complicated when the
average user visits 20 sites requiring them to supply a password.
(RSA Survey: http://news.bbc.co.uk/1/hi/technology/3639679.stm)
Thus, Password Recovery is an important part in servicing online
users.
Examples of automated password recovery processes include
requiring the user to answer a "secret question" defined as part of the
user registration process. This question can either be selected from a
list of canned questions or supplied by the user. Another mechanism
in use is having the user provide a "hint" during registration that will
help the user remember his password. Other mechanisms require the
user to provide several pieces of personal data such as their social
security number, home address, zip code etc. to validate their
identity. After the user has proven who they are, the recovery system
will display or e-mail them a new password.
A web site is considered to have Weak Password Recovery
Validation when an attacker is able to foil the recovery mechanism
being used. This happens when the information required to validate a
user's identity for recovery is either easily guessed or can be
circumvented. Password recovery systems may be compromised
through the use of brute force attacks, inherent system weaknesses,
or easily guessed secret questions.
Example
(Weak methods of password recovery)
Information Verification
Many web sites only require the user to provide their e-mail address
in combination with their home address and telephone number. This
information can be easily obtained from any number of online white
pages. As a result, the verification information is not very secret.
Further, the information can be compromised via other methods such
as Cross-site Scripting and Phishing Scams.
Password Hints
A web site using hints to help remind the user of their password can
be attacked because the hint aids Brute Force attacks. A user may
have fairly good password of "122277King" with a corresponding
password hint of "bday+fav author". An attacker can glean from this
hint that the user's password is a combination of the users birthday
and the user's favorite author. This helps narrowing the dictionary
Brute Force attack against the password significantly.
Secret Question and Answer
A user's password could be "Richmond" with a secret question of
"Where were you born". An attacker could then limit a secret answer
Brute Force attack to city names. Furthermore, if the attacker knows
a little about the target user, learning their birthplace is also an easy
task.
References
"Protecting Secret Keys with Personal Entropy", By Carl Ellison, C. Hall, R. Milbert, and B. Schneier
http://www.schneier.com/paper-personal-entropy.html
"Emergency Key Recovery without Third Parties", Carl Ellison
http://theworld.com/~cme/html/rump96.html
2 Authorization
The Authorization section covers attacks that target a web site's
method of determining if a user, service, or application has the
necessary permissions to perform a requested action. For example,
many web sites should only allow certain users to access specific
content or functionality. Other times a user's access to other
resources might be restricted. Using various techniques, an attacker
can fool a web site into increasing their privileges to protected areas.
2.1 Credential/Session Prediction
Credential/Session Prediction is a method of hijacking or
impersonating a web site user. Deducing or guessing the unique
value that identifies a particular session or user accomplishes the
attack. Also known as Session Hijacking, the consequences could
allow attackers the ability to issue web site requests with the
compromised user's privileges.
Many web sites are designed to authenticate and track a user when
communication is first established. To do this, users must prove their
identity to the web site, typically by supplying a username/password
(credentials) combination. Rather than passing these confidential
credentials back and forth with each transaction, web sites will
generate a unique "session ID" to identify the user session as
authenticated. Subsequent communication between the user and the
web site is tagged with the session ID as "proof" of the authenticated
session. If an attacker is able predict or guess the session ID of
another user, fraudulent activity is possible.
Example
Many web sites attempt to generate session IDs using proprietary
algorithms. These custom methodologies might generation session
IDs by simply incrementing static numbers. Or there could be more
complex procedures such as factoring in time and other computer
specific variables.
The session ID is then stored in a cookie, hidden form-field, or URL. If
an attacker can determine the algorithm used to generate the session
ID, an attack can be mounted as follows:
1) attacker connects to the web application acquiring the current
session ID.
2) attacker calculates or Brute Forces the next session ID.
3) attacker switches the current value in the cookie/hidden form-
field/URL and assumes the identity of the next user.
References
"iDefense: Brute-Force Exploitation of Web Application Session ID's", By David Endler - iDEFENSE Labs
http://www.cgisecurity.com/lib/SessionIDs.pdf
"Best Practices in Managing HTTP-Based Client Sessions", Gunter Ollmann - X-Force Security Assessment Services EMEA
http://www.itsecurity.com/papers/iss9.htm
"A Guide to Web Authentication Alternatives", Jan Wolter
http://www.unixpapa.com/auth/homebuilt.html
2.2 Insufficient Authorization
Insufficient Authorization is when a web site permits access to
sensitive content or functionality that should require increased access
control restrictions. When a user is authenticated to a web site, it
does not necessarily mean that he should have full access to all
content and that functionality should be granted arbitrarily.
Authorization procedures are performed after authentication,
enforcing what a user, service or application is permitted to do.
Thoughtful restrictions should govern particular web site activity
according to policy. Sensitive portions of a web site may need to be
restricted to everyone expect to perhaps an administrator.
Example
In the past, many web sites have stored administrative content and/or
functionality the in hidden directories such as /admin or /logs. If an
attacker was to directly request these directories, he would be
allowed access. He may thus be able to reconfigure the web server,
access sensitive information or compromise the web site.
References
"Brute Force Attack", Imperva Glossary
http://www.imperva.com/application_defense_center/glossary/brute_force.html
"iDefense: Brute-Force Exploitation of Web Application Session ID's", By David Endler - iDEFENSE Labs
http://www.cgisecurity.com/lib/SessionIDs.pdf
2.3 Insufficient Session Expiration
Insufficient Session Expiration is when a web site permits an attacker
to reuse old session credentials or session IDs for authorization.
Insufficient Session Expiration increases a web site's exposure to
attacks that steal or impersonate other users.
Since HTTP is a stateless protocol, web sites commonly use session
IDs to uniquely identify a user from request to request. Consequently,
each session ID's confidentiality must be maintained in order to
prevent multiple users from accessing the same account. A stolen
session ID can be used to view another user's account or perform a
fraudulent transaction.
The lack of proper session expiration may improve the likely success
of certain attacks. For example, an attacker may intercept a session
ID, possibly via a network sniffer or Cross-site Scripting attack.
Although short session expiration times do not help if a stolen token
is immediately used, they will protect against ongoing replaying of the
session ID. In another scenario, a user might access a web site from
a shared computer (such as at a library, Internet cafe, or open work
environment). Insufficient Session Expiration could allow an attacker
to use the browser's back button to access web pages previously
accessed by the victim.
A long expiration time increases an attacker's chance of successfully
guessing a valid session ID. The long length of time increases the
number of concurrent and open sessions, which enlarges the pool of
numbers an attacker might guess.
Example
In a shared computing environment (more than one person has
unrestricted physical access to a computer), Insufficient Session
Expiration can be exploited to view another user's web activity. If a
web site's logout function merely sends the victim to the site's home
page without ending the session, another user could go through the
browser's page history and view pages accessed by the victim. Since
the victim's session ID has not been expired, the attacker would be
able to see the victim's session without being required to supply
authentication credentials.
References
"Dos and Don'ts of Client Authentication on the Web", Kevin Fu,
Emil Sit, Kendra Smith, Nick Feamster - MIT Laboratory for Computer Science
http://cookies.lcs.mit.edu/pubs/webauth:tr.pdf
2.4 Session Fixation
Session Fixation is an attack technique that forces a user's session
ID to an explicit value. Depending on the functionality of the target
web site, a number of techniques can be utilized to "fix" the session
ID value. These techniques range from Cross-site Scripting exploits
to peppering the web site with previously made HTTP requests. After
a user's session ID has been fixed, the attacker will wait for them to
login. Once the user does so, the attacker uses the predefined
session ID value to assume their online identity.
Generally speaking there are two types of session management
systems when it comes to ID values. The first type is "permissive"
systems that allow web browsers to specify any ID. The second type
is "strict" systems that only accept server-side generated values. With
permissive systems, arbitrary session IDs are maintained without
contact with the web site. Strict systems require the attacker to
maintain the "trap-session", with periodic web site contact, preventing
inactivity timeouts.
Without active protection against session fixation, the attack can be
mounted against any web site using sessions to identify
authenticated users. Web sites using sessions IDs are normally
cookie-based, but URLs and hidden form-fields are used as well.
Unfortunately, cookie-based sessions are the easiest to attack. Most
of the currently identified attack methods are aimed toward the
fixation of cookies.
In contrast to stealing a user's session ID after they have logged into
a web site, session fixation provides a much wider window of
opportunity. The active part of the attack takes place before the user
logs in.
Example
The session fixation attack is normally a three step process:
1) Session set-up
The attacker sets up a "trap-session" for the target web site and
obtains that session's ID. Or, the attacker may select an arbitrary
session ID used in the attack. In some cases, the established trap
session value must be maintained (kept alive) with repeated web
site contact.
2) Session fixation
The attacker introduces the trap session value into the user's
browser and fixes the user's session ID.
3) Session entrance
The attacker waits until the user logs into the target web site.
When the user does so, the fixed session ID value will be used
and the attacker may take over.
Fixing a user's session ID value can be achieved with the following
techniques:
Issuing a new session ID cookie value using a client-side script
A Cross-site Scripting vulnerability present on any web site in the
domain can be used to modify the current cookie value.
Code Snippet:
http://example/.idc
Issuing a cookie using the META tag
This method is similar to the previous one, but also effective when
Cross-site Scripting countermeasures prevent the injection of HTML
script tags, but not meta tags.
Code Snippet:
http://example/.idc
Issuing a cookie using an HTTP response header
The attacker forces either the target web site, or any other site in the
domain, to issue a session ID cookie. This can be achieved in many
ways:
_ Breaking into a web server in the domain (e.g., a poorly
maintained WAP server)
_ Poisoning a user's DNS server, effectively adding the attacker's
web server to the domain
_ Setting up a malicious web server in the domain (e.g., on a
workstation in Windows 2000 domain, all workstations are also
in the DNS domain)
_ Exploiting an HTTP response splitting attack
Note: A long-term Session Fixation attack can be achieved by issuing
a persistent cookie (e.g., expiring in 10 years), which will keep the
session fixed even after the user restarts the computer.
Code Snippet:
http://example/.idc
References
"Session Fixation Vulnerability in Web-based Applications", By Mitja Kolsek - Acros Security
http://www.acrossecurity.com/papers/session_fixation.pdf
"Divide and Conquer", By Amit Klein - Sanctum
http://www.sanctuminc.com/pdf/whitepaper_httpresponse.pdf
3 Client-side Attacks
The Client-side Attacks section focuses on the abuse or exploitation
of a web site's users. When a user visits a web site, trust is
established between the two parties both technologically and
psychologically. A user expects web sites they visit to deliver valid
content. A user also expects the web site not to attack them during
their stay. By leveraging these trust relationship expectations, an
attacker may employ several techniques to exploit the user.
3.1 Content Spoofing
Content Spoofing is an attack technique used to trick a user into
believing that certain content appearing on a web site is legitimate
and not from an external source.
Some web pages are served using dynamically built HTML content
sources. For example, the source location of a frame () could be specified
by a URL parameter value.
(http://foo.example/page?frame_src=http://foo.examp
le/file.html). An attacker may be able to replace the
"frame_src" parameter value with
"frame_src=http://attacker.example/spoof.html". When
the resulting web page is served, the browser location bar visibly
remains under the user expected domain (foo.example), but the
foreign data (attacker.example) is shrouded by legitimate
content.
Specially crafted links can be sent to a user via e-mail, instant
messages, left on bulletin board postings, or forced upon users by a
Cross-site Scripting attack. If an attacker gets a user to visit a web
page designated by their malicious URL, the user will believe he is
viewing authentic content from one location when he is not. Users will
implicitly trust the spoofed content since the browser location bar
displays http://foo.example, when in fact the underlying HTML
frame is referencing http://attacker.example.
This attack exploits the trust relationship established between the
user and the web site. The technique has been used to create fake
web pages including login forms, defacements, false press releases,
etc.
Example
Creating a spoofed press release. Lets say a web site uses
dynamically created HTML frames for their press release web pages.
A user would visit a link such as
(http://foo.example/pr?pg=http://foo.example/pr/010
12003.html). The resulting web page HTML would be:
Code Snippet: