SlideShare a Scribd company logo
API Security Fundamentals
$ whoami
• I’m Jose
• Consultant, author, instructor
• Author of Microservice APIs
• Founder of microapis.io
@JoseHaroPeralta
@microapis
Connect with me!
 Twitter: @JoseHaroPeralta
 GitHub: @abunuwas
 Newsletter: https://microapis.substack.com
 LinkedIn: https://www.linkedin.com/in/jose-haro-
peralta/
Agenda
 OWASP Top 10 API Security Vulnerabilities (2019 and 2023)
 Open Authorization
 OpenID Connect
 Vulnerable API design
 Vulnerabilities around the API
 Automating API security testing
OWASP Top 10 API Vulnerabilities (2023)
1. Broken Object Level Authorization
2. Broken Authentication
3. Broken Object Property Level Authorization
4. Unrestricted Resource Consumption
5. Broken Function Level Authorization
6. Server-Side Request Forgery
7. Security Misconfiguration
8. Lack of Protection from Automated Threats
9. Improper Assets Management
10. Unsafe Consumption of APIs
Broken Object Level Authorization (BOLA)
BOLA happens when attackers get access to information that
belongs to other users. This type of attack is commonly done
by manipulating resource URIs on the API. For example, if our
API has a /blog/{blogId} endpoint, an attacker can play with
different IDs to try and get access to different resources (APIs
with predictable IDs, such as integers, are more vulnerable).
Broken Object
Level
Authorization
(BOLA)
Broken Authentication
When user authentication is incorrectly implemented, like weak
passwords or token signatures, weak token validation (such as
lack of signature, expiry date, or audience validation, or
allowing to set “alg” to “none”), lack rate-limiting on the login
endpoints, and so on.
Broken
Authentication
Broken Object Property Level Authorization
Broken Object Property Level Authorization brings together
two different vulnerabilities from the 2019 edition: “Excessive
Data Exposure” and “Mass Assignment”. The main idea is
allowing a malicious user access object properties that they
shouldn't be able to read or change.
Broken Object
Property Level
Authorization
Broken Object
Property Level
Authorization
Unrestricted Resource Consumption
This vulnerability implies lack of rate-limiting and the inability
to detect malicious activity. Malicious users can exploit this
vulnerability to launch a DDoS attack, to impact the service
provider’s billing, or to perform brute force attacks that bypass
authorization (by launching requests with different tokens and
so on).
Unrestricted
Resource
Consumption
Broken Function Level Authorization
Most APIs and applications have a concept of user groups and
functions. Broken Function Level Authorization happens when
a malicious user can bypass the constraints of their user group.
Broken
Function Level
Authorization
Server-Side Request Forgery
Most APIs and applications have a concept of user groups and
functions. Broken Some APIs allow users to send URLs from
which our service must retrieve a resource (for example to
retrieve a user profile photo), or as part of some configuration
(for example to configure a webhook). A malicious user may
use this feature to include malicious URLs, or to obtain
information from the system.
Security Misconfiguration
Security misconfiguration refers to improper configuration at
any level of the stack, including infrastructure, configuration
management, or application configuration. Some examples are
missing TLS, leaking stack trace in error responses, CORS
misconfiguration, exposing more HTTP methods than are
needed, missing security patches and updates, improperly
configured cloud permissions, etc.
Security
Misconfiguration
Lack of Protection from Automated Threats
Means malicious users can harm the business model through
the API. It involves knowledge of the underlying business
model behind the API.
Lack of
Protection
from
Automated
Threats
Improper Assets Management
This refers to management of API, servers, and resources.
When we roll out a new version of the API, it’s important to
ensure deprecation of the older versions, especially if the
newer versions come with security improvements. It’s also
important to keep API documentation up to date, as obsolete
documentation makes it difficult to monitor and test the APIs.
We also need to ensure that non-production servers aren’t
accessible to unauthorized users.
Improper
Assets
Management
Unsafe Consumption of APIs
Most APIs use third-party integrations, for example for
authentication and authorization, for mapping and
geolocation, for emailing, and so on. Most of the time, we tend
to trust data that comes from third-party applications, and we
don’t subject it to validation and sanitisation. This is a mistake,
since an attacker can inject malicious code into the third-party
application.
Injection (2019)
Injection happens when an attacker injects malicious code
through the API, such as SQL/noSQL injection queries that get
executed in the database, or command injection statements
that get executed in the server. An attacker can leverage any
input field in the API to launch an injection attack, including
URL query and path parameters, request payloads, header
values, field values in a JWT, and so on.
Injection (2019)
Authentication vs
Authorization
Authentication is the
process of verifying a user
identity, while authorization
is the process of verifying
that they have access to
something.
Open Authorization (OAuth)
OAuth is a standard for access delegation.
 Resource owner
 Resource server
 Client
 Authorization server
