Application programming interfaces (APIs) are integral to letting applications talk to each other and deliver optimized digital experiences. They can greatly benefit developers but, unfortunately, also come with many security challenges. Attackers can target APIs to access sensitive information, disrupt services, or alter data.
The good news is that the Open Web Application Security Project (OWASP) has already highlighted the top 10 API security risks. This list, created by security experts, helps developers understand what vulnerabilities to look out for.
At SecureFlag, we want to help you stay ahead of these API threats. Our post breaks down each risk and shows you how to protect against them.
Object-level authorization controls give users access to specific data, such as records or files. For instance, a user may view certain files but cannot edit or delete them. Vulnerabilities happen when these controls don’t work, allowing users to access and edit other data due to weak authorization checks.
These vulnerabilities often stem from insecure coding practices, such as not validating user input or checking permissions properly, which leave API resources overly accessible and unprotected.
Solution:
Broken authentication is a top OWASP API security risk, and it happens when vulnerabilities allow attackers to impersonate legitimate users. Attackers can take over user identities by compromising passwords, session tokens, or account details. The leading causes are weak session management and loose password policies or other inadequate security practices, which lead to stolen or compromised credentials.
Vulnerabilities in authentication have been exploited in several incidents, including an attack on the Marriott hotel chain. Attackers used stolen login credentials from two employees to access data from over 5.2 million guests.
Solution:
Another API Security issue is broken property-level authorization, which lets attackers bypass access controls and modify specific properties of an object without necessary permissions—such as changing a user’s email address or phone number to gain access to account recovery features. The API doesn’t correctly enforce authorization checks at the property level, allowing unauthorized users to alter sensitive fields within an object.
For example, a vulnerability in the Twitter API (now known as X) allowed users to confirm their connection to a Twitter ID by submitting their email address or phone number. This flaw was exploited to compile datasets containing usernames, screen names, phone numbers, email addresses, and other information sold on hacker forums and marketplaces.
Solution:
APIs need resources such as CPU, memory, bandwidth, and services like SMS or email notifications. If these resources are not limited, attackers can abuse them to initiate a Denial of Service (DoS) or drive up operational costs by making excessive, automated requests.
Consider an API that handles image uploads without size limitations. If an attacker submits thousands of oversized images in a short time, it could lead to resource exhaustion.
Solution:
This API vulnerability occurs when an application doesn’t properly enforce authorization checks for users trying to access certain functions or perform sensitive actions. This flaw allows attackers or unauthorized users to execute actions that should only be available to users with specific roles or higher privileges.
According to OWASP API security best practices, safeguarding each function based on user roles is vital, ensuring only authorized users can access specific functions. For instance, in a banking app, a regular user could exploit a vulnerability to modify or view another user’s account details if proper checks aren’t in place.
Solution:
Some APIs expose critical business functions (e.g., purchasing items or posting content) without sufficient protection against misuse. For instance, a business might allow anyone to use an API endpoint for purchases without restricting the number of items that can be bought at once, which could lead to inventory or revenue losses if automated bots abuse it.
Solution:
Server-side request forgery (SSRF) happens when an API accepts a URL or URI parameter from a user without validation and then performs the request. Attackers can exploit SSRF vulnerabilities to force servers to make requests to internal or external systems, potentially bypassing firewalls or VPN protections.
An example of an SSRF attack occurred when Capital One was breached, resulting in data leaks for about 106 million people in the U.S. and Canada. The hacker exploited a misconfiguration in the web application firewall, which allowed them to receive a response containing credentials. This gave the attacker access to the server where Capital One stored its data, enabling them to retrieve customer files.
Solution:
APIs have complex configurations, and mistakes can open doors for attackers. For instance, leaving debug settings enabled in production or allowing unauthorized access due to a configuration oversight can expose sensitive data.
A misconfigured permission in Jira exposed NASA employees’ personal data and details about upcoming projects. A system administrator mistakenly assigned ‘all users’ permissions within the app while creating a dashboard, assuming it would limit access to those within the organization. Unfortunately, it didn’t.
Solution:
As APIs often involve numerous endpoints across multiple versions, maintaining an accurate inventory of these endpoints is essential. Older, less secure endpoints may remain exposed without proper inventory, or debug endpoints may be left accessible in production, leading to potential security issues.
A real-world case of improper inventory management occurred during the Optus breach in September 2022. A security vulnerability in one of the company’s APIs exposed 11.2 million customer records, including personally identifiable information.
Solution:
Developers often trust third-party APIs more than they should, sometimes treating their data with less caution than user-provided data. This can lead to weak security standards and indirect attacks on APIs. Attackers might target third-party services that an API integrates with, indirectly gaining access to data.
These attacks can lead to the theft of sensitive personal or corporate data, putting users and businesses at risk and making the system susceptible to various injection attacks. They can cause performance degradation and even result in denial-of-service (DoS) conditions, disrupting operations and access to critical services.
Solution:
It’s imperative to keep in mind the security challenges that come with APIs to help prevent potential attacks. Each risk points out the weaknesses APIs could have if the right security measures aren’t put in place.
SecureFlag offers hands-on training specifically designed to help developers learn about and mitigate API security risks in real-world scenarios. Teams can spot and fix these risks early, reducing the chance of data breaches. In a world where APIs are critical to business, SecureFlag provides the skills to keep your APIs secure.