SlideShare a Scribd company logo
Securing an API World
A POSITIVE
SECURITY MODEL
FOR APIS
ISABELLEMAUNY
ISABELLE@42CRUNCH.COM
Introducing Security
Models
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
NEGATIVE SECURITY MODEL (BLACKLIST)
3
Access Allowed
by default
Block access for
suspicious traffic
Threats centric
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
POSITIVE SECURITY MODEL (WHITELIST)
4
Access Denied by
default
Allow Access only
to approved
traffic
Trust centric
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
WHY A POSITIVE MODEL ?
Much stricter access control
Limited false positives
More efficient
✓ Simple vs. very complex regular expressions for
blacklisting
No need to update when new threats are
found
5
However…
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
KEEPING UP IS HARD…
A whitelist is only powerful if complete!
It requires lots of efforts to define and
maintain up to date with constant
applications changes
✓ High human cost, usually several people full
time
Traditionally been very hard to
implement
✓ Which is why default WAF model is blacklisting
7
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
…BUT APIS ARE DIFFERENT!
OpenAPI specification (OAS) can be
leveraged to describe the API contract.
Can be easily updated from code, or via
specialized tools, so the whitelist is always
in sync with the application.
You can start addressing security straight
from design time!
OpenAPI lets you build the ultimate
whitelist!
✓ And as bonus , you get better documentation!
8
OPENAPI 

