SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
API Security – From Theory to Practice
06 November 2019
Checkmarx Meetup Events
/ WhoAmI?
Erez Yalon
- Director of Security Research
- Focusing on Application Security
- Strong believer in spreading
security awareness
- Co-leading the OWASP API
Security Project
/ What is API?
API stands for:
Application Programming Interface
“An ApplicAtion progrAmming interfAce (Api) is an interface
or communication protocol between a client and a
server intended to simplify the building of client-side
softwAre. it hAs been described As A “contrAct” between the
client and the server, such that if the client makes a request in
a specific format, it will always get a response in a specific
formAt or initiAte A defined Action.”
https://en.wikipedia.org/wiki/Application_programming_interface
/ Who Uses APIs?
Every Modern application:
Mobile
IoT
B2B
Serverless
Cloud
Single Page Application
We
API
API Security == API-Based Apps Security
Today’s
Agenda
â—Ź How APIs-Based apps are different
â—Ź They deserve their own attention
â—Ź OWASP API Security Project
â—Ź API Security Top 10
â—Ź Call for contributors
/ How API Based Apps are Different?
Client devices are becoming varied and stronger
Logic moves from Backend to Frontend
(together with some vulnerabilities)
/ Traditional vs. Modern
Traditional
Application
Modern
Application
Get
HTML
API Get
Raw
/ Traditional vs. Modern
Less abstraction layers
Client and server (and DB) speak the same JSON
language
Modern
Application
API Get
Raw
JSON JSON JSON
/ How API Based Apps are Different?
â—Ź The server is used more as a proxy for data
â—Ź The rendering component is the client, not the server
â—Ź Clients consume raw data
â—Ź APIs expose the underlying implementation of the app
● The user’s state is usually maintained and monitored by
the client
â—Ź More parameters are sent in each HTTP request
(object ID’s, values, filters)
/ How API Based Apps are Different?
â—Ź The REST API standard
â—Ź Standardized & generic
â—Ź Predictable entry points
â—Ź One entry point (URL) can be used for multiple
purposes
/ What About Dev(Sec)Ops?
APIs change all the time
It takes just a few
clicks to spin up new
APIs (hosts).
Too easy!
APIs become hard to
track:
• Shadow APIs
• Old Exposed APIs
/ How API Based Apps are Different?
Traditional vulnerabilities are less common in API-Based
apps:
SQLi – Increasing use of ORMs
CSRF – Authorization headers instead of cookies
Path Manipulations – Cloud-Based storage
Classic IT Security Issues - SaaS
/ Bridging The Gap
/ OWASP
/
Proprietary & Confidential | All Rights Reserved | 16
Bridging The Gap
OWASP API Security Project
/ Project Leaders
Erez Yalon Inon Shkedy
- Head of Research
@ Traceable.ai
- 7 Years of research and pentesting
experience
- APIs Specialist
/ OWASP API Security – Planned Projects
â—Ź API Security Top 10
â—Ź API Security Cheat Sheet
â—Ź crAPI (Completely Ridiculous API
- an intentionally vulnerable API project)
/ Roadmap
Top 10 Cheat Sheet crAPI
2019 Q1 Prepare
2019 Q2 Kick-Off
2019 Q3 RC
2019 Q4 V1.0 Kick-Off Kick-Off
2020 Q1 Collaborate Collaborate
2020 Q2 V1.0 V1.0
/ The creation process of the Top10
â—Ź Internal knowledge and experience
â—Ź Internal data collection (Bug bounties reports, published
incidents, etc.)
â—Ź Call for Data
â—Ź Call for comments
OWASP API Security Top 10
/ API Security Top 10
â—Ź A1: Broken Object Level Authorization
â—Ź A2: Broken Authentication
â—Ź A3: Excessive Data Exposure
â—Ź A4: Lack of Resources & Rate Limiting
â—Ź A5: Broken Function Level Authorization
â—Ź A6: Mass Assignment
â—Ź A7: Security Misconfiguration
â—Ź A8: Injection
â—Ź A9: Improper Assets Management
â—Ź A10: Insufficient Logging & Monitoring
/ A1 – BOLA (Broken Object Level Authorization)
From Sam Houston,
Bugcrowd
/ A1 – BOLA (Broken Object Level Authorization)
Why is it so common?
The attack surface is much wider
APIs receive more IDs, because clients maintain the user's state
No security solution that solves the problem
Bola – also a
South American
throwing weapon
/ A1 – BOLA (Broken Object Level Authorization)
Why not "IDOR"?
"IDOR" - Insecure Direct Object Reference is a cool name
It's not accurate / indicative enough
The name "IDOR" hints that the object reference (ID) should be
indirect (e.g.: a salted hash map or added random string to every ID)
What would happen if you asked your developers to implement
“Indirect” mechanism in every place that receives ID?
The problem is not the Object Reference, but a lack of
authorization
/
Found by Daley Bee
What Might Happen?
/ • A2 – Broken Authentication
Why is it so common?
Authentication endpoints are exposed to anyone by design.
Software/security engineers have misconceptions.
OAuth isn't authentication
API keys should not be used for user's authentication
Multiple authentication flows in modern apps
IoT / Mobile / Legacy / Deep links with credentials, etc..
/ A2 – Broken Authentication
Lack of protection
API
ForgotPassword
Login
Moble_Login
UpdateLocation
EditPhoto
Assets that need to be
protected
Extra
Protection Rate
Limiting
(A4)
- Account lockout mechanism
- Captcha
- Credentials Stuffing Protection
Misimplementation
- JWT Supports {“alg”:”none”}
- Service doesn’t validate the
Oauth Provider
- Passwords stored without
salt
- Etc…
/ A3 – Excessive Data Exposure
APIs expose sensitive data of other users by design
Why it is so common?
REST Standard & API economy encourage developers to
implement APIs in a generic way
Use of generic functions as "to_json" from the Model / ORM,
without thinking about who's the consumer
/ What Might Happen?
Filtering sensitive
data on the client
side is always a
bad idea
GET
v1/users/profiles/717
Super Safe App
Bob’s Profile
Name: Bob
Role: Minion
Hobbies:
Bananas
API
/ A3 - 3Fun Hack
Found by Alex Lomas, Pen Test Partners
/
Found by Alex Lomas, Pen Test Partners
/ A3 - 3Fun Hack
Found by Alex Lomas,
Pen Test Partners
/ A4 - Lack of Resources & Rate Limiting
Several consequences for not having a limit:
DoS – Denial of Service
Brute-force attacks
/ A5 – BFLA (Broken Function Level Authorization)
API
Layer
Admin
API
Regular
API
Public
API
Legit
Malicious
Regular user
Admin
/ A5 – BFLA
Why it is common in APIs?
Function Level Authorization can be implemented in different ways:
Code
Configuration
API Gateway
Easier to detect and exploit in APIs – Endpoints are more predictable
Action Get user’s profile (Regular endpoint) Delete user (Admin endpoint)
Traditional
Apps
GET /app/users_view.aspx?user_id=1337 POST app/admin_panel/users_mgmt.aspx
action=delete&user_id=1337
/ A6 – Mass Assignment
Modern frameworks encourage developers to use
“Mass Assignment” functions
Might contain sensitive params that the user should not have access to
POST /api/users/new
{“username”:”Bob”, ”pass”:”123456”}
POST /api/users/new
{“username”:”Bob”, ”pass”:”123456”, ”role”:”admin”}
/ A6 – Mass Assignment
Easier to exploit in APIs
Instead of guessing object’s properties, just find a GET method that
returns them
/ A7 – Security Misconfiguration
Weak encryption
Unnecessary exposed HTTP methods
No CSRF protection
Detailed errors
Improper CORS
Bad Things
/ A8 – Injection
Why drop from A1 to A8?
The main reason that “Injection” is
currently #1 (2017), is because of
SQL Injections.
SQL Injection are not very common
in modern APIs, because:
Use of ORMs
Increasing use of NoSQL
NoSQL injections are a thing, but are
usually not as common / severe
/ A9 – Improper Assets Management
Two different housekeeping Issues
Lack of documentation Exposed Risky Undocumented APIs
/ A9 – Improper Assets Management
Two different housekeeping Issues
Lack of documentation
payment-
api.xxx.com
/v2/transfer_money
/v2/download_transactions_as_pdf
/v0/legacy_b2b/export_all_users
Exposed Risky Undocumented APIs
mobile-api.xxx.com
beta-api.xxx.com
payments-
api.xxx.com
APIGateway
Client
/ A9 – Improper Assets Management
Why is it such a big issue?
APIs change all the time because of CI/CD, developers are focused on delivering
and not documenting
Cloud + deployment automation (k8s) ==
Way too easy to spin up new APIs and machines
API hosts that have been forgotten
Complete environments that have been forgotten
(excuse me mister , but what the heck is “qa-3-old.app.com” ?)
/ A10 - Insufficient Logging & Monitoring
Same as OWASP Top 10 A10
Exploitation of insufficient logging and monitoring is the bedrock of nearly every
major incident.
Attackers rely on the lack of monitoring and timely response to achieve their goals
without being detected.
/ Call for Discussions
Mailing List
https://groups.google.com/a/owasp.org/d/forum/api-
security-project
/ Call for Contributions
GitHub Project
https://github.com/OWASP/API-
Security/blob/develop/CONTRIBUTING.md
www.checkmarx.com
/ Questions?
@ErezYalon

