SlideShare a Scribd company logo
Multistep Business Logic
Vulnerabilities In APIs
Inon Shkedy
Security Researcher
▪ Head of Security Research @ Traceable.ai
▪ Co-author of OWASP Top 10 for APIs
▪ 9+ Years in AppSec; 200+ Pen Tests
▪ I’ve grown up with APIs
Whoami?
INON SHKEDY
Security Researcher
Government, Military, Financial
Multi Page Apps, On Prem, Waterfall, Less APIs
Startups, Tier 1 Companies
Single Page Apps, Cloud, CI/CD, Mostly APIs
Working as a
security researcher
for a small startup
▪ Harder to show value when you protect
▪ Need to find something as fast a possible (POCs are time-limited)
▪ Customers already have security teams & programs
▪ Finding Critical Vulns in minimum time
▪ Many B2B APIs
What are business
logic vulnerabilities?
▪ No strict definitions
▪ App Business Logic:
▪ Defines the users and their roles
▪ Defines how different features can manipulate different types of data
▪ How each user should use each feature (legitimately)
▪ BL Vulns:
▪ Leverage innocent features to harm the app
▪ Often related to Authorization
BL Vulns & APIs
▪ It’s much easier to understand the full context of the
application through APIs App Business Logic:
▪ Predictable
▪ Documentation
▪ Self explanatory
▪ Pentesters should always be curious about the API and
all the features
▪ They often exist in the most niche features of the API
▪ Abuse of the following features:
▪ Import Users from CSV file
▪ File Upload
▪ Async background jobs
▪ Leveraging the nature of REST APIs to bypass
security mechanisms
Exposing plain text
passwords of users
Fleet App
Fleet Management
▪ Routes
▪ Trucks
▪ Sensors
▪ Drivers
▪ Settings
User Menu - Always a Good
Place to Begin With
Fleet Management
▪ Routes
▪ Trucks
▪ Sensors
▪ Drivers
▪ Settings
▪ Profile
▪ Organization
▪ Privacy
▪ Help
Hey Piney
“Tenants” in B2B
SaaS APIs
SHOPIFY’S TENANTS
▪ Users
▪ Roles
▪ Products
POKEMON STORE
▪ Users
▪ Roles
▪ Products
DBZ STORE
▪ Users
▪ Roles
▪ Products
TECH STORE
SHOPIFY
Fleet App
Manage Org
▪ USERS
▪ Roles
▪ Contacts
▪ Org Settings
ORG Name:
Super Duper Deliveries
Users:
NAME ROLE PHONE EMAIL
Hugo Admin 1234 Some@name
Bugo User 3456 Some@name
Import Users From EXCEL/CSV File Download CSV sample file
Download Sample
& Upload to S3
▪ The uploaded list contains plain-text passwords!
Import Users from
CSV file
Create a File
Object on API
Evidence that the CSV file is stored on the server!
Initiate Import Process
using file ID
Async background job is created!
Browser Checks On Job
Behind The Scenes
Async job is checked by the browser
Job is Complete
Async Jobs are very common in B2B APIs
Look for the heaviest operations
Async Jobs in B2B APIs
SHOPIFY’S BACKGROUND JOBS
Import Catalog
From Magento
SHOPIFY
Upload Large
Video
Upload Large
Video
▪ Used to prevent the annoying “Loading…” User Experience
▪ Implemented over REST
▪ JS Application keeps checking when job is done behind the scenes
▪ Access jobs of other users
▪ Access files of other jobs
Let’s Get
Malicious
Access All Jobs
▪ Returned jobs of other users 😈
▪ Returned too many irrelevant jobs 😔
▪ Need to find a way to search in results
Leverage The Predictable nature of REST APIs
Leverage the Predictable
nature of REST APIs
GET /users/1122 → GET /users Extract all users
GET /api/v3/users → GET /api/v2/users Find old versions
GET /users/1122 → DELETE /users/1122 Find Admin Endpoints
Leverage Filters
REST API EPs often share the same behaviors and patterns
▪ API EPs often support Filters by default. Leverage
them 😈
Summary Of Phase #1
▪ API stores files based on file_id
▪ There’s a BFLA on “GET /api/rpc/async/jobs” that exposes jobs of other
users, including the job’s:
▪ Job_id
▪ File_id
▪ Org_id
▪ Challenge: How can we download a file based on its ID??
▪ (Unfortunately, not part of the natural process of importing users)
Expand your test -
look for more features!
Manage Org
▪ Users
▪ Roles
▪ Contacts
▪ ORG SETTINGS
ORG Name:
Super Duper Deliveries
Upload Logo
▪ Look for other features allowing file upload!
▪ They might share the underlying file storage mechanism
Logo Upload API Call
Looks familiar?
It’s also based On file ID
CSV upload
vs. Image Upload
Let’s take a look at the Image download process!
CSV upload Image Upload
Based on file ID
Downloadable
View Logo
▪ We found a way to download a file based on an ID 😈
▪ EP receives a URL from which to download the Image
EP Receives a file path, and extracts the
Image content from it
Direct Access to
File Path
Just to make our lives easier
Access The CSV File
Instead Of Image
▪ Upload logo feature & upload uses features share the same
underlying mechanism == great news! 😈
▪ I can access my own file
▪ Let’s try to access a file from a different job
Access The CSV File
Instead Of Image
Previous gap leaks file_id of a CSV file from other users.
Let’s try to download it
//from previous step
We Received An ERROR :(
Why can we access our own file, but not a file of someone else?
Mapping Between ORG →
Unique Folder
Org Host header Org ID Folder
superduper.fleet.com aab1da6e-092f-49af-9aa0-260131482c94 var/media/969f601c91d946cca3b
e6ef7ed5a1f29c03abf5deaac438
2a3ba008d3ead5f86/documents
▪ Mapping is done based on the org name in host header 🤔
▪ BFLA provides us only the org_id of the victim 😔
▪ How can we find the org name based on an org ID?
Feature To Find Org
Name Based On ID 😈
//from previous step
Job of the victim includes org_id
500 ERROR
Changing the hostname solved the problem ==
Plain text passwords are leaked 😈
Questions?
DM
@InonShkedy
THANK YOU
Multistep Business Logic
Vulnerabilities in APIs
Some Text Goes Here

More Related Content

Similar to 2022 APIsecure_Exploiting multi-step business logic vulnerabilities in APIs

Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017
JoEllen Carter
 
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Amazon Web Services
 
WORDPRESS & PLONE やってみたことわかったこと
WORDPRESS & PLONE やってみたことわかったことWORDPRESS & PLONE やってみたことわかったこと
WORDPRESS & PLONE やってみたことわかったこと
Zenichiro Yasuda
 
Documenting Your API
Documenting Your APIDocumenting Your API
Documenting Your API
Mailjet
 
API Platform Cloud Service best practice - OOW17
API Platform Cloud Service best practice - OOW17API Platform Cloud Service best practice - OOW17
API Platform Cloud Service best practice - OOW17
Phil Wilkins
 
DEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wpDEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wp
Felipe Prado
 
Onion Architecture and the Blog
Onion Architecture and the BlogOnion Architecture and the Blog
Onion Architecture and the Blog
barryosull
 
Building a blog with an Onion Architecture
Building a blog with an Onion ArchitectureBuilding a blog with an Onion Architecture
Building a blog with an Onion Architecture
Barry O Sullivan
 
5 free admin tools to make your life easier - Tel Aviv, Israel Admin Group
5 free admin tools  to make your life easier - Tel Aviv, Israel Admin Group5 free admin tools  to make your life easier - Tel Aviv, Israel Admin Group
5 free admin tools to make your life easier - Tel Aviv, Israel Admin Group
Joey Chan
 
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdfHow to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
Be Problem Solver
 
The Hacking Game - Think Like a Hacker Meetup 12072023.pptx
The Hacking Game - Think Like a Hacker Meetup 12072023.pptxThe Hacking Game - Think Like a Hacker Meetup 12072023.pptx
The Hacking Game - Think Like a Hacker Meetup 12072023.pptx
lior mazor
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
Amazon Web Services
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
Panoptic Development, Inc.
 
Grown-up javascript with AngularJS
Grown-up javascript with AngularJSGrown-up javascript with AngularJS
Grown-up javascript with AngularJS
Mykhailo Kotsur
 
API Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersAPI Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentesters
Inon Shkedy
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Amazon Web Services
 
Dev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - TorontoDev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - Toronto
Amazon Web Services
 
DevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous DeliveryDevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous Delivery
Mikhail Prudnikov
 
Securing the Heart of Automated Infrastructure
Securing the Heart of Automated InfrastructureSecuring the Heart of Automated Infrastructure
Securing the Heart of Automated Infrastructure
jamfish728
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Adar Weidman
 

Similar to 2022 APIsecure_Exploiting multi-step business logic vulnerabilities in APIs (20)

Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017
 
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
 
WORDPRESS & PLONE やってみたことわかったこと
WORDPRESS & PLONE やってみたことわかったことWORDPRESS & PLONE やってみたことわかったこと
WORDPRESS & PLONE やってみたことわかったこと
 
Documenting Your API
Documenting Your APIDocumenting Your API
Documenting Your API
 
API Platform Cloud Service best practice - OOW17
API Platform Cloud Service best practice - OOW17API Platform Cloud Service best practice - OOW17
API Platform Cloud Service best practice - OOW17
 
DEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wpDEF CON 23 - BRENT - white hacking web apps wp
DEF CON 23 - BRENT - white hacking web apps wp
 
Onion Architecture and the Blog
Onion Architecture and the BlogOnion Architecture and the Blog
Onion Architecture and the Blog
 
Building a blog with an Onion Architecture
Building a blog with an Onion ArchitectureBuilding a blog with an Onion Architecture
Building a blog with an Onion Architecture
 
5 free admin tools to make your life easier - Tel Aviv, Israel Admin Group
5 free admin tools  to make your life easier - Tel Aviv, Israel Admin Group5 free admin tools  to make your life easier - Tel Aviv, Israel Admin Group
5 free admin tools to make your life easier - Tel Aviv, Israel Admin Group
 
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdfHow to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
How to develop an API with PHP, JSON, and POSTMAN in 9 Steps.pdf
 
The Hacking Game - Think Like a Hacker Meetup 12072023.pptx
The Hacking Game - Think Like a Hacker Meetup 12072023.pptxThe Hacking Game - Think Like a Hacker Meetup 12072023.pptx
The Hacking Game - Think Like a Hacker Meetup 12072023.pptx
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
Grown-up javascript with AngularJS
Grown-up javascript with AngularJSGrown-up javascript with AngularJS
Grown-up javascript with AngularJS
 
API Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentestersAPI Security - OWASP top 10 for APIs + tips for pentesters
API Security - OWASP top 10 for APIs + tips for pentesters
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
 
Dev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - TorontoDev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - Toronto
 
DevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous DeliveryDevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous Delivery
 
Securing the Heart of Automated Infrastructure
Securing the Heart of Automated InfrastructureSecuring the Heart of Automated Infrastructure
Securing the Heart of Automated Infrastructure
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
 

More from APIsecure_ Official

2022 APIsecure_The Real World, API Security Edition
2022 APIsecure_The Real World, API Security Edition2022 APIsecure_The Real World, API Security Edition
2022 APIsecure_The Real World, API Security Edition
APIsecure_ Official
 
2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...
2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...
2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...
APIsecure_ Official
 
2022 APIsecure_Shift Left API Security - The Right Way
2022 APIsecure_Shift Left API Security - The Right Way2022 APIsecure_Shift Left API Security - The Right Way
2022 APIsecure_Shift Left API Security - The Right Way
APIsecure_ Official
 
2022 APIsecure_A day in the life of an API; Fighting the odds
2022 APIsecure_A day in the life of an API; Fighting the odds2022 APIsecure_A day in the life of an API; Fighting the odds
2022 APIsecure_A day in the life of an API; Fighting the odds
APIsecure_ Official
 
2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity
2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity
2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity
APIsecure_ Official
 
2022 APIsecure_Securing Large API Ecosystems
2022 APIsecure_Securing Large API Ecosystems2022 APIsecure_Securing Large API Ecosystems
2022 APIsecure_Securing Large API Ecosystems
APIsecure_ Official
 
2022 APIsecure_Quarterly Review of API Vulnerabilities
2022 APIsecure_Quarterly Review of API Vulnerabilities2022 APIsecure_Quarterly Review of API Vulnerabilities
2022 APIsecure_Quarterly Review of API Vulnerabilities
APIsecure_ Official
 
2022 APIsecure_Top Ten Security Tips for APIs
2022 APIsecure_Top Ten Security Tips for APIs2022 APIsecure_Top Ten Security Tips for APIs
2022 APIsecure_Top Ten Security Tips for APIs
APIsecure_ Official
 
2022 APIsecure_Are your APIs Rugged Enough?
2022 APIsecure_Are your APIs Rugged Enough?2022 APIsecure_Are your APIs Rugged Enough?
2022 APIsecure_Are your APIs Rugged Enough?
APIsecure_ Official
 
2022 APIsecure_Making webhook APIs secure for enterprise
2022 APIsecure_Making webhook APIs secure for enterprise2022 APIsecure_Making webhook APIs secure for enterprise
2022 APIsecure_Making webhook APIs secure for enterprise
APIsecure_ Official
 
2022 APIsecure_API Security & Fraud Detection - Are you ready?
2022 APIsecure_API Security & Fraud Detection - Are you ready?2022 APIsecure_API Security & Fraud Detection - Are you ready?
2022 APIsecure_API Security & Fraud Detection - Are you ready?
APIsecure_ Official
 
2022 APIsecure_Monitoring and Responding to API Breaches
2022 APIsecure_Monitoring and Responding to API Breaches2022 APIsecure_Monitoring and Responding to API Breaches
2022 APIsecure_Monitoring and Responding to API Breaches
APIsecure_ Official
 
2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec
2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec
2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec
APIsecure_ Official
 
2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...
2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...
2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...
APIsecure_ Official
 
2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...
2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...
2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...
APIsecure_ Official
 
2022 APIsecure_Hackers with Valid Credentials
2022 APIsecure_Hackers with Valid Credentials2022 APIsecure_Hackers with Valid Credentials
2022 APIsecure_Hackers with Valid Credentials
APIsecure_ Official
 
2022 APIsecure_API Abuse - How data breaches now and in the future will use A...
2022 APIsecure_API Abuse - How data breaches now and in the future will use A...2022 APIsecure_API Abuse - How data breaches now and in the future will use A...
2022 APIsecure_API Abuse - How data breaches now and in the future will use A...
APIsecure_ Official
 
2022 APIsecure_Understanding API Abuse With Behavioral Analytics
2022 APIsecure_Understanding API Abuse With Behavioral Analytics2022 APIsecure_Understanding API Abuse With Behavioral Analytics
2022 APIsecure_Understanding API Abuse With Behavioral Analytics
APIsecure_ Official
 
2022 APIsecure_Harnessing the Speed of Innovation
2022 APIsecure_Harnessing the Speed of Innovation2022 APIsecure_Harnessing the Speed of Innovation
2022 APIsecure_Harnessing the Speed of Innovation
APIsecure_ Official
 
2022 APIsecure_API Discovery: First step towards API Security
2022 APIsecure_API Discovery: First step towards API Security2022 APIsecure_API Discovery: First step towards API Security
2022 APIsecure_API Discovery: First step towards API Security
APIsecure_ Official
 

More from APIsecure_ Official (20)

2022 APIsecure_The Real World, API Security Edition
2022 APIsecure_The Real World, API Security Edition2022 APIsecure_The Real World, API Security Edition
2022 APIsecure_The Real World, API Security Edition
 
2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...
2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...
2022 APIsecure_Learn from the Past, Secure the Present, Plan for the Future: ...
 
2022 APIsecure_Shift Left API Security - The Right Way
2022 APIsecure_Shift Left API Security - The Right Way2022 APIsecure_Shift Left API Security - The Right Way
2022 APIsecure_Shift Left API Security - The Right Way
 
2022 APIsecure_A day in the life of an API; Fighting the odds
2022 APIsecure_A day in the life of an API; Fighting the odds2022 APIsecure_A day in the life of an API; Fighting the odds
2022 APIsecure_A day in the life of an API; Fighting the odds
 
2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity
2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity
2022 APIsecure_Passwordless Multi-factor Authentication Security and Identity
 
2022 APIsecure_Securing Large API Ecosystems
2022 APIsecure_Securing Large API Ecosystems2022 APIsecure_Securing Large API Ecosystems
2022 APIsecure_Securing Large API Ecosystems
 
2022 APIsecure_Quarterly Review of API Vulnerabilities
2022 APIsecure_Quarterly Review of API Vulnerabilities2022 APIsecure_Quarterly Review of API Vulnerabilities
2022 APIsecure_Quarterly Review of API Vulnerabilities
 
2022 APIsecure_Top Ten Security Tips for APIs
2022 APIsecure_Top Ten Security Tips for APIs2022 APIsecure_Top Ten Security Tips for APIs
2022 APIsecure_Top Ten Security Tips for APIs
 
2022 APIsecure_Are your APIs Rugged Enough?
2022 APIsecure_Are your APIs Rugged Enough?2022 APIsecure_Are your APIs Rugged Enough?
2022 APIsecure_Are your APIs Rugged Enough?
 
2022 APIsecure_Making webhook APIs secure for enterprise
2022 APIsecure_Making webhook APIs secure for enterprise2022 APIsecure_Making webhook APIs secure for enterprise
2022 APIsecure_Making webhook APIs secure for enterprise
 
2022 APIsecure_API Security & Fraud Detection - Are you ready?
2022 APIsecure_API Security & Fraud Detection - Are you ready?2022 APIsecure_API Security & Fraud Detection - Are you ready?
2022 APIsecure_API Security & Fraud Detection - Are you ready?
 
2022 APIsecure_Monitoring and Responding to API Breaches
2022 APIsecure_Monitoring and Responding to API Breaches2022 APIsecure_Monitoring and Responding to API Breaches
2022 APIsecure_Monitoring and Responding to API Breaches
 
2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec
2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec
2022 APIsecure_API Security Testing: The Next Step in Modernizing AppSec
 
2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...
2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...
2022 APIsecure_Realizing the Full Cloud Native Potential With a Multi-Layered...
 
2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...
2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...
2022 APIsecure_From Shift Left to Full Circle - A Pragmatic Approach to Catch...
 
2022 APIsecure_Hackers with Valid Credentials
2022 APIsecure_Hackers with Valid Credentials2022 APIsecure_Hackers with Valid Credentials
2022 APIsecure_Hackers with Valid Credentials
 
2022 APIsecure_API Abuse - How data breaches now and in the future will use A...
2022 APIsecure_API Abuse - How data breaches now and in the future will use A...2022 APIsecure_API Abuse - How data breaches now and in the future will use A...
2022 APIsecure_API Abuse - How data breaches now and in the future will use A...
 
2022 APIsecure_Understanding API Abuse With Behavioral Analytics
2022 APIsecure_Understanding API Abuse With Behavioral Analytics2022 APIsecure_Understanding API Abuse With Behavioral Analytics
2022 APIsecure_Understanding API Abuse With Behavioral Analytics
 
2022 APIsecure_Harnessing the Speed of Innovation
2022 APIsecure_Harnessing the Speed of Innovation2022 APIsecure_Harnessing the Speed of Innovation
2022 APIsecure_Harnessing the Speed of Innovation
 
2022 APIsecure_API Discovery: First step towards API Security
2022 APIsecure_API Discovery: First step towards API Security2022 APIsecure_API Discovery: First step towards API Security
2022 APIsecure_API Discovery: First step towards API Security
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 

2022 APIsecure_Exploiting multi-step business logic vulnerabilities in APIs

  • 1. Multistep Business Logic Vulnerabilities In APIs Inon Shkedy Security Researcher
  • 2. ▪ Head of Security Research @ Traceable.ai ▪ Co-author of OWASP Top 10 for APIs ▪ 9+ Years in AppSec; 200+ Pen Tests ▪ I’ve grown up with APIs Whoami? INON SHKEDY Security Researcher Government, Military, Financial Multi Page Apps, On Prem, Waterfall, Less APIs Startups, Tier 1 Companies Single Page Apps, Cloud, CI/CD, Mostly APIs
  • 3. Working as a security researcher for a small startup ▪ Harder to show value when you protect ▪ Need to find something as fast a possible (POCs are time-limited) ▪ Customers already have security teams & programs ▪ Finding Critical Vulns in minimum time ▪ Many B2B APIs
  • 4. What are business logic vulnerabilities? ▪ No strict definitions ▪ App Business Logic: ▪ Defines the users and their roles ▪ Defines how different features can manipulate different types of data ▪ How each user should use each feature (legitimately) ▪ BL Vulns: ▪ Leverage innocent features to harm the app ▪ Often related to Authorization
  • 5. BL Vulns & APIs ▪ It’s much easier to understand the full context of the application through APIs App Business Logic: ▪ Predictable ▪ Documentation ▪ Self explanatory ▪ Pentesters should always be curious about the API and all the features ▪ They often exist in the most niche features of the API
  • 6. ▪ Abuse of the following features: ▪ Import Users from CSV file ▪ File Upload ▪ Async background jobs ▪ Leveraging the nature of REST APIs to bypass security mechanisms Exposing plain text passwords of users
  • 7. Fleet App Fleet Management ▪ Routes ▪ Trucks ▪ Sensors ▪ Drivers ▪ Settings
  • 8. User Menu - Always a Good Place to Begin With Fleet Management ▪ Routes ▪ Trucks ▪ Sensors ▪ Drivers ▪ Settings ▪ Profile ▪ Organization ▪ Privacy ▪ Help Hey Piney
  • 9. “Tenants” in B2B SaaS APIs SHOPIFY’S TENANTS ▪ Users ▪ Roles ▪ Products POKEMON STORE ▪ Users ▪ Roles ▪ Products DBZ STORE ▪ Users ▪ Roles ▪ Products TECH STORE SHOPIFY
  • 10. Fleet App Manage Org ▪ USERS ▪ Roles ▪ Contacts ▪ Org Settings ORG Name: Super Duper Deliveries Users: NAME ROLE PHONE EMAIL Hugo Admin 1234 Some@name Bugo User 3456 Some@name Import Users From EXCEL/CSV File Download CSV sample file
  • 12. ▪ The uploaded list contains plain-text passwords! Import Users from CSV file
  • 13. Create a File Object on API Evidence that the CSV file is stored on the server!
  • 14. Initiate Import Process using file ID Async background job is created!
  • 15. Browser Checks On Job Behind The Scenes Async job is checked by the browser
  • 16. Job is Complete Async Jobs are very common in B2B APIs Look for the heaviest operations
  • 17. Async Jobs in B2B APIs SHOPIFY’S BACKGROUND JOBS Import Catalog From Magento SHOPIFY Upload Large Video Upload Large Video ▪ Used to prevent the annoying “Loading…” User Experience ▪ Implemented over REST ▪ JS Application keeps checking when job is done behind the scenes
  • 18. ▪ Access jobs of other users ▪ Access files of other jobs Let’s Get Malicious
  • 19. Access All Jobs ▪ Returned jobs of other users 😈 ▪ Returned too many irrelevant jobs 😔 ▪ Need to find a way to search in results Leverage The Predictable nature of REST APIs
  • 20. Leverage the Predictable nature of REST APIs GET /users/1122 → GET /users Extract all users GET /api/v3/users → GET /api/v2/users Find old versions GET /users/1122 → DELETE /users/1122 Find Admin Endpoints
  • 21. Leverage Filters REST API EPs often share the same behaviors and patterns ▪ API EPs often support Filters by default. Leverage them 😈
  • 22. Summary Of Phase #1 ▪ API stores files based on file_id ▪ There’s a BFLA on “GET /api/rpc/async/jobs” that exposes jobs of other users, including the job’s: ▪ Job_id ▪ File_id ▪ Org_id ▪ Challenge: How can we download a file based on its ID?? ▪ (Unfortunately, not part of the natural process of importing users)
  • 23. Expand your test - look for more features! Manage Org ▪ Users ▪ Roles ▪ Contacts ▪ ORG SETTINGS ORG Name: Super Duper Deliveries Upload Logo ▪ Look for other features allowing file upload! ▪ They might share the underlying file storage mechanism
  • 24. Logo Upload API Call Looks familiar? It’s also based On file ID
  • 25. CSV upload vs. Image Upload Let’s take a look at the Image download process! CSV upload Image Upload Based on file ID Downloadable
  • 26. View Logo ▪ We found a way to download a file based on an ID 😈 ▪ EP receives a URL from which to download the Image EP Receives a file path, and extracts the Image content from it
  • 27. Direct Access to File Path Just to make our lives easier
  • 28. Access The CSV File Instead Of Image ▪ Upload logo feature & upload uses features share the same underlying mechanism == great news! 😈 ▪ I can access my own file ▪ Let’s try to access a file from a different job
  • 29. Access The CSV File Instead Of Image Previous gap leaks file_id of a CSV file from other users. Let’s try to download it //from previous step
  • 30. We Received An ERROR :( Why can we access our own file, but not a file of someone else?
  • 31. Mapping Between ORG → Unique Folder Org Host header Org ID Folder superduper.fleet.com aab1da6e-092f-49af-9aa0-260131482c94 var/media/969f601c91d946cca3b e6ef7ed5a1f29c03abf5deaac438 2a3ba008d3ead5f86/documents ▪ Mapping is done based on the org name in host header 🤔 ▪ BFLA provides us only the org_id of the victim 😔 ▪ How can we find the org name based on an org ID?
  • 32. Feature To Find Org Name Based On ID 😈 //from previous step Job of the victim includes org_id
  • 33. 500 ERROR Changing the hostname solved the problem == Plain text passwords are leaked 😈
  • 36. Multistep Business Logic Vulnerabilities in APIs Some Text Goes Here