block_3_part_3_application_security__part__a__printable
block_3_part_3_application_security__part__a__printable
Block 3 Part 3
Introduction
So far in Block 3, you have learned about security from the wider perspective of the IT
infrastructure, by looking at protecting networks. You then examined security from the
perspective of an end user by looking at what it means to protect hosts on a network. In
this part, you will start to examine application security, which you will do broadly in two
parts. This week, you will look at the need for application security, the types of application
that need protecting and the threats that exist in various application domains. You will also
examine some of the processes used in the development of secure software.
In the second half of application security next week (Part 4), you will examine in more
detail countermeasure techniques. You will look at security controls and configuration
techniques employed by software to militate against attack. This is followed by a look at
security testing techniques; in particular, application penetration testing. To conclude, you
will look at the importance of keeping applications up to date.
During both weeks, you will engage with learning activities through a variety of tasks such
as reading, research and tutor group forum discussions. You will examine case studies
and complete practical NetLabs activities, which you will also reflect on in your learning
journal.
Let’s consider one of the most critical application vulnerabilities to have arisen over the
past decade, the OpenSSL Heartbleed vulnerability. What’s worth noting about this
vulnerability is that OpenSSL is one of the most popular open-source applications and
forms the basis of web security as we know it today.
Heartbleed appeared in 2014 and it was quickly discovered that attackers were able to
exploit OpenSSL along with Transport Layer Security (TLS) and Secure Sockets Layer
(SSL). In doing so, this left critical vulnerabilities in web servers that had implemented
HTTPS, allowing an attacker to trick the server into revealing, for example, usernames
and passwords. The CVE website, which is responsible for identifying publicly
disclosed cyber security vulnerabilities, defined Heartbleed as: ‘TLS implementations
in OpenSSL (before 1.0.1g) do not properly handle Heartbeat extension packets,
which allows remote attackers to obtain sensitive information from process memory via
crafted packets’ (CVE, 2014).
The Carnegie Mellon University Software Engineering Institute (SEI) emergency
response coordination centre also highlighted the seriousness of the vulnerability as
well as the impact it was likely to have. They described how remote unauthenticated
attackers were able to gain access to sensitive information, such as secret keys, and:
‘By leveraging this information, an attacker may be able to decrypt, spoof, or perform
man-in-the-middle attacks on network traffic that would otherwise be protected by
OpenSSL’ (Carnegie Mellon University, 2013).
Computers that are communicating using SSL periodically send each other a
‘heartbeat’ to keep the link active. One device sends an encrypted request, to which
the other responds. The problem arose because the size of the request was remaining
unchecked, which meant sometimes that space in memory was not being allocated as
it should, thus leaving the memory space vulnerable. The problem was caused by an
error in a single line of code:
memcpy (bp, pl, payload);
There was no attempt made in the code to check that the amount of data being copied
from a location was equal to the actual space allocated for the payload value.
Fortunately, this vulnerability was found before any significant damage could be done,
but it is important to highlight it, as seemingly insignificant errors in code can have a
massive impact.
Finally, to give perspective to this application flaw, the BuiltWith website (which
provides statistics on web technologies) estimated that, as of April 2021, there were
approximately 12.5 million websites relying on OpenSSL (BuiltWith, 2021).
Now consider the following discussion on wider issues relating to open-source
software.
Going back ten years or so, there was a perception that open-source software is
insecure and unreliable as it is developed and maintained by a community (as
opposed to paid developers).
Do you think this perception is still valid today? Post your thoughts in your tutor group
forum.
Requirements
Design
Implementation
Testing
Maintenance
This is only one example of a technique used for the development of software. Later this
week, you will examine in more detail the secure software development process.
The EC-Council article goes on to define the challenges in ensuring application security,
as well as making the claim that not enough time is dedicated to application security (as it
is to network security). One challenge is a workforce shortage: it is difficult to recruit
specialist knowledge into the many different domains of cyber security. Also, it can often
be difficult to meet the demands of the testing process, which can, at times, end up in an
almost endless cycle as applications have to be continually patched and fixed.
The article finishes with recommendations on how challenges can be faced, for example,
by using proactive security measures to allow better investment of time, and also by
making sure that vulnerabilities and ‘holes’ in software aren’t left unattended.
We all know that software contains flaws and that this is the major cause of
security vulnerabilities.
(Veracode, 2021)
Discussion
1. The retail and hospitality sector.
2. The vulnerabilities were ranked as high severity.
3. The industry could benefit from adopting DevSecOps practices because some of
the code is older than that used in other industries and is not subjected to testing
that is as rigorous.
4. Some code libraries are developed and maintained by individuals and are not
subject to proper security auditing and penetration testing.
5. Perform frequent scanning and combine static and dynamic application security
testing.
100 SaaS
90
80
70
60
PaaS
50
40
30
20
IaaS
10
DaaS
0
Jul-2011
Jan-2004
Oct-2004
Jul-2005
Apr-2006
Jan-2007
Oct-2007
Jul-2008
Apr-2009
Jan-2010
Oct-2010
Apr-2012
Jan-2013
Oct-2013
Jul-2014
Apr-2015
Jan-2016
Oct-2016
Jul-2017
Apr-2018
Jan-2019
Figure 3.28 Trends in cloud technologies
In the context of cyber security and the challenges of applications in the cloud, the paper
discusses risks in sharing information with third parties and problems with unauthorised
users gaining access to data. The paper also touches on aspects of physical security and
the potential for loss of data due to disaster.
Architectural elements of security can also be considered, given that SaaS technology is
now enabling organisations to break free of the limitations of on-premises network
security appliances. Cloud vendors are now employing sophisticated firewall appliances
and configurations as well as advanced SIEM solutions. The paper concludes by saying
that as a result of the advanced cyber security solutions now being offered by SaaS
vendors, the vendors are able to gain high levels of trust with the customer – however,
protection of data still remains a concern.
side language). Today, we see a collection of applications communicating with each other
(using secure transmission methods), rather than one application running on a server.
These collections of applications are connected through a Representational State
Transfer (REST) API. The APIs themselves don’t store information because they exist
only to manage requests between different applications (i.e. they are stateless).
Some examples of technologies used in web architectures today include:
● REST API
● JSON, XML
● JavaScript
● Single Page Application (SPA) framework
● authentication and authorisation methods (e.g. login methods)
● web server platform (e.g. Linux, Apache or Nginx)
● database (e.g. MariaDB, MySQL)
● local data store (cookies, web storage).
Given the stateless nature of current web applications, you would think that they bring a
more sophisticated level of security, as data is not actually being stored. However, it could
be argued that the involvement of more technologies now creates a bigger attack surface.
According to Hoffman (2020): ‘Each of these new and upcoming technologies brings with
it new security holes to be found and exploited for good or for evil. It is an exciting time to
be in the business of exploiting or securing web applications.’
External Internal
firewall Screening firewall
router
Internet/
external Internal
network network
Application layer
7. Application filtering HTTP/HTTPS
5. Session
TCP – filtering ports
4. Transport
IP – filtering IP addresses
3. Network
Firewall
2. Data-link
1. Physical
access (through browsers) but also a wide variety of services. ‘There is an app for
everything’ became the mantra of appified software ecosystems, which produced
numerous applications for all sorts of use cases and application areas (Fahl, 2019).
Figure 3.31 below outlines the close relationship between mobile and web applications as
well as how the various processes interact. It’s worth noting that secure development
happens at various stages; for example, security checks or vetting by the app store as
well as within infrastructure, web services and applications. Applications are verified
before release through stores.
Client-side Server-side
Install apps
Mobile Published/
device App store
Update apps
App
User server data Developer
exchange
HTTPS
request
Web Web/app
browser server
HTTPS
response
Answer
1. Apps are being produced by inexperienced (citizen) developers. APIs that are
used may be from unreliable or untrusted sources, and therefore insecure.
2. Unsecure apps being vulnerable to attacks, such as code injection, and apps
being hosted on unsecure infrastructure.
This activity ties in closely with some of the mobile device concepts that you have just
been reading about. You will use a virtual Android device manager and command-line
tools to debug a phone. The objective for this activity is for you to deploy devices
securely in a given scenario.
Go to NetLabs and complete NetLabs Activity 20: Working with Android. The
instructions to this activity are embedded within the NetLabs environment but a
download is also available from the NetLabs resources page on the module website.
Reflection
After you have completed the activity, write a short reflective account in your learning
journal about any challenges you faced and what you learned from it.
2.4 Virtualisation
You have learned about virtualisation at various points throughout this module; however,
it’s also worth examining the benefits of virtualisation to application security. Virtualisation
is the process of running (emulating) hardware and software within its own isolated
environment. When we create virtual machines (VMs), we can use a hypervisor (either
type 1 or 2) to manage hardware and share hardware resources and operating systems.
This means also running associated applications within the isolated operating system,
which creates additional layers of security.
An operating system and its applications running inside a virtual environment is likely to
be protected in the same way any non-VM-based operating system and applications are –
for example, through host-based security mechanisms like antivirus. The hypervisor may
also offer intrusion detection features, where the hypervisor would alert the VM of any
compromise. Hypervisors and VMs themselves, however, do become targets of VM DoS
attacks. In this case, the attacks have the aim of blocking and/or disrupting the operation
of a VM but not necessarily trying to gain control or access/extract data.
Vulnerabilities and lack of security configuration in VM management consoles (used for
the management of VM resources) can lead to the shutdown of VMs. Virtual networking
hardware can also be the target of DDoS attacks, in which VMs can be overloaded with
data, causing them to slow down or become completely unavailable. These types of
attack are commonly militated against by administrators reconfiguring hardware to reduce
the hardware footprint of the VM that is under attack – for example, deallocating RAM,
disk space and CPU functions.
Other more elaborate attacks may take place, such as exposing inherent flaws in the VM
software itself, kernel exploitations associated with the operating system running on the
VM and hyperjacking/injection, in which we see the addition of a malicious hypervisor.
2.4.1 Containers
We cannot mention virtualisation security without also discussing the security of
containers. Over recent years, containers have become a very popular method of
building, packaging and deploying software. Containers have the following benefits:
As the popularity of containers has recently risen, so have the threats against them. For
attackers, a compromised container is potentially an entry point into an organisation’s
system. There is also the potential for traffic traversing a network to be compromised –
much the same scenario as described in previous sections this week.
3.1 DevSecOps
The software development industry has seen a shift over recent years in how security
processes are integrated into the development of applications. The area of DevSecOps
aims to integrate security into already existing methodologies (e.g. agile development).
IBM (2020) describes DevSecOps as: ‘short for development, security, and operations –
[it] automates the integration of security at every phase of the software development
lifecycle, from initial design through integration, testing, deployment, and software
delivery.’
As highlighted earlier this week, security was sometimes regarded as an afterthought and
took place near the end of the development process during the testing phase, and also
when applications were updated once or twice a year. Testing was also typically carried
out by a separate testing and quality assurance team (this, however, may still sometimes
be the case). As well as integrating security at every stage of development, DevSecOps
aims to develop the culture in development teams that everyone is responsible for
security, not just the testers.
There have been many factors that have contributed to the rise of DevSecOps – for
example, the increased importance of security for cloud, mobile and web application
services, increases in numbers of security incidents, and data protection requirements for
cloud tenants. Figure 3.32, below, outlines the integration of teams within an organisation
as well as the drivers and challenges that they face in the development of secure
services.
External factors
Regulation
Compliance
Market Development teams
Secure
Quality Assurance Security services
New
technology
Security threats Operations/IT
Rapid
releases
Challenges
Figure 3.32 DevSecOps teams and the external factors and challenges they face
The DevSecOps environment operates as follows:
● The development team is responsible for carrying out security testing, along with
‘traditional’ testing teams (QA), with input from operational staff.
● The development team is responsible for managing and fixing any issues that are
found.
● The development team is trained to manage and fix issues to keep issues internal
(in-house) to development processes (not having to rely on external developers to
carry out fixes).
With the rise in popularity of web applications, cloud SaaS and containers, large
(monolithic) applications are now broken down into smaller parts that run more
independently, such as the web application architectural elements mentioned in
Section 2.2.1. This, of course, has led to changes in the development/release cycle: agile
development practices with rolling releases, where software is developed and released at
a rapid pace. Among these, however, there are also now automated development and
testing tools, allowing teams to keep abreast of the rapid changes required.
When software development is approached using agile practices: ‘… it’s generally good to
live by these values and principles and use them to help figure out the right things to do
given your particular context’ (Agile Alliance, 2021).
● With CI, each change in code triggers an automated build-and-test sequence for the
given project, providing feedback to the developer(s) who made the change. The
entire CI feedback loop should run (carried out) in less than ten minutes.
● CD includes infrastructure provisioning and deployment, which may consist of
multiple stages. What’s important is that all these processes are fully automated, with
each development run fully logged and visible to the entire team.
From an application security perspective, CI/CD is critical for the following reasons:
● It allows developers to focus on writing while monitoring the behaviour of the system.
● All code changes, tests and deployments are logged, should there be any need for
inspection (if security issues arise).
● Rolling back to previous versions is a straightforward process.
● The rapid development cycle encourages a culture of responsibility.
We have already hinted at methods we can use during the development process to
secure applications, as well as factors that need to be taken into consideration when
developing applications across different areas such as web, mobile and the cloud. In the
final section of this week, you will examine some of the threats that exist against
applications, and you will also complete this week’s practical exercise where you’ll look at
Cross-Site Scripting.
Given the range and complexity of applications, the threats that exist against them have
become equally complex. The demand for the development of secure applications has
also grown, being driven by a number of factors, such as the external factors identified in
Figure 3.32 (Section 3.1).
Gartner (2020) also says that IT managers: ‘need to go beyond identifying common
application development security errors and protecting against common attack
techniques.’
The Common Weakness Enumeration (CWE) website provides a good starting point for
the identification of threats that exist against applications, some of which you will now
examine.
An XSS attack is most commonly found in JavaScript; however, it can also be found in
HTML and CSS, as well as older web technologies such as Flash and ActiveX (in older
web browsers).
Figure 3.33 demonstrates a stored attack, where an attacker sends a malicious script that
is stored in a database, which then attaches itself to a vulnerable website. The user
accesses the vulnerable site and the malicious script is sent to the user (to be used for
malicious purposes).
Web Database
Malicious server server
script
Attacker
Data sent
to attacker
It’s worth noting that a lot of security misconfigurations are brought about by human
factors/errors, which you will find is a common theme throughout the module.
database, which can result in the loss of data, corruption of tables, or, worse, the loss of
the database itself.
Over the last 20 or so years, SQL has become one of the fundamental elements in
contemporary web development. Used alongside a server-side scripting language
(e.g. PHP), SQL provides the mechanism for interacting directly with the database. The
scripting language is responsible for interacting with the web page (displaying
information), handling the connection to the database and initiating queries via SQL.
SQL’s role alongside the scripting language (being processed by the server) leaves it
vulnerable to malicious injection. According to Hoffman (2020): ‘Old-school PHP
developers would interweave a combination of SQL, HTML, and PHP into their PHP files
– an organizational model supported by PHP that would be misused, resulting in an
enormous amount of vulnerable PHP code.’
Normally, an SQL string is escaped in a HTTP payload, which then leads to the altered
SQL queries being executed on behalf of the end user, as shown in Figure 3.34.
data that is stored in an unsecure temporary access area within memory, revealing
information in the system. If data is written beyond the end of the space allocated,
important data may be lost. Buffer overflows are a common type of DoS attack.
There are four common types of buffer overflow attack:
The Heartbleed example that we examined at the beginning of this week is a classic
example of a buffer overflow attack.
Session cookies are typically used by banking and eCommerce sites to remember
customer information and are therefore vulnerable to attack. Ways to avoid CSRF are as
follows:
● Carry out online banking in a separate browser application to that which you use for
regular internet usage.
● Avoid suspicious emails.
● When using banking or eCommerce sites, make sure to log off completely (instead of
closing the window or browser with the session still open).
and leading educational and training conferences, the OWASP Foundation is the source
for developers and technologists to secure the web’ (OWASP, 2021b).
OWASP is known mainly for its OWASP Top Ten, which is an online reference document
for outlining and providing detailed information on the ten most critical web application
security concerns. Data from a number or organisations all over the world is analysed and
then put together to form an ‘awareness document’, in which recommendations are made
as to how organisations can mitigate security risks.
This activity ties in closely with some of the concepts that you have been examining
this week, and introduces some concepts you will learn about next week. The activity
has two objectives:
Go to NetLabs and complete NetLabs Activity 21: Web Application Scanning. The
instructions to this activity are embedded within the NetLabs environment but a
download is also available from the NetLabs resources page on the module website.
Reflection
After you have completed the activity, write a short reflective account in your learning
journal about any challenges you faced and what you learned from it.
Summary
During this week, you have examined the basics of application security. You looked at the
need for security and why it is important in the context of different application domains,
such as web, mobile and virtualisation.
You then considered some of the different techniques that are employed by developers
when developing secure software, such as traditional development life cycle approaches,
as well as newer techniques, such as DevSecOps and CI/CD.
You then finished off this week by looking at some of the threats that exist against
applications.
In the next part of Block 3, you will continue to study the topic of application security and
learn about some of the techniques that can be employed as countermeasures to such
threats.
References
Agile Alliance (2021) What is agile?. Available at: https://www.agilealliance.org/agile101
(Accessed: 1 May 2021).
BuiltWith (2021) OpenSSL usage statistics. Available at: https://tinyurl.com/2uth6cdd
(Accessed: 1 April 2021).
Carnegie Mellon University (2013) Software Engineering Institute: OpenSSL TLS
heartbeat extension read overflow discloses sensitive information. Available at: https://
www.kb.cert.org/vuls/id/720951 (Accessed: 1 April 2021).
CVE (2014) CVE-2014-0160. Available at: https://cve.mitre.org/cgi-bin/cvename.cgi?
name=cve-2014-0160 (Accessed: 1 April 2021).
Dynatrace (2021) Securing cloud-native applications. Available at: https://www.dynatrace.
com/monitoring/platform/application-security (Accessed: 1 April 2021).
EC-Council (2020) Why is application security important?. Available at: https://www.
eccouncil.org/what-is-application-security/ (Accessed: 1 April 2020).
Fahl, S. (2019) Web and mobile security knowledge area. Available at: https://www.cybok.
org/media/downloads/Web__Mobile_Security_issue_1.0_XFpbYNz.pdf (Accessed: 1
April 2021).
Fehér, D.J. and Sándor, B. (2019) ‘Cloud SaaS security issues and challenges’, 2019
IEEE 13th international Symposium on Applied Computational Intelligence and
Informatics (SACI), Timisoara, Romania, 29–31 May. Pp. 000131–000134. doi:10.1109/
SACI46893.2019.9111529.
Gartner (2020) Hype cycle for application security, 2020. Available at: https://www.gartner.
com/doc/reprints?id=1-24AQLK47&ct=201002&st=sb (Accessed: 1 April 2020).
Hoffman, A.J. (2020) Web application security: exploitation and countermeasures for
modern web applications. Beijing: O’Reilly Media.
IBM (2020) What is DevSecOps?. Available at: https://www.ibm.com/cloud/learn/
devsecops (Accessed: 1 May 2021).
OWASP (2021a) A6:2017-Security misconfiguration. Available at: https://owasp.org/
www-project-top-ten/2017/A6_2017-Security_Misconfiguration (Accessed: 1 April 2021).
All rights including copyright in these materials are owned or controlled by The Open
University and are protected by copyright in the United Kingdom and by international
treaties worldwide.
In accessing these materials, you agree that you may only use the materials for your
own personal non-commercial use.
You are not permitted to copy, broadcast, download, store (in any medium), transmit,
show or play in public, adapt or change in any way these materials, in whole or in part,
for any purpose whatsoever without the prior written permission of The Open
University.
WEB 10948 5
1.1