INITIATIVE
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
HOW 42CRUNCH LEVERAGES OAS
9
Audit Service
performs 200+
security checks on
API Contract
Scan service
ensures API
implementation
conforms to API
contract
Protection service is
automatically
configured from
API contract
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
OWASP API SECURITY TOP 10
10
• API1	:	Broken	Object	Level	Authorisation	
• API2	:	Broken	Authentication	
• API3	:	Excessive	Data	Exposure	
• API4	:	Lack	of	Resources	&	Rate	Limiting	
• API5	:	Missing	Function/Resource	Level	Access	Control	
• API6	:	Mass	Assignment	
• API7	:	Security	Misconfiguration	
• API8	:	Injection	
• API9	:	Improper	Assets	Management	
• API10	:	Insufficient	Logging	&	Monitoring	
DOWNLOAD
Addressing API threats
with a positive model
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
EQUIFAX AND MANY MORE COMPANIES (2017)
The Attack
✓ Remote command injection attack: server executes commands written in ONGL language when a Content-Type
validation error is raised.
✓ Can also be exploited using the Content-Disposition or Content-Length headers
The Breach
✓ One of the most important in history: 147 millions people worldwide, very sensitive data
✓ Equifax got fined $700 million in Sept 2019
Core Issue
✓ Remote command injection vulnerability in Apache Struts widely exploited during months.
12
A2
A3
A4
A5
A6
A10
A9
A8
A7
A1
https://blog.talosintelligence.com/2017/03/apache-0-day-exploited.html
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
CONTENT-TYPE IN OAS
Declare “consumes” at API or operation level
✓ Limits Content-Type header value to specific mime types
Declare all request headers
13
"consumes": [
“application/x-www-form-urlencoded”,
“application/json”
],
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
HOW 42CRUNCH ADDRESSES THE PROBLEM
At Audit time
✓ Detect that Consumes is not defined
At Scan time
✓ Inject wrong Content-Type
✓ Inject wrong formats for all listed headers
At Runtime
✓ Block any Content-Type that does not match Consumes value at Runtime
✓ Block any header not matching the description
✓ Block inbound data that does not match the Content-Type
14
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
HARBOUR REGISTRY
The Attack
✓ Privilege escalation: become registry administrator
The Breach
✓ 1300+ registries with default security settings
Core Issue
✓ Mass Assignment vulnerability allows any normal user to become an admin
✓
POST /api/users
{“username”:”test”,”email”:”test123@gmail.com”,”realname
”:”noname”,”password”:”Password1u0021″,”comment”:null,
“has_admin_role” = True}
15
A2
A3
A4
A5
A6
A10
A9
A8
A7
A1
https://unit42.paloaltonetworks.com/critical-vulnerability-in-harbor-enables-privilege-escalation-from-zero-to-admin-cve-2019-16097/
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
HOW OAS CAN BE USED ?
Describe inbound schema for all requests
Use different schemas by operation (retrieve
user data vs. update user data)
16
"UsersItem": {
"type": "object",
"additionalProperties": false,
"properties": {
"_id": {
"type": "number",
"format": "integer",
"minimum": 0,
"maximum": 999999
},
"email": {
"type": "string",
"format": "email",
"pattern": “<email_regex>”,
"minLength": 10,
"maxLength": 60
},…
"is_admin": {
"description": "is admin",
"type": "boolean"
},
…
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
HOW 42CRUNCH ADDRESSES THE PROBLEM
At Audit time
✓ Detects that schemas are not associated to requests
✓ Analyzes how well data is defined (patterns, min, max, enums)
✓ Highlights usage of “additional properties”
At Scan time
✓ Injects additional properties
✓ Injects improper data
At Runtime
✓ Enforces schema definition
✓ Enforces Additional Properties restrictions
✓ Block non-declared VERBs (block unwanted POST)
17
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
UBER (SEPT 2019)
The Attack
✓ Account takeover for any Uber account from a phone number
The Breach
✓ None. This was a bug bounty.
Core Issues
✓ First Data leakage : driver internal UUID exposed through error message!
✓ Second Data leakage via the getConsentScreenDetails operation: full account information is
returned, when only a few fields are used by the UI. This includes the mobile token used to
login onto the account
18
A2
A3
A4
A5
A6
A10
A9
A8
A7
A1
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
HOW OAS CAN BE USED ?
Describe thoroughly all potential responses
Define the produces value
✓ Which data will be returned
Use different schemas by operation (retrieve
user data vs. update user data)
19
”produces”: [
"application/json"
],
"responses": {
"200": {
"description": “successful..”,
"schema": {
"type": "array",
"minItems": 0,
"maxItems": 50,
"items": {
"$ref": "#/definitions/
UsersItem"
}
}
"403": {
"description": “invalid…”,
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"pattern": "xxxx",
"minLength": 1,
"maxLength": 255
},
“success”: …
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
HOW 42CRUNCH ADDRESSES THE PROBLEM
At Audit time
✓ Analyzes which responses should be defined depending on verb (GET, POST, …)
✓ Detects that schemas are not associated to responses
✓ Analyzes how well data is defined (patterns, min, max, enums)
✓ Highlights usage of “additional properties”
At Scan time
✓ Validates responses are all defined in contract
✓ Validates responses match schemas defined in contract
At Runtime
✓ Block responses that do not match “Produces” value (unknown mime-type)
✓ Blocks responses that do not match schema definition
✓ Block non-declared responses (unknown HTTP codes)
✓ Enforces Additional Properties restrictions
20
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
A POSITIVE MODEL FOR API SECURITY WITH 42CRUNCH
Leverage OAS and build the ultimate whitelist at
design time!
✓ Right in your IDE with our VSCode extension
✓ Thorough report with priorities to act upon
Ensure API Contract is up to date via automated
audit and scan at integration/testing time
✓ Include API Contract audit and scan in your favorite CI/CD
pipeline
Leverage the power of OAS to protect your APIs at
runtime
✓ Lightweight, Kubernetes-ready firewall to automatically
protect your APIs from API contract!
21
Securing an API World
CONTACT US:
INFO@42CRUNCH.COM
Start testing your API contracts today on apisecurity.io!
 © COPYRIGHT 42CRUNCH | CONFIDENTIAL
RESOURCES
• 42Crunch Website
• Free OAS Security Audit
• OpenAPI VS Code Extension
• OpenAPI Spec Encyclopedia
• OWASP API Security Top 10
• APIsecurity.io

More Related Content

PDF
Are You Properly Using JWTs?
42Crunch
 
PDF
OWASP API Security Top 10 - Austin DevSecOps Days
42Crunch
 
PDF
The Dev, Sec and Ops of API Security - NordicAPIs
42Crunch
 
PDF
Protecting Microservices APIs with 42Crunch API Firewall
42Crunch
 
PDF
OWASP API Security Top 10 - API World
42Crunch
 
PDF
WEBINAR: OWASP API Security Top 10
42Crunch
 
PDF
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Adar Weidman
 
PDF
REST API Security by Design with Azure Pipelines
42Crunch
 
Are You Properly Using JWTs?
42Crunch
 
OWASP API Security Top 10 - Austin DevSecOps Days
42Crunch
 
The Dev, Sec and Ops of API Security - NordicAPIs
42Crunch
 
Protecting Microservices APIs with 42Crunch API Firewall
42Crunch
 
OWASP API Security Top 10 - API World
42Crunch
 
WEBINAR: OWASP API Security Top 10
42Crunch
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Adar Weidman
 
REST API Security by Design with Azure Pipelines
42Crunch
 

What's hot (20)

PDF
Top API Security Issues Found During POCs
42Crunch
 
PDF
API Security - OWASP top 10 for APIs + tips for pentesters
Inon Shkedy
 
PDF
The Dev, Sec and Ops of API Security - API World
42Crunch
 
PDF
APISecurity_OWASP_MitigationGuide
Isabelle Mauny
 
PDF
OWASP API Security TOP 10 - 2019
Miguel Angel Falcón Muñoz
 
PDF
Why you need API Security Automation
42Crunch
 
PDF
API Security: the full story
42Crunch
 
PPTX
API Security from the DevOps and CSO Perspectives (Webcast)
Apigee | Google Cloud
 
PDF
Guidelines to protect your APIs from threats
Isabelle Mauny
 
PPTX
Rest API Security - A quick understanding of Rest API Security
Mohammed Fazuluddin
 
PDF
Checkmarx meetup API Security - API Security in depth - Inon Shkedy
Adar Weidman
 
PPTX
API Security and Management Best Practices
CA API Management
 
PDF
42crunch-API-security-workshop
42Crunch
 
PDF
API Security in a Microservices World
42Crunch
 
PDF
Advanced API Security Patterns
42Crunch
 
PDF
Applying API Security at Scale
Nordic APIs
 
PDF
SecDevOps for API Security
42Crunch
 
PPTX
Managing Identities in the World of APIs
Apigee | Google Cloud
 
PPTX
Data-driven API Security
Apigee | Google Cloud
 
PDF
Open APIs Design
Isabelle Mauny
 
Top API Security Issues Found During POCs
42Crunch
 
API Security - OWASP top 10 for APIs + tips for pentesters
Inon Shkedy
 
The Dev, Sec and Ops of API Security - API World
42Crunch
 
APISecurity_OWASP_MitigationGuide
Isabelle Mauny
 
OWASP API Security TOP 10 - 2019
Miguel Angel Falcón Muñoz
 
Why you need API Security Automation
42Crunch
 
API Security: the full story
42Crunch
 
API Security from the DevOps and CSO Perspectives (Webcast)
Apigee | Google Cloud
 
Guidelines to protect your APIs from threats
Isabelle Mauny
 
Rest API Security - A quick understanding of Rest API Security
Mohammed Fazuluddin
 
Checkmarx meetup API Security - API Security in depth - Inon Shkedy
Adar Weidman
 
API Security and Management Best Practices
CA API Management
 
42crunch-API-security-workshop
42Crunch
 
API Security in a Microservices World
42Crunch
 
Advanced API Security Patterns
42Crunch
 
Applying API Security at Scale
Nordic APIs
 
SecDevOps for API Security
42Crunch
 
Managing Identities in the World of APIs
Apigee | Google Cloud
 
Data-driven API Security
Apigee | Google Cloud
 
Open APIs Design
Isabelle Mauny
 
Ad

Similar to WEBINAR: Positive Security for APIs: What it is and why you need it! (20)

PDF
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays
 
PDF
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...
apidays
 
PPTX
Secure coding - Balgan - Tiago Henriques
Tiago Henriques
 
PDF
APIDays Paris Security Workshop
42Crunch
 
PPTX
OWASP_Top_Ten_Proactive_Controls_v32.pptx
nmk42194
 
PPTX
OWASP_Top_Ten_Proactive_Controls_v2.pptx
cgt38842
 
PPTX
OWASP_Top_Ten_Proactive_Controls_v2.pptx
azida3
 
PPTX
OWASP_Top_Ten_Proactive_Controls_v2.pptx
johnpragasam1
 
PPTX
OWASP_Top_Ten_Proactive_Controls version 2
ssuser18349f1
 
PPTX
Top 10 AWS Security and Compliance best practices
Ahmad Khan
 
PDF
Injection techniques conversys
Krishnendu Paul
 
PDF
Ymens - Bouncing off clouds - Rapid Development for Cloud Ready Applications...
Vlad Mihnea
 
PPTX
Building multi tenant highly secured applications on .net for any cloud - dem...
kanimozhin
 
PPTX
Techcello hp-arch workshop
kanimozhin
 
PPTX
Brocade vADC Portfolio Overview 2016
Scott Sims
 
PDF
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
apidays
 
PPTX
Securing Applications in the Cloud
Security Innovation
 
PDF
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
apidays
 
PPTX
Prevoty NYC Java SIG 20150730
chadtindel
 
PDF
Bridging The Cloud and Application Security Gaps Meetup 15102024
lior mazor
 
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays
 
apidays LIVE Paris - Protecting financial grade API: adopting the right secur...
apidays
 
Secure coding - Balgan - Tiago Henriques
Tiago Henriques
 
APIDays Paris Security Workshop
42Crunch
 
OWASP_Top_Ten_Proactive_Controls_v32.pptx
nmk42194
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
cgt38842
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
azida3
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
johnpragasam1
 
OWASP_Top_Ten_Proactive_Controls version 2
ssuser18349f1
 
Top 10 AWS Security and Compliance best practices
Ahmad Khan
 
Injection techniques conversys
Krishnendu Paul
 
Ymens - Bouncing off clouds - Rapid Development for Cloud Ready Applications...
Vlad Mihnea
 
Building multi tenant highly secured applications on .net for any cloud - dem...
kanimozhin
 
Techcello hp-arch workshop
kanimozhin
 
Brocade vADC Portfolio Overview 2016
Scott Sims
 
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
apidays
 
Securing Applications in the Cloud
Security Innovation
 
APIdays Paris 2019 - API Security Tips for Developers by Isabelle Mauny, 42Cr...
apidays
 
Prevoty NYC Java SIG 20150730
chadtindel
 
Bridging The Cloud and Application Security Gaps Meetup 15102024
lior mazor
 
Ad

Recently uploaded (20)

PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
Exploring AI Agents in Process Industries
amoreira6
 
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
Presentation about variables and constant.pptx
kr2589474
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
oapresentation.pptx
mehatdhavalrajubhai
 

WEBINAR: Positive Security for APIs: What it is and why you need it!

  • 1. Securing an API World A POSITIVE SECURITY MODEL FOR APIS ISABELLEMAUNY [email protected]
  • 3.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL NEGATIVE SECURITY MODEL (BLACKLIST) 3 Access Allowed by default Block access for suspicious traffic Threats centric
  • 4.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL POSITIVE SECURITY MODEL (WHITELIST) 4 Access Denied by default Allow Access only to approved traffic Trust centric
  • 5.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL WHY A POSITIVE MODEL ? Much stricter access control Limited false positives More efficient ✓ Simple vs. very complex regular expressions for blacklisting No need to update when new threats are found 5
  • 7.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL KEEPING UP IS HARD… A whitelist is only powerful if complete! It requires lots of efforts to define and maintain up to date with constant applications changes ✓ High human cost, usually several people full time Traditionally been very hard to implement ✓ Which is why default WAF model is blacklisting 7
  • 8.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL …BUT APIS ARE DIFFERENT! OpenAPI specification (OAS) can be leveraged to describe the API contract. Can be easily updated from code, or via specialized tools, so the whitelist is always in sync with the application. You can start addressing security straight from design time! OpenAPI lets you build the ultimate whitelist! ✓ And as bonus , you get better documentation! 8 OPENAPI 
 INITIATIVE
  • 9.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL HOW 42CRUNCH LEVERAGES OAS 9 Audit Service performs 200+ security checks on API Contract Scan service ensures API implementation conforms to API contract Protection service is automatically configured from API contract
  • 10.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL OWASP API SECURITY TOP 10 10 • API1 : Broken Object Level Authorisation • API2 : Broken Authentication • API3 : Excessive Data Exposure • API4 : Lack of Resources & Rate Limiting • API5 : Missing Function/Resource Level Access Control • API6 : Mass Assignment • API7 : Security Misconfiguration • API8 : Injection • API9 : Improper Assets Management • API10 : Insufficient Logging & Monitoring DOWNLOAD
  • 11. Addressing API threats with a positive model
  • 12.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL EQUIFAX AND MANY MORE COMPANIES (2017) The Attack ✓ Remote command injection attack: server executes commands written in ONGL language when a Content-Type validation error is raised. ✓ Can also be exploited using the Content-Disposition or Content-Length headers The Breach ✓ One of the most important in history: 147 millions people worldwide, very sensitive data ✓ Equifax got fined $700 million in Sept 2019 Core Issue ✓ Remote command injection vulnerability in Apache Struts widely exploited during months. 12 A2 A3 A4 A5 A6 A10 A9 A8 A7 A1 https://blog.talosintelligence.com/2017/03/apache-0-day-exploited.html
  • 13.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL CONTENT-TYPE IN OAS Declare “consumes” at API or operation level ✓ Limits Content-Type header value to specific mime types Declare all request headers 13 "consumes": [ “application/x-www-form-urlencoded”, “application/json” ],
  • 14.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL HOW 42CRUNCH ADDRESSES THE PROBLEM At Audit time ✓ Detect that Consumes is not defined At Scan time ✓ Inject wrong Content-Type ✓ Inject wrong formats for all listed headers At Runtime ✓ Block any Content-Type that does not match Consumes value at Runtime ✓ Block any header not matching the description ✓ Block inbound data that does not match the Content-Type 14
  • 15.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL HARBOUR REGISTRY The Attack ✓ Privilege escalation: become registry administrator The Breach ✓ 1300+ registries with default security settings Core Issue ✓ Mass Assignment vulnerability allows any normal user to become an admin ✓ POST /api/users {“username”:”test”,”email”:”[email protected]”,”realname ”:”noname”,”password”:”Password1u0021″,”comment”:null, “has_admin_role” = True} 15 A2 A3 A4 A5 A6 A10 A9 A8 A7 A1 https://unit42.paloaltonetworks.com/critical-vulnerability-in-harbor-enables-privilege-escalation-from-zero-to-admin-cve-2019-16097/
  • 16.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL HOW OAS CAN BE USED ? Describe inbound schema for all requests Use different schemas by operation (retrieve user data vs. update user data) 16 "UsersItem": { "type": "object", "additionalProperties": false, "properties": { "_id": { "type": "number", "format": "integer", "minimum": 0, "maximum": 999999 }, "email": { "type": "string", "format": "email", "pattern": “<email_regex>”, "minLength": 10, "maxLength": 60 },… "is_admin": { "description": "is admin", "type": "boolean" }, …
  • 17.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL HOW 42CRUNCH ADDRESSES THE PROBLEM At Audit time ✓ Detects that schemas are not associated to requests ✓ Analyzes how well data is defined (patterns, min, max, enums) ✓ Highlights usage of “additional properties” At Scan time ✓ Injects additional properties ✓ Injects improper data At Runtime ✓ Enforces schema definition ✓ Enforces Additional Properties restrictions ✓ Block non-declared VERBs (block unwanted POST) 17
  • 18.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL UBER (SEPT 2019) The Attack ✓ Account takeover for any Uber account from a phone number The Breach ✓ None. This was a bug bounty. Core Issues ✓ First Data leakage : driver internal UUID exposed through error message! ✓ Second Data leakage via the getConsentScreenDetails operation: full account information is returned, when only a few fields are used by the UI. This includes the mobile token used to login onto the account 18 A2 A3 A4 A5 A6 A10 A9 A8 A7 A1
  • 19.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL HOW OAS CAN BE USED ? Describe thoroughly all potential responses Define the produces value ✓ Which data will be returned Use different schemas by operation (retrieve user data vs. update user data) 19 ”produces”: [ "application/json" ], "responses": { "200": { "description": “successful..”, "schema": { "type": "array", "minItems": 0, "maxItems": 50, "items": { "$ref": "#/definitions/ UsersItem" } } "403": { "description": “invalid…”, "schema": { "type": "object", "properties": { "message": { "type": "string", "pattern": "xxxx", "minLength": 1, "maxLength": 255 }, “success”: …
  • 20.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL HOW 42CRUNCH ADDRESSES THE PROBLEM At Audit time ✓ Analyzes which responses should be defined depending on verb (GET, POST, …) ✓ Detects that schemas are not associated to responses ✓ Analyzes how well data is defined (patterns, min, max, enums) ✓ Highlights usage of “additional properties” At Scan time ✓ Validates responses are all defined in contract ✓ Validates responses match schemas defined in contract At Runtime ✓ Block responses that do not match “Produces” value (unknown mime-type) ✓ Blocks responses that do not match schema definition ✓ Block non-declared responses (unknown HTTP codes) ✓ Enforces Additional Properties restrictions 20
  • 21.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL A POSITIVE MODEL FOR API SECURITY WITH 42CRUNCH Leverage OAS and build the ultimate whitelist at design time! ✓ Right in your IDE with our VSCode extension ✓ Thorough report with priorities to act upon Ensure API Contract is up to date via automated audit and scan at integration/testing time ✓ Include API Contract audit and scan in your favorite CI/CD pipeline Leverage the power of OAS to protect your APIs at runtime ✓ Lightweight, Kubernetes-ready firewall to automatically protect your APIs from API contract! 21
  • 22. Securing an API World CONTACT US: [email protected] Start testing your API contracts today on apisecurity.io!
  • 23.  © COPYRIGHT 42CRUNCH | CONFIDENTIAL RESOURCES • 42Crunch Website • Free OAS Security Audit • OpenAPI VS Code Extension • OpenAPI Spec Encyclopedia • OWASP API Security Top 10 • APIsecurity.io