SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & GuidelinesPrabath Siriwardena
 
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
 
API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & GuidelinesPrabath Siriwardena
 
Getting Started with API Security Testing
Getting Started with API Security TestingGetting Started with API Security Testing
Getting Started with API Security TestingSmartBear
 
Secure code practices
Secure code practicesSecure code practices
Secure code practicesHina Rawal
 
API Security Best Practices and Guidelines
API Security Best Practices and GuidelinesAPI Security Best Practices and Guidelines
API Security Best Practices and GuidelinesWSO2
 
Zero Trust Model
Zero Trust ModelZero Trust Model
Zero Trust ModelYash
 
Demystifying observability
Demystifying observability Demystifying observability
Demystifying observability Abigail Bangser
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityMohammed Fazuluddin
 
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 SecurityMatt Tesauro
 
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
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Brian Huff
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API GatewayYohann Ciurlik
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways Kong Inc.
 
Static Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouStatic Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouKevin Fealey
 
Rest API Security
Rest API SecurityRest API Security
Rest API SecurityStormpath
 

La actualidad más candente (20)

API Security Best Practices & Guidelines
API Security Best Practices & GuidelinesAPI Security Best Practices & Guidelines
API Security Best Practices & Guidelines
 
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
 
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
 
Secure code practices
Secure code practicesSecure code practices
Secure code practices
 
API Security Best Practices and Guidelines
API Security Best Practices and GuidelinesAPI Security Best Practices and Guidelines
API Security Best Practices and Guidelines
 
Zero Trust Model
Zero Trust ModelZero Trust Model
Zero Trust Model
 
Kong
KongKong
Kong
 
Demystifying observability
Demystifying observability Demystifying observability
Demystifying observability
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
 
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
 
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
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
OAuth
OAuthOAuth
OAuth
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways
 
API Security Fundamentals
API Security FundamentalsAPI Security Fundamentals
API Security Fundamentals
 
Static Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouStatic Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and You
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 

Similar a 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
 

Similar a 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
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API Management
 
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...
 

Último

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
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
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.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
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
 
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
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
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
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
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-...Steffen Staab
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
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
 
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.
 

Último (20)

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 🔝✔️✔️
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
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 ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
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
 
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
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
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
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
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-...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
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
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
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...
 

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