OAuth flows:
Authorization
code flow
OAuth
flows:
PKCE flow
OAuth flows:
Client
credentials
flow
OAuth
flows:
Refresh
Token
Flow
JSON Web Tokens (JWTs)
JSON Web Tokens (JWT, pronounced ‘JOT’) are JSON documents that contain
information about a user. We call the properties of a JWT claims. Two types:
 ID tokens
 Access tokens
Structure
of a JWT
OpenID Connect (OIDC)
OpenID Connect (OIDC) is an open authentication protocol built on top of
OAuth that allows users to authenticate on a website using a third-party
provider.
OpenID
Connect
(OIDC)
Vulnerable API design
 Unbound arrays
 Leaking objects
 Free-form strings
 Integer IDs
 Exposing server-side properties in user input
 Flexible schemas with unknown properties
 Too many IDs
 Improper pagination
 Unrestricted filters
 Very flexible schemas with optional parameters
Vulnerabilities around the API
 Protect the database
 Restrict outbound traffic
 Collect detailed logs and actively monitor them
 Use a WAF
 Rate-limit requests
 Restrict resource consumption
 Use safe packages and libraries
Automating API security testing with fencer
Thanks for listening!
Twitter: @JoseHaroPeralta
GitHub: @abunuwas
Newsletter: https://microapis.substack.com
LinkedIn: https://www.linkedin.com/in/jose-haro-peralta/

More Related Content

What's hot (20)

PDF
Api security-testing
n|u - The Open Security Community
 
PPTX
Rest API Security - A quick understanding of Rest API Security
Mohammed Fazuluddin
 
PPTX
Pentesting ReST API
Nutan Kumar Panda
 
PPTX
OWASP Top 10 2021 What's New
Michael Furman
 
PDF
HTTP Request Smuggling via higher HTTP versions
neexemil
 
PPT
Introduction to Web Application Penetration Testing
Anurag Srivastava
 
PDF
OWASP Top 10 Web Application Vulnerabilities
Software Guru
 
PPTX
Secure coding practices
Mohammed Danish Amber
 
PDF
Pentesting Rest API's by :- Gaurang Bhatnagar
OWASP Delhi
 
PPTX
Secure coding practices
Scott Hurrey
 
PPTX
An Introduction To REST API
Aniruddh Bhilvare
 
PPT
Secure code practices
Hina Rawal
 
PPTX
Rest API Security
Stormpath
 
PPTX
REST API Design & Development
Ashok Pundit
 
PDF
Broken access controls
Akansha Kesharwani
 
PPTX
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Soroush Dalili
 
PPTX
Vulnerabilities in modern web applications
Niyas Nazar
 
PDF
OpenID Connect Explained
Vladimir Dzhuvinov
 
PPTX
Owasp top 10 vulnerabilities
OWASP Delhi
 
PPTX
OpenID Connect: An Overview
Pat Patterson
 
Api security-testing
n|u - The Open Security Community
 
Rest API Security - A quick understanding of Rest API Security
Mohammed Fazuluddin
 
Pentesting ReST API
Nutan Kumar Panda
 
OWASP Top 10 2021 What's New
Michael Furman
 
HTTP Request Smuggling via higher HTTP versions
neexemil
 
Introduction to Web Application Penetration Testing
Anurag Srivastava
 
OWASP Top 10 Web Application Vulnerabilities
Software Guru
 
Secure coding practices
Mohammed Danish Amber
 
Pentesting Rest API's by :- Gaurang Bhatnagar
OWASP Delhi
 
Secure coding practices
Scott Hurrey
 
An Introduction To REST API
Aniruddh Bhilvare
 
Secure code practices
Hina Rawal
 
Rest API Security
Stormpath
 
REST API Design & Development
Ashok Pundit
 
Broken access controls
Akansha Kesharwani
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Soroush Dalili
 
Vulnerabilities in modern web applications
Niyas Nazar
 
OpenID Connect Explained
Vladimir Dzhuvinov
 
Owasp top 10 vulnerabilities
OWASP Delhi
 
OpenID Connect: An Overview
Pat Patterson
 

Similar to API Security Fundamentals (20)

PPTX
How-to-Secure-APIs-to-Defend-Against-Emerging-Cyber-Threats-to-Digital-Web-As...
khalidmohammedfci
 
PDF
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)
DicodingEvent
 
PDF
API Vulnerabilties and What to Do About Them
Eoin Woods
 
PDF
Common Security API Issues and How to Mitigate Them Using Postman
Postman
 
PDF
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Adar Weidman
 
PDF
apidays LIVE London 2021 - API Security challenges and solutions by Wadii Tah...
apidays
 
