SlideShare une entreprise Scribd logo
1  sur  40
$ 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/

Contenu connexe

Tendances

Web PenTest Sample Report
Web PenTest Sample ReportWeb PenTest Sample Report
Web PenTest Sample Report
Octogence
 
API Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIsAPI Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIs
AaronLieberman5
 

Tendances (20)

Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & Guidelines
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security Testing
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)
 
Pentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarPentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang Bhatnagar
 
Web PenTest Sample Report
Web PenTest Sample ReportWeb PenTest Sample Report
Web PenTest Sample Report
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
 
SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
 
Security Exploit of Business Logic Flaws, Business Logic Attacks
Security Exploit of Business Logic Flaws, Business Logic AttacksSecurity Exploit of Business Logic Flaws, Business Logic Attacks
Security Exploit of Business Logic Flaws, Business Logic Attacks
 
API Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIsAPI Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIs
 
OWASP Top Ten 2017
OWASP Top Ten 2017OWASP Top Ten 2017
OWASP Top Ten 2017
 
API Security Lifecycle
API Security LifecycleAPI Security Lifecycle
API Security Lifecycle
 
Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
Peeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API SecurityPeeling the Onion: Making Sense of the Layers of API Security
Peeling the Onion: Making Sense of the Layers of API Security
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 

Similaire à API Security Fundamentals

Similaire à API Security Fundamentals (20)

BDSE03-1121-API-PresentationTemplate.pptx
BDSE03-1121-API-PresentationTemplate.pptxBDSE03-1121-API-PresentationTemplate.pptx
BDSE03-1121-API-PresentationTemplate.pptx
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security Risks
 
Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack
 
apidays LIVE London 2021 - API Security challenges and solutions by Wadii Tah...
apidays LIVE London 2021 - API Security challenges and solutions by Wadii Tah...apidays LIVE London 2021 - API Security challenges and solutions by Wadii Tah...
apidays LIVE London 2021 - API Security challenges and solutions by Wadii Tah...
 
Techniques for securing rest
Techniques for securing restTechniques for securing rest
Techniques for securing rest
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
 
RESTful Day 5
RESTful Day 5RESTful Day 5
RESTful Day 5
 
Security Testing Training With Examples
Security Testing Training With ExamplesSecurity Testing Training With Examples
Security Testing Training With Examples
 
Securing RESTful API
Securing RESTful APISecuring RESTful API
Securing RESTful API
 
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
apidays Hong Kong - Attack API Architecture, Alvin Tam, Hong Kong Computer So...
 
apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...
apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...
apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...
 
Web and Mobile Application Security
Web and Mobile Application SecurityWeb and Mobile Application Security
Web and Mobile Application Security
 
O auth2 with angular js
O auth2 with angular jsO auth2 with angular js
O auth2 with angular js
 
OWASPAPISecurity
OWASPAPISecurityOWASPAPISecurity
OWASPAPISecurity
 
OWASP
OWASPOWASP
OWASP
 
A security note for web developers
A security note for web developersA security note for web developers
A security note for web developers
 
Common Security API Issues and How to Mitigate Them Using Postman
Common Security API Issues and How to Mitigate Them Using PostmanCommon Security API Issues and How to Mitigate Them Using Postman
Common Security API Issues and How to Mitigate Them Using Postman
 
Understanding Authentication and Authorization in RESTful API: A Comprehensiv...
Understanding Authentication and Authorization in RESTful API: A Comprehensiv...Understanding Authentication and Authorization in RESTful API: A Comprehensiv...
Understanding Authentication and Authorization in RESTful API: A Comprehensiv...
 
The 4 Major Threats to OWASP API Security.pdf
The 4 Major Threats to OWASP API Security.pdfThe 4 Major Threats to OWASP API Security.pdf
The 4 Major Threats to OWASP API Security.pdf
 
OAuth
OAuthOAuth
OAuth
 

Plus de José Haro Peralta

Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2
José Haro Peralta
 
Documentation-driven development for Python web APIs
Documentation-driven development for Python web APIsDocumentation-driven development for Python web APIs
Documentation-driven development for Python web APIs
José Haro Peralta
 

Plus de José Haro Peralta (7)

APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven DesignAPIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
 
Pure APIs: Development workflows for successful API integrations
Pure APIs: Development workflows for successful API integrationsPure APIs: Development workflows for successful API integrations
Pure APIs: Development workflows for successful API integrations
 
Delivering successful API integrations with documentation-driven development
Delivering successful API integrations with documentation-driven developmentDelivering successful API integrations with documentation-driven development
Delivering successful API integrations with documentation-driven development
 
Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2Documentation-driven development for Python web APIs v2
Documentation-driven development for Python web APIs v2
 
Documentation-driven development for Python web APIs
Documentation-driven development for Python web APIsDocumentation-driven development for Python web APIs
Documentation-driven development for Python web APIs
 
API Conference 2021
API Conference 2021API Conference 2021
API Conference 2021
 
PyBCN 2020
PyBCN 2020PyBCN 2020
PyBCN 2020
 

Dernier

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Dernier (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 

API Security Fundamentals

  • 1.
  • 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/