Weitere ähnliche Inhalte

Was ist angesagt?

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 pentestersInon Shkedy
 
API Management in Digital Transformation
API Management in Digital TransformationAPI Management in Digital Transformation
API Management in Digital TransformationAditya Thatte
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide Isabelle Mauny
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API ManagementApigee | Google Cloud
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee | Google Cloud
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingNetsparker
 
Running an app sec program with OWASP projects_ Defcon AppSec Village
Running an app sec program with OWASP projects_ Defcon AppSec VillageRunning an app sec program with OWASP projects_ Defcon AppSec Village
Running an app sec program with OWASP projects_ Defcon AppSec VillageVandana Verma
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & GuidelinesPrabath Siriwardena
 
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 BhatnagarOWASP Delhi
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security TestingSmartBear
 
Source Code Analysis with SAST
Source Code Analysis with SASTSource Code Analysis with SAST
Source Code Analysis with SASTBlueinfy Solutions
 
Rest API Security
Rest API SecurityRest API Security
Rest API SecurityStormpath
 
OWASP Top 10 API Security Risks
OWASP Top 10 API Security RisksOWASP Top 10 API Security Risks
OWASP Top 10 API Security RisksIndusfacePvtLtd
 
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 APIsAaronLieberman5
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?LunchBadger
 