PDF
APIsecure 2023 - Detect OWASP vulnerabilities in your APIs with Postman, Rahu...
apidays
 
PDF
API Security Best Practices and Guidelines
WSO2
 
PDF
Api economy and why effective security is important (1)
IndusfacePvtLtd
 
PDF
Guidelines to protect your APIs from threats
Isabelle Mauny
 
PDF
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
apidays
 
PDF
Black and Blue APIs: Attacker's and Defender's View of API Vulnerabilities
Matt Tesauro
 
PDF
HowYourAPIBeMyAPI
Jie Liau
 
PDF
Akamai_ API Security Best Practices - Real-world attacks and breaches
Security Bootcamp
 
PDF
OWASP API Security Top 10 Examples
42Crunch
 
PDF
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays
 
PDF
apidays New York 2023 - A decade of API breaches, courtesy of application fla...
apidays
 
PPTX
apidays Paris 2024 - Layered Approach of API Security Strategies and its Busi...
apidays
 
PPTX
Building better security for your API platform using Azure API Management
Eldert Grootenboer
 
PPTX
2022 APIsecure_Go Hack Yourself: API Hacking for Beginners
APIsecure_ Official
 
How-to-Secure-APIs-to-Defend-Against-Emerging-Cyber-Threats-to-Digital-Web-As...
khalidmohammedfci
 
Keamanan Digital dan Privasi di Masa Pandemi-Taro Lay (Director-Kalama Cyber)
DicodingEvent
 
API Vulnerabilties and What to Do About Them
Eoin Woods
 
Common Security API Issues and How to Mitigate Them Using Postman
Postman
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Adar Weidman
 
apidays LIVE London 2021 - API Security challenges and solutions by Wadii Tah...
apidays
 
APIsecure 2023 - Detect OWASP vulnerabilities in your APIs with Postman, Rahu...
apidays
 
API Security Best Practices and Guidelines
WSO2
 
Api economy and why effective security is important (1)
IndusfacePvtLtd
 
Guidelines to protect your APIs from threats
Isabelle Mauny
 
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
apidays
 
Black and Blue APIs: Attacker's and Defender's View of API Vulnerabilities
Matt Tesauro
 
HowYourAPIBeMyAPI
Jie Liau
 
Akamai_ API Security Best Practices - Real-world attacks and breaches
Security Bootcamp
 
OWASP API Security Top 10 Examples
42Crunch
 
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays
 
apidays New York 2023 - A decade of API breaches, courtesy of application fla...
apidays
 
apidays Paris 2024 - Layered Approach of API Security Strategies and its Busi...
apidays
 
Building better security for your API platform using Azure API Management
Eldert Grootenboer
 
2022 APIsecure_Go Hack Yourself: API Hacking for Beginners
APIsecure_ Official
 
Ad

More from José Haro Peralta (7)

PPTX
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
José Haro Peralta
 
PPTX
Pure APIs: Development workflows for successful API integrations
José Haro Peralta
 
PPTX
Delivering successful API integrations with documentation-driven development
José Haro Peralta
 
PPTX
Documentation-driven development for Python web APIs v2
José Haro Peralta
 
PPTX
Documentation-driven development for Python web APIs
José Haro Peralta
 
PPTX
API Conference 2021
José Haro Peralta
 
PPTX
PyBCN 2020
José Haro Peralta
 
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
José Haro Peralta
 
Pure APIs: Development workflows for successful API integrations
José Haro Peralta
 
Delivering successful API integrations with documentation-driven development
José Haro Peralta
 
Documentation-driven development for Python web APIs v2
José Haro Peralta
 
Documentation-driven development for Python web APIs
José Haro Peralta
 
API Conference 2021
José Haro Peralta
 
PyBCN 2020
José Haro Peralta
 
Ad

Recently uploaded (20)

PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 

