API Security Testing The Challenges of Security Testing For Restful APIs
API Security Testing The Challenges of Security Testing For Restful APIs
ISSN No:-2456-2165
Fig. 1: Distribution of papers by model, approaches, and tools used for RESTful API security testing
Here are some key aspects to consider when testing the security flaws, SSL/TLS certificate validation problems, and
security of RESTful APIs: other concerns.
Authentication Test for weak authentication mechanisms, such as weak passwords or lack of multi-factor
authentication.
Authorisation Test for improper access controls, such as privilege escalation attacks or inadequate role-
based access controls.
Input Validation Test for proper validation of user inputs to prevent injection attacks, such as SQL injection or
cross-site scripting (XSS).
Error Handling Test for proper error handling, such as ensuring error messages do not reveal sensitive
information or cause application crashes.
Session Management Tests for proper session management, such as preventing session fixation attacks or session
hijacking attacks.
API Rate Limiting Test for proper API rate limiting to prevent denial of service (DoS) attacks or brute force
attacks.
Integration Testing Test for security vulnerabilities in third-party APIs or services that the API interacts with.
According to a study, data from online apps can leak III. RESTFUL API AND ITS ROLE IN MODERN
even when encryption is used (Chen et al., 2010). This is SOFTWARE DEVELOPMENT
done through routes known as "side channels." It was found
by Serme et al. (2012) that the security of RESTful services The use of HTTP requests to access and modify data in
is based either on transit layer security or ad hoc security web-based applications is known as a RESTful API.
techniques, both of which have security weaknesses. REST RESTful APIs have become integral to modern software
APIs can be examined for security issues using a collection development due to their flexibility, scalability, and ability
of automatic security evaluations; it has been found (Ovidiu to facilitate communication between different software
Baniaș et al., 2021). The risk that an attacker could take applications (Lablans et al., 2015). RESTful APIs give
advantage of a RESTful application programming interface programmers the ability to create web-based apps that are
weakness is alarmingly raised by these publications when simple to link with other software programs. RESTful APIs
taken as a whole. Although APIs can be exploited (Macy, use standard HTTP methods such as GET, POST, PUT, and
2018), the effects of a hacking attempt depend on the DELETE to access and manipulate data (Christensen, 2009).
situation and the type of data being transferred. RESTful APIs have become popular due to their ease of use,
low overhead, and ability to support different data formats.
They have become an essential part of modern software
development and are used in various domains, such as e-
commerce, finance, social media, and healthcare (Carneiro
et al., 2021).
Several types of security testing can be used to test the security of RESTful APIs.
A. Broken Object Level Authorisation significant loss of trust and financial damage for Equifax
The broken object-level authorisation is a vulnerability (Dennis et al., 2020).
that occurs when an API does not restrict access to objects
based on the user's privileges, and this means that a user can C. Excessive Data Exposure
access and modify any object within the API, even if they do The authors of the study Pan et al. (2023) showed that
not have the required permissions (Haddad & Malki, 2022). Excessive data exposure is a vulnerability that occurs when
Attackers can exploit this vulnerability to gain access to an API exposes more data than necessary, such as sensitive
sensitive data and perform unauthorised actions, as observed data or user credentials; attackers can exploit this
in the study of (Taya et al., 2022). vulnerability to gain access to sensitive data or perform
unauthorised actions.
The causes of this vulnerability include the lack of
proper access control mechanisms and insufficient testing of The causes of this vulnerability include the lack of
access controls. Attackers can exploit this vulnerability by proper data sanitisation and validation, the failure to
modifying requests to access unauthorised objects (Votipka implement proper access controls, and the use of insecure
et al., 2020). An attacker could manipulate a request to data storage; attackers can exploit this vulnerability by
access another user's data or escalate their privileges to sending specially crafted requests to access sensitive data
perform actions beyond their permissions. (Khan et al., 2021).
A real-world example of this vulnerability is the D. Lack of Resources & Rate Limiting
Facebook Cambridge Analytica scandal, where a third-party Lack of resources and rate limiting is a vulnerability that
app exploited the vulnerability in Facebook's API to access occurs when an API does not appropriately limit the number
and harvest user data without consent. This resulted in a of requests that can be made, allowing attackers to
massive data breach and significantly damaged Facebook's overwhelm the system with requests and cause denial-of-
reputation (Jeune, 2021). service attacks (Sharieh & Ferworn, Securing APIs and
Chaos Engineering, 2021).
B. Broken Authentication
As observed from the study Bach-Nutman (2020), The causes of this vulnerability include the failure to
Broken authentication is a vulnerability that occurs when an implement rate limiting, the use of weak or easily guessable
API does not properly authenticate users, allowing attackers API keys, and the lack of monitoring for unusual traffic
to access the system without proper credentials. This patterns; attackers can exploit this vulnerability by sending a
vulnerability can be exploited through various techniques, large number of requests to the API, causing the system to
such as brute force attacks, session hijacking, and credential become overloaded and unresponsive (Azad et al., 2020).
stuffing.
One real-world example of this vulnerability is the
The causes of this vulnerability include the use of Twitter API outage, where a group of attackers overloaded
weak or easily guessable passwords, the lack of multi-factor the API with requests, causing it to become unavailable for
authentication, and the failure to implement secure session several hours (A, 2023).
management; the study (Kabir & Elmedany, 2022) shows
that attackers can exploit this vulnerability by stealing user E. Broken Function Level Authorisation:
credentials and using them to access the system. As observed from the studies (Haddad & Malki, 2022),
Broken function level authorisation is a vulnerability that
One real-world example of this vulnerability is the occurs when an API does not restrict access to specific
Equifax data breach, where attackers exploited a functions or operations based on user roles or permissions,
vulnerability in Equifax's API to gain access to sensitive the authors (Fredj et al., 2021) showed that this vulnerability
customer data. This breach compromised the personal could allow attackers to perform unauthorised actions on the
information of over 143 million individuals and resulted in a system, such as deleting or modifying sensitive data, the