Practical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectivePractical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectiveRajniHatti
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerSmartBear
 
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)TzahiArabov
 
Security in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersSecurity in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersDevOps.com
 

Was ist angesagt? (20)

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
 
API Management in Digital Transformation
API Management in Digital TransformationAPI Management in Digital Transformation
API Management in Digital Transformation
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API Management
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
Running an app sec program with OWASP projects_ Defcon AppSec Village
Running an app sec program with OWASP projects_ Defcon AppSec VillageRunning an app sec program with OWASP projects_ Defcon AppSec Village
Running an app sec program with OWASP projects_ Defcon AppSec Village
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & Guidelines
 
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
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security Testing
 
Source Code Analysis with SAST
Source Code Analysis with SASTSource Code Analysis with SAST
Source Code Analysis with SAST
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 
OWASP Top 10 API Security Risks
OWASP Top 10 API Security RisksOWASP Top 10 API Security Risks
OWASP Top 10 API Security Risks
 
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
OWASP Top TenOWASP Top Ten
OWASP Top Ten
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
Practical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectivePractical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's Perspective
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
 
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)
 
Security in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersSecurity in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps Engineers
 

Ă„hnlich wie API Security Top 10 - From Theory to Practice

Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...CA API Management
 
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
 
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...apidays
 
Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack CA API Management
 
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
 
API Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfAPI Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfVishwas N
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdfVishwas N
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdfVishwasN6
 
APIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIs
APIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIsAPIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIs
APIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIsapidays
 
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 WayAPIsecure_ Official
 
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...apidays
 