API Security Fundamentals

  • 2. $ whoami • I’m Jose • Consultant, author, instructor • Author of Microservice APIs • Founder of microapis.io @JoseHaroPeralta @microapis
  • 3. Connect with me!  Twitter: @JoseHaroPeralta  GitHub: @abunuwas  Newsletter: https://microapis.substack.com  LinkedIn: https://www.linkedin.com/in/jose-haro- peralta/
  • 4. Agenda  OWASP Top 10 API Security Vulnerabilities (2019 and 2023)  Open Authorization  OpenID Connect  Vulnerable API design  Vulnerabilities around the API  Automating API security testing
  • 5. OWASP Top 10 API Vulnerabilities (2023) 1. Broken Object Level Authorization 2. Broken Authentication 3. Broken Object Property Level Authorization 4. Unrestricted Resource Consumption 5. Broken Function Level Authorization 6. Server-Side Request Forgery 7. Security Misconfiguration 8. Lack of Protection from Automated Threats 9. Improper Assets Management 10. Unsafe Consumption of APIs
  • 6. Broken Object Level Authorization (BOLA) BOLA happens when attackers get access to information that belongs to other users. This type of attack is commonly done by manipulating resource URIs on the API. For example, if our API has a /blog/{blogId} endpoint, an attacker can play with different IDs to try and get access to different resources (APIs with predictable IDs, such as integers, are more vulnerable).
  • 8. Broken Authentication When user authentication is incorrectly implemented, like weak passwords or token signatures, weak token validation (such as lack of signature, expiry date, or audience validation, or allowing to set “alg” to “none”), lack rate-limiting on the login endpoints, and so on.
  • 10. Broken Object Property Level Authorization Broken Object Property Level Authorization brings together two different vulnerabilities from the 2019 edition: “Excessive Data Exposure” and “Mass Assignment”. The main idea is allowing a malicious user access object properties that they shouldn't be able to read or change.
  • 13. Unrestricted Resource Consumption This vulnerability implies lack of rate-limiting and the inability to detect malicious activity. Malicious users can exploit this vulnerability to launch a DDoS attack, to impact the service provider’s billing, or to perform brute force attacks that bypass authorization (by launching requests with different tokens and so on).
  • 15. Broken Function Level Authorization Most APIs and applications have a concept of user groups and functions. Broken Function Level Authorization happens when a malicious user can bypass the constraints of their user group.
  • 17. Server-Side Request Forgery Most APIs and applications have a concept of user groups and functions. Broken Some APIs allow users to send URLs from which our service must retrieve a resource (for example to retrieve a user profile photo), or as part of some configuration (for example to configure a webhook). A malicious user may use this feature to include malicious URLs, or to obtain information from the system.
  • 18. Security Misconfiguration Security misconfiguration refers to improper configuration at any level of the stack, including infrastructure, configuration management, or application configuration. Some examples are missing TLS, leaking stack trace in error responses, CORS misconfiguration, exposing more HTTP methods than are needed, missing security patches and updates, improperly configured cloud permissions, etc.
  • 20. Lack of Protection from Automated Threats Means malicious users can harm the business model through the API. It involves knowledge of the underlying business model behind the API.
  • 22. Improper Assets Management This refers to management of API, servers, and resources. When we roll out a new version of the API, it’s important to ensure deprecation of the older versions, especially if the newer versions come with security improvements. It’s also important to keep API documentation up to date, as obsolete documentation makes it difficult to monitor and test the APIs. We also need to ensure that non-production servers aren’t accessible to unauthorized users.
  • 24. Unsafe Consumption of APIs Most APIs use third-party integrations, for example for authentication and authorization, for mapping and geolocation, for emailing, and so on. Most of the time, we tend to trust data that comes from third-party applications, and we don’t subject it to validation and sanitisation. This is a mistake, since an attacker can inject malicious code into the third-party application.
  • 25. Injection (2019) Injection happens when an attacker injects malicious code through the API, such as SQL/noSQL injection queries that get executed in the database, or command injection statements that get executed in the server. An attacker can leverage any input field in the API to launch an injection attack, including URL query and path parameters, request payloads, header values, field values in a JWT, and so on.
  • 27. Authentication vs Authorization Authentication is the process of verifying a user identity, while authorization is the process of verifying that they have access to something.
  • 28. Open Authorization (OAuth) OAuth is a standard for access delegation.  Resource owner  Resource server  Client  Authorization server
  • 33. JSON Web Tokens (JWTs) JSON Web Tokens (JWT, pronounced ‘JOT’) are JSON documents that contain information about a user. We call the properties of a JWT claims. Two types:  ID tokens  Access tokens
  • 35. OpenID Connect (OIDC) OpenID Connect (OIDC) is an open authentication protocol built on top of OAuth that allows users to authenticate on a website using a third-party provider.
  • 37. Vulnerable API design  Unbound arrays  Leaking objects  Free-form strings  Integer IDs  Exposing server-side properties in user input  Flexible schemas with unknown properties  Too many IDs  Improper pagination  Unrestricted filters  Very flexible schemas with optional parameters
  • 38. Vulnerabilities around the API  Protect the database  Restrict outbound traffic  Collect detailed logs and actively monitor them  Use a WAF  Rate-limit requests  Restrict resource consumption  Use safe packages and libraries
  • 39. Automating API security testing with fencer
  • 40. Thanks for listening! Twitter: @JoseHaroPeralta GitHub: @abunuwas Newsletter: https://microapis.substack.com LinkedIn: https://www.linkedin.com/in/jose-haro-peralta/