Reader small image

You're reading from  Defending APIs

Product typeBook
Published inFeb 2024
PublisherPackt
ISBN-139781804617120
Edition1st Edition
Right arrow
Author (1)
Colin Domoney
Colin Domoney
author image
Colin Domoney

Colin Domoney (BSc. MSc. CSSLP, CEH) is an API Security Research Specialist and Developer Advocate with deep expertise in the development of secure software. As VP of AppSec, he took on the challenge of securing software on a large scale and running the global AppSec program at Deutsche Bank. At Veracode, as an evangelist, he produces countless webinars, and blog posts, and speak globally at conferences. Currently, he has embraced the challenge of securing APIs with 42Crunch where he has produced the API industry's first security maturity model and contributed to numerous webinars, talks, and blogs. Currently, he is working on the industry's first defensive API developer training course. He is also the curator of the APISecurity weekly newsletter.
Read more about Colin Domoney

Right arrow

Understanding Common API Vulnerabilities

Now that we understand how APIs are constructed, we will turn our attention to the core topic of this book—API security. In this chapter, we will focus on the different types of vulnerabilities that can adversely impact API security, gaining an understanding of the underlying cause, the impact, and the recommended prevention or mitigation for each.

In this chapter, we’re going to cover the following main topics:

  • The importance of vulnerability classification
  • The Open Worldwide Application Security Project API Security Top 10 vulnerabilities
  • Vulnerabilities versus abuse cases
  • Business logic vulnerabilities

The importance of vulnerability classification

Security researchers have long understood the importance of classifying vulnerabilities within software and hardware systems. Classification allows researchers to group similar vulnerabilities together based on their characteristics and then apply standard patterns for mitigation and protection.

Flaws versus vulnerabilities versus exploits versus threats versus risks

The preceding terms cause confusion in the security industry, so it is worth disambiguating them as they are subtly different.

A flaw is an implementation defect or weakness in code that may be latent or exploitable.A vulnerability is a flaw that can be exploited by an attacker. An exploit is a procedure or method used by an attacker to take advantage of a flaw, that is, it is the “how” of a vulnerability. A threat is anything that has the potential to do harm to a system, and it can be intentional (a hacker) or unintentional (forgetting to patch a system...

Exploring the Open Worldwide Application Security Project API Security Top 10

Let us now start our exploration of the Open Worldwide Application Security Project API Security Top 10 vulnerabilities. Although the standard Open Worldwide Application Security Project listing provides the vulnerabilities in decreasing order of severity, I have chosen to group them by vulnerability type and root cause to aid understanding. Shall we begin?

Object-level vulnerabilities

There is only one object-level vulnerability, which is the now infamous broken object-level authorization, which is number one in the Open Worldwide Application Security Project API Security Top 10.

API1:2019—Broken object-level authorization

The easiest real-world analogy to understand broken object-level authorization (BOLA) is that of a coat check-in at an entertainment venue. Upon arrival, you drop your coat off with the clerk and are given a ticket with a number, let’s say #10, for example. Now...

Vulnerabilities versus abuse cases

While the discussion so far has focused on vulnerabilities (flaws in software that can be exploited by an attacker), we need to also consider the impact of API abuse on API security. API abuse is generally defined as the use of an API in an unexpected way, leading to negative consequences. Normally, an API is designed to support a mobile application or website; however, since the API is exposed, curious users or adversaries can reverse-engineer the API and use it for their own purposes.

An excellent example comes from the supermarket industry in the United Kingdom during the first Covid-19 lockdown. Supermarket delivery services rapidly became oversubscribed, and supermarkets quickly implemented limiting controls on the web frontends to avoid total overload and failure. Curious developers quickly examined the APIs and found endpoints that allowed access to the booking system and were able to reserve precious delivery slots by bypassing the frontend...

Business logic vulnerabilities

The final category of vulnerability is that of business logic vulnerabilities, which allow an attacker to elicit unexpected behaviors with negative consequences. They are closely aligned with abuse cases and can be notoriously difficult to eliminate. The key is to think like an adversary—threat modeling exercises can be useful in highlighting business logic vulnerabilities.

There are several good examples of business logic vulnerabilities affecting APIs:

  • Relying on client-side controls: One of the most nefarious and persistent weaknesses (highlighted frequently in this chapter) is the reliance on client-side controls to implement security. Simply put, they do not work and can always be defeated—do not use them.
  • Trusting users: Avoid trusting that the user will behave in the way you intended; typical examples include not providing required parameters or supplying the wrong format of data.
  • Trusting partners and third parties...

Preview of the Open Worldwide Application Security Project API Security Top 10 2023

As mentioned earlier in this chapter, the Open Worldwide Application Security Project API Security Top 10 is undergoing changes to reflect the API threat landscape in 2023. At the time of writing, this update was still in a release candidate stage, with an ongoing request for comment (RFC) in place via the Open Worldwide Application Security Project GitHub repository (https://github.com/OWASP/API-Security/tree/master/editions/2023/en).

Let us take a quick look at the currently proposed Top 10, shown in summary here:

Summary

It was a long journey through this chapter—by now, you will have a strong understanding of flaws, vulnerabilities, and threats and how they present a risk to your APIs. The key vulnerabilities that affect APIs include broken object-level and function-level authorization, broken authentication, data vulnerabilities, and finally, implementation and configuration vulnerabilities. Even if your API is free of vulnerabilities, it can still be abused or susceptible to business logic attacks.

While this chapter has focused on the theoretical nature of vulnerabilities, we are about to see just how easily these vulnerabilities can result in major breaches as we take a deep dive into twelve recent API breaches.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Defending APIs
Published in: Feb 2024Publisher: PacktISBN-13: 9781804617120
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Colin Domoney

Colin Domoney (BSc. MSc. CSSLP, CEH) is an API Security Research Specialist and Developer Advocate with deep expertise in the development of secure software. As VP of AppSec, he took on the challenge of securing software on a large scale and running the global AppSec program at Deutsche Bank. At Veracode, as an evangelist, he produces countless webinars, and blog posts, and speak globally at conferences. Currently, he has embraced the challenge of securing APIs with 42Crunch where he has produced the API industry's first security maturity model and contributed to numerous webinars, talks, and blogs. Currently, he is working on the industry's first defensive API developer training course. He is also the curator of the APISecurity weekly newsletter.
Read more about Colin Domoney

#

2019

2023

API1

Broken Object Level Authorization

Broken Object Level Authorization

API2

Broken User Authentication

Broken Authentication...