Top API Security Issues Found During POCs
Top API Security Issues Found During POCsTop API Security Issues Found During POCs
Top API Security Issues Found During POCs42Crunch
 
Web API Security
Web API SecurityWeb API Security
Web API SecurityStefaan
 
API Security with Postman and Qualys
API Security with Postman and QualysAPI Security with Postman and Qualys
API Security with Postman and QualysPostman
 
API Security with Postman and Qualys
API Security with Postman and QualysAPI Security with Postman and Qualys
API Security with Postman and QualysPostman
 
apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...
apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...
apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...apidays
 
5 step plan to securing your APIs
5 step plan to securing your APIs5 step plan to securing your APIs
5 step plan to securing your APIsđź’» Javier Garza
 
Outpost24 webinar - Api security
Outpost24 webinar - Api securityOutpost24 webinar - Api security
Outpost24 webinar - Api securityOutpost24
 
APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...
APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...
APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...apidays
 
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...apidays LIVE Paris - Protecting financial grade API: adopting the right secur...
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...apidays
 

Ă„hnlich wie API Security Top 10 - From Theory to Practice (20)

Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
 
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 Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
apidays LIVE Paris 2021 - Addressing OWASP API Security Top 10 by Isabelle Ma...
 
Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack
 
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...
 
API Testing and Hacking (1).pdf
API Testing and Hacking (1).pdfAPI Testing and Hacking (1).pdf
API Testing and Hacking (1).pdf
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdf
 
API Testing and Hacking.pdf
API Testing and Hacking.pdfAPI Testing and Hacking.pdf
API Testing and Hacking.pdf
 
APIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIs
APIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIsAPIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIs
APIsecure 2023 - API First Hacking, Corey Ball, Author of Hacking APIs
 
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
 
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...apidays Australia  2023 - API Security Breach Analysis & Empowering Devs to M...
apidays Australia 2023 - API Security Breach Analysis & Empowering Devs to M...
 
Top API Security Issues Found During POCs
Top API Security Issues Found During POCsTop API Security Issues Found During POCs
Top API Security Issues Found During POCs
 
Web API Security
Web API SecurityWeb API Security
Web API Security
 
API Security with Postman and Qualys
API Security with Postman and QualysAPI Security with Postman and Qualys
API Security with Postman and Qualys
 
API Security with Postman and Qualys
API Security with Postman and QualysAPI Security with Postman and Qualys
API Security with Postman and Qualys
 
apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...
apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...
apidays London 2023 - APIs: The Attack Surface That Connects Us All, Stefan M...
 
5 step plan to securing your APIs
5 step plan to securing your APIs5 step plan to securing your APIs
5 step plan to securing your APIs
 
Outpost24 webinar - Api security
Outpost24 webinar - Api securityOutpost24 webinar - Api security
Outpost24 webinar - Api security
 
APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...
APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...
APIsecure 2023 - The Present and Future of OWASP API Security Top 10, Inon Sh...
 
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...apidays LIVE Paris - Protecting financial grade API: adopting the right secur...
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...
 

KĂĽrzlich hochgeladen

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
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...panagenda
 

