Penetration testing for web apps

What is API penetration testing?
API Penetration Testing is a specialised form of security assessment that identifies vulnerabilities and security risks in application programming interfaces (APIs).
APIs are the backbone of modern applications, so their security is paramount. APIs often expose sensitive data and application logic, making them a lucrative target for attackers. API Pen Testing is essential for safeguarding the API and the applications and data it interacts with.

Common Vulnerabilities
Common API Security Vulnerabilities
Broken Object Level Authorisation
This vulnerability arises when object identifiers are left exposed and not adequately validated. If endpoints do not properly enforce access controls on individual objects, unauthorised users can access or possibly manipulate the data. Leading to data breaches or significant privacy violations.
Unrestricted Resource Consumption
Rate Limiting is an often overlooked aspect of API security mechanisms. Without proper rate limiting and throttling mechanisms, APIs can be subject to Denial of Service (DOS) attacks or fuzzing with malicious payloads without being hindered by throttling. This vulnerability can significantly affect the service’s availability.
Broken Object Property Level Authorisation
Similar to Broken Authorisation in web applications. This vulnerability refers to the failure of the system to enforce authorisation checks on individual properties of objects. Common issues include the ability for users to view properties they should not have access to or the ability to change user roles via privilege escalation vectors.
Server-Side Request Forgery (SSRF)
As with Web Applications, API functions could allow users to make requests from the server’s perspective. Using this vulnerability, an attacker could exfiltrate data, scan local ports, or interact with services which would not be accessible externally. SSRF can often lead to cloud compromise if a server has access to crucial metadata locations.
Broken Function Level Authorisation
Broken Function-Level Authorisation is when the API does not correctly enforce access control mechanisms on methods’ functions. Attackers could exploit this vulnerability to gain access to privileged functions that they should not have access to, which could lead to privilege escalation or unauthorised use of an API.
Unrestricted Access to Sensitive Business Flows
This vulnerability refers to critical business processes that could be exposed through an API without sufficient access controls, often allowing attackers to interact with or manipulate sensitive workflows.
Improper Inventory Management
Improper Inventory management refers to APIs’ failure to maintain an accurate and complete inventory of endpoints. In some cases, deprecated and undocumented API endpoints could be exposed, creating potential security gaps.
Security Misconfiguration
While broad, a range of vulnerabilities can occur from improper configuration of the API and its environment. This can include using default settings, exposing services, or failing to patch key API components.
Broken Authentication
Broken Authentication refers to weaknesses in the API’s authentication mechanism. These could include poor password policies, weak encryption keys, or JWT token misconfigurations.
Unsafe Consumption of APIs
The Unsafe Consumption of APIs usually relates to third-party APIs, such as if an API improperly consumes information from third parties without adequate security checks. This can often lead to injection attacks, data leaks, or other security issues inherited from the third-party API itself.
Want to find out if your API has these vulnerabilities?
Contact a member of our team today to find out if your API has any of these common vulnerabilities.
What does API Pen Testing include?
Excessive Data Exposure
Lack of Rate Limiting
Mass Assignment
Injection
Lack of Proper CORS Configuration
Unvalidated Redirects and Forwards
Insufficient Logging and Monitoring
Improper Assets Management
Inadequate Authentication Mechanisms
Broken User
Authentication
Insecure API Key Management
Improper Error
Handling
What are the benefits of API Penetration Testing?
The widespread use of APIs has made them a prime target for attackers. API Penetration Testing offers numerous benefits that aim to enhance the security and reliability of applications. Key advantages include
- Detection: Early detection of security flaws and weaknesses in APIs can identify issues before attackers can exploit them
- Compliance: Thoroughly testing APIs can help companies meet regulatory requirements and industry standards for data protection, such as GDPR, HIPAA, DTAC, and PCI-DSS.
- Trust, Reputation & Brand Reputation: Demonstrating a commitment to protecting customer data helps build and maintain user trust. Companies can avoid the negative impact on brand reputation that comes with data breaches.

API Penetration Testing Methodology
The methodology employed for API Penetration Testing encompasses a variety of attack vectors. It includes testing against the OWASP API Security Top 10 Risks of 2023, an industry-standard guide for identifying the most critical API security risks. Our structured methodology also incorporates custom tests tailored to the assessed API.
Scoping & Planning
In this initial phase, we define the scope and objectives of the penetration testing project. We identify the API endpoints to be tested, understand the business logic and functionalities of the API, and set clear goals and expectations. Proper scoping ensures that we focus our testing efforts and align them with the organisation’s security requirements.
Reconnaissance and Intelligence Gathering
During this phase, we gather as much information as possible about the API. We understand the API architecture and underlying technologies, collecting data from the API documentation and through manual exploration. Our primary goal is to create a detailed map of the API’s attack surface.
Scanning and Vulnerability Analysis
In this phase, we use automated tools to scan the API for known vulnerabilities. We identify issues with data validation practices using automation tools and employ manual techniques to find problems with authentication, authorisation, or session management. The scan results provide a preliminary list of potential security weaknesses that require further manual validation.
Threat Modelling Exercise
During threat modelling, we analyse the API from an attacker’s perspective. We examine various scenarios and identify how an attacker might exploit the API. This helps us prioritise the vulnerabilities based on their potential impact and likelihood of exploitation.
Attack Execution
In this phase, we manually exploit the identified vulnerabilities. We bypass security measures for authentication, exploit weak authorisation controls, check for SQL injection, and use other attack methods. Our objective is to understand how the vulnerabilities affect real-world situations and compile proof of successful exploitation.
Reporting and Retesting
In the final phase, we compile a detailed report of the findings. The report describes the vulnerabilities, provides evidence of exploitation, and assesses their severity and impact. Additionally, we include recommendations for remediation and improvement. We then plan a retest to ensure we have resolved the issues.