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
APISecurity_OWASP_MitigationGuide
Isabelle Mauny
 
PDF
Secure coding guidelines
Zakaria SMAHI
 
PPTX
OWASP Top 10 2021 What's New
Michael Furman
 
PPTX
API Security Lifecycle
Apigee | Google Cloud
 
PDF
Secure Coding principles by example: Build Security In from the start - Carlo...
Codemotion
 
PPTX
OWASP Top 10 2021 Presentation (Jul 2022)
TzahiArabov
 
PPTX
Owasp top 10 vulnerabilities
OWASP Delhi
 
PDF
Pentesting Rest API's by :- Gaurang Bhatnagar
OWASP Delhi
 
PPTX
Threat modelling(system + enterprise)
abhimanyubhogwan
 
PDF
Secure coding presentation Oct 3 2020
Moataz Kamel
 
PDF
API Security Best Practices & Guidelines
Prabath Siriwardena
 
PPTX
A5: Security Misconfiguration
Tariq Islam
 
PDF
OWASP Top 10 Web Application Vulnerabilities
Software Guru
 
ODP
OWASP Secure Coding
bilcorry
 
PDF
WEBINAR: OWASP API Security Top 10
42Crunch
 
PPT
Secure code practices
Hina Rawal
 
PDF
Applications secure by default
SecuRing
 
PPTX
OWASP Top Ten 2017
Michael Furman
 
PDF
OWASP Secure Coding Practices - Quick Reference Guide
Ludovic Petit
 
PDF
OWASP API Security Top 10 Examples
42Crunch
 
APISecurity_OWASP_MitigationGuide
Isabelle Mauny
 
Secure coding guidelines
Zakaria SMAHI
 
OWASP Top 10 2021 What's New
Michael Furman
 
API Security Lifecycle
Apigee | Google Cloud
 
Secure Coding principles by example: Build Security In from the start - Carlo...
Codemotion
 
OWASP Top 10 2021 Presentation (Jul 2022)
TzahiArabov
 
Owasp top 10 vulnerabilities
OWASP Delhi
 
Pentesting Rest API's by :- Gaurang Bhatnagar
OWASP Delhi
 
Threat modelling(system + enterprise)
abhimanyubhogwan
 
Secure coding presentation Oct 3 2020
Moataz Kamel
 
API Security Best Practices & Guidelines
Prabath Siriwardena
 
A5: Security Misconfiguration
Tariq Islam
 
OWASP Top 10 Web Application Vulnerabilities
Software Guru
 
OWASP Secure Coding
bilcorry
 
WEBINAR: OWASP API Security Top 10
42Crunch
 
Secure code practices
Hina Rawal
 
Applications secure by default
SecuRing
 
OWASP Top Ten 2017
Michael Furman
 
OWASP Secure Coding Practices - Quick Reference Guide
Ludovic Petit
 
OWASP API Security Top 10 Examples
42Crunch
 

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
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
 
PDF
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
apidays
 
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
 
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
 
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
apidays
 
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)

PPTX
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
PDF
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 
PDF
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
PPTX
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
PPTX
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
 
PDF
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
PPTX
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
 
PPTX
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
PDF
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
PDF
From Chaos to Clarity: Mastering Analytics Governance in the Modern Enterprise
Wiiisdom
 
PDF
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
PDF
Writing Maintainable Playwright Tests with Ease
Shubham Joshi
 
PPTX
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
PPTX
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
 
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
 
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
 
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
From Chaos to Clarity: Mastering Analytics Governance in the Modern Enterprise
Wiiisdom
 
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
Writing Maintainable Playwright Tests with Ease
Shubham Joshi
 
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 

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/