KĂĽrzlich hochgeladen (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
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...
 

API Security Top 10 - From Theory to Practice

  • 1. API Security – From Theory to Practice 06 November 2019 Checkmarx Meetup Events
  • 2. / WhoAmI? Erez Yalon - Director of Security Research - Focusing on Application Security - Strong believer in spreading security awareness - Co-leading the OWASP API Security Project
  • 3. / What is API? API stands for: Application Programming Interface “An ApplicAtion progrAmming interfAce (Api) is an interface or communication protocol between a client and a server intended to simplify the building of client-side softwAre. it hAs been described As A “contrAct” between the client and the server, such that if the client makes a request in a specific format, it will always get a response in a specific formAt or initiAte A defined Action.” https://en.wikipedia.org/wiki/Application_programming_interface
  • 4. / Who Uses APIs? Every Modern application: Mobile IoT B2B Serverless Cloud Single Page Application We API
  • 5. API Security == API-Based Apps Security
  • 6. Today’s Agenda â—Ź How APIs-Based apps are different â—Ź They deserve their own attention â—Ź OWASP API Security Project â—Ź API Security Top 10 â—Ź Call for contributors
  • 7. / How API Based Apps are Different? Client devices are becoming varied and stronger Logic moves from Backend to Frontend (together with some vulnerabilities)
  • 8. / Traditional vs. Modern Traditional Application Modern Application Get HTML API Get Raw
  • 9. / Traditional vs. Modern Less abstraction layers Client and server (and DB) speak the same JSON language Modern Application API Get Raw JSON JSON JSON
  • 10. / How API Based Apps are Different? â—Ź The server is used more as a proxy for data â—Ź The rendering component is the client, not the server â—Ź Clients consume raw data â—Ź APIs expose the underlying implementation of the app â—Ź The user’s state is usually maintained and monitored by the client â—Ź More parameters are sent in each HTTP request (object ID’s, values, filters)
  • 11. / How API Based Apps are Different? â—Ź The REST API standard â—Ź Standardized & generic â—Ź Predictable entry points â—Ź One entry point (URL) can be used for multiple purposes
  • 12. / What About Dev(Sec)Ops? APIs change all the time It takes just a few clicks to spin up new APIs (hosts). Too easy! APIs become hard to track: • Shadow APIs • Old Exposed APIs
  • 13. / How API Based Apps are Different? Traditional vulnerabilities are less common in API-Based apps: SQLi – Increasing use of ORMs CSRF – Authorization headers instead of cookies Path Manipulations – Cloud-Based storage Classic IT Security Issues - SaaS
  • 16. / Proprietary & Confidential | All Rights Reserved | 16 Bridging The Gap OWASP API Security Project
  • 17. / Project Leaders Erez Yalon Inon Shkedy - Head of Research @ Traceable.ai - 7 Years of research and pentesting experience - APIs Specialist
  • 18. / OWASP API Security – Planned Projects â—Ź API Security Top 10 â—Ź API Security Cheat Sheet â—Ź crAPI (Completely Ridiculous API - an intentionally vulnerable API project)
  • 19. / Roadmap Top 10 Cheat Sheet crAPI 2019 Q1 Prepare 2019 Q2 Kick-Off 2019 Q3 RC 2019 Q4 V1.0 Kick-Off Kick-Off 2020 Q1 Collaborate Collaborate 2020 Q2 V1.0 V1.0
  • 20. / The creation process of the Top10 â—Ź Internal knowledge and experience â—Ź Internal data collection (Bug bounties reports, published incidents, etc.) â—Ź Call for Data â—Ź Call for comments
  • 22. / API Security Top 10 â—Ź A1: Broken Object Level Authorization â—Ź A2: Broken Authentication â—Ź A3: Excessive Data Exposure â—Ź A4: Lack of Resources & Rate Limiting â—Ź A5: Broken Function Level Authorization â—Ź A6: Mass Assignment â—Ź A7: Security Misconfiguration â—Ź A8: Injection â—Ź A9: Improper Assets Management â—Ź A10: Insufficient Logging & Monitoring
  • 23. / A1 – BOLA (Broken Object Level Authorization) From Sam Houston, Bugcrowd
  • 24. / A1 – BOLA (Broken Object Level Authorization) Why is it so common? The attack surface is much wider APIs receive more IDs, because clients maintain the user's state No security solution that solves the problem Bola – also a South American throwing weapon
  • 25. / A1 – BOLA (Broken Object Level Authorization) Why not "IDOR"? "IDOR" - Insecure Direct Object Reference is a cool name It's not accurate / indicative enough The name "IDOR" hints that the object reference (ID) should be indirect (e.g.: a salted hash map or added random string to every ID) What would happen if you asked your developers to implement “Indirect” mechanism in every place that receives ID? The problem is not the Object Reference, but a lack of authorization
  • 26. / Found by Daley Bee What Might Happen?
  • 27. / • A2 – Broken Authentication Why is it so common? Authentication endpoints are exposed to anyone by design. Software/security engineers have misconceptions. OAuth isn't authentication API keys should not be used for user's authentication Multiple authentication flows in modern apps IoT / Mobile / Legacy / Deep links with credentials, etc..
  • 28. / A2 – Broken Authentication Lack of protection API ForgotPassword Login Moble_Login UpdateLocation EditPhoto Assets that need to be protected Extra Protection Rate Limiting (A4) - Account lockout mechanism - Captcha - Credentials Stuffing Protection Misimplementation - JWT Supports {“alg”:”none”} - Service doesn’t validate the Oauth Provider - Passwords stored without salt - Etc…
  • 29. / A3 – Excessive Data Exposure APIs expose sensitive data of other users by design Why it is so common? REST Standard & API economy encourage developers to implement APIs in a generic way Use of generic functions as "to_json" from the Model / ORM, without thinking about who's the consumer
  • 30. / What Might Happen? Filtering sensitive data on the client side is always a bad idea GET v1/users/profiles/717 Super Safe App Bob’s Profile Name: Bob Role: Minion Hobbies: Bananas API
  • 31. / A3 - 3Fun Hack Found by Alex Lomas, Pen Test Partners
  • 32. / Found by Alex Lomas, Pen Test Partners
  • 33. / A3 - 3Fun Hack Found by Alex Lomas, Pen Test Partners
  • 34. / A4 - Lack of Resources & Rate Limiting Several consequences for not having a limit: DoS – Denial of Service Brute-force attacks
  • 35. / A5 – BFLA (Broken Function Level Authorization) API Layer Admin API Regular API Public API Legit Malicious Regular user Admin
  • 36. / A5 – BFLA Why it is common in APIs? Function Level Authorization can be implemented in different ways: Code Configuration API Gateway Easier to detect and exploit in APIs – Endpoints are more predictable Action Get user’s profile (Regular endpoint) Delete user (Admin endpoint) Traditional Apps GET /app/users_view.aspx?user_id=1337 POST app/admin_panel/users_mgmt.aspx action=delete&user_id=1337
  • 37. / A6 – Mass Assignment Modern frameworks encourage developers to use “Mass Assignment” functions Might contain sensitive params that the user should not have access to POST /api/users/new {“username”:”Bob”, ”pass”:”123456”} POST /api/users/new {“username”:”Bob”, ”pass”:”123456”, ”role”:”admin”}
  • 38. / A6 – Mass Assignment Easier to exploit in APIs Instead of guessing object’s properties, just find a GET method that returns them
  • 39. / A7 – Security Misconfiguration Weak encryption Unnecessary exposed HTTP methods No CSRF protection Detailed errors Improper CORS Bad Things
  • 40. / A8 – Injection Why drop from A1 to A8? The main reason that “Injection” is currently #1 (2017), is because of SQL Injections. SQL Injection are not very common in modern APIs, because: Use of ORMs Increasing use of NoSQL NoSQL injections are a thing, but are usually not as common / severe
  • 41. / A9 – Improper Assets Management Two different housekeeping Issues Lack of documentation Exposed Risky Undocumented APIs
  • 42. / A9 – Improper Assets Management Two different housekeeping Issues Lack of documentation payment- api.xxx.com /v2/transfer_money /v2/download_transactions_as_pdf /v0/legacy_b2b/export_all_users Exposed Risky Undocumented APIs mobile-api.xxx.com beta-api.xxx.com payments- api.xxx.com APIGateway Client
  • 43. / A9 – Improper Assets Management Why is it such a big issue? APIs change all the time because of CI/CD, developers are focused on delivering and not documenting Cloud + deployment automation (k8s) == Way too easy to spin up new APIs and machines API hosts that have been forgotten Complete environments that have been forgotten (excuse me mister , but what the heck is “qa-3-old.app.com” ?)
  • 44. / A10 - Insufficient Logging & Monitoring Same as OWASP Top 10 A10 Exploitation of insufficient logging and monitoring is the bedrock of nearly every major incident. Attackers rely on the lack of monitoring and timely response to achieve their goals without being detected.
  • 45. / Call for Discussions Mailing List https://groups.google.com/a/owasp.org/d/forum/api- security-project
  • 46. / Call for Contributions GitHub Project https://github.com/OWASP/API- Security/blob/develop/CONTRIBUTING.md