SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Protecting Financial
Grade APIs
Getting the right security stack
ISABELLEMAUNY
ISABELLE@42CRUNCH.COM
© COPYRIGHT 42CRUNCH | CONFIDENTIAL
API Breaches are on the rise!
• 300+ breaches reported on apisecurity.io since
Oct. 2018
• And those are just the public ones!
• Most recurrent causes (combination of):
• Lack of Input validation
• Lack of Rate Limiting
• Data/Exception leakage
• BOLA/IDOR (Authorization)
Applications Architecture has changed!
Source: https://apisecurity.io/encyclopedia/content/owasp/owasp-api-security-top-10.htm
TITLE TEXT
Complex deployments
✓
4
FROM PROTECTING THE PERIMETER…
5
…TO PROTECTING THE DATA
6
Hypervisor, VMs
Intra-services communication (auth, azn, TLS)
App level security (auth, azn, libs, code, images, data)
OS / Network / Physical Access
API Security Applies at Multiple Levels
© COPYRIGHT 42CRUNCH | CONFIDENTIAL
OWASP API Security
Top 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
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!
✓ Hacker can access any driver, user, partner profile if they know the UUID
✓ 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
8
A2
A3
A4
A5
A6
A10
A9
A8
A7
A1
https://hackernoon.com/how-i-could-have-hacked-all-uber-accounts-rtzl3z72
© COPYRIGHT 42CRUNCH | CONFIDENTIAL
Leaking Mobile Token
• {“data":{“language":"en","userUuid":"xxxxxx1e"},"getUser":{“uuid":"cxxxxxc5f7371e",
{"firstname":"Maxxxx","lastname":"XXXX","role":"PARTNER","languageId":1,"countryId":77,"mo
bile":null,"mobileToken":1234,"mobileCountryId":77,"mobileCountryCode":"+91","hasAmbig
uousMobileCountry":false,"lastConfirmedMobileCountryId":77,"email":"xxxx@gmail.com","em
ailToken":"xxxxxxxx","hasConfirmedMobile":"no","hasOptedInSmsMarketing":false,"hasConfir
medEmail":true,"gratuity":0.3,"nickname":"abc@gmail.c","location":"00000","banned":false,"car
dio":false,"token":"b8038ec4143bb4xxxxxx72d","fraudScore":0,"inviterUuid":null,"pictureU
rl":"xxxxx.jpeg","recentFareSplitterUuids":
[“xxx"],"lastSelectedPaymentProfileUuid":"xxxxxx","lastSelectedPaymentProfileGoogleWalletU
uid":null,"inviteCode":
{“promotionCodeId":xxxxx,"promotionCodeUuid":"xxxx","promotionCode":"manishas105","cre
atedAt":{“type":"Buffer","data":[0,0,1,76,2,21,215,101]},"updatedAt":{“type":"Buffer","data":
[0,0,1,76,65,211,61,9]}},"driverInfo":
{“contactinfo":"999999999xx","contactinfoCountryCode":"+91","driverLicense":"None","firstDri
verTripUuid":null,"iphone":null,"partnerUserUuid":"xxxxxxx"
API1 (BOLA) MITIGATION
Fine-grained authorisation in every controller layer
Do not use IDs from API request, use ID from session instead (implement
session management in controller layer)
Additionally:
✓ Avoid guessable IDs (123, 124, 125…)
✓ Avoid exposing internal IDs via the API
✓ Alternative: GET https://myapis.com/resources/me
Prevent data scrapping by putting rate limiting in place (by token, not by IP!)
10
API3 MITIGATION
Take control of your JSON schemas !
✓ Describe the data thoroughly and enforce the format at runtime (outbound)
✓ Review and approve data returned by APIs
Never expose tokens/sensitive/exploitable data in API responses
Never rely on client apps to filter data : instead, create various APIs
depending on consumer, with just the data they need
Beware of GraphQL queries!
✓ Validate fields accessed via query
11
© COPYRIGHT 42CRUNCH | CONFIDENTIAL
Another API3 vector: JWTs!
Recommended best
practice:
Use opaque tokens
for external
consumption
Use JWTs for internal
consumption
FACEBOOK (FEB 2018)
The Attack
✓ Account takeover via password reset at https://www.facebook.com/login/
identify?ctx=recover&lwv=110.
✓ facebook.com has rate limiting, beta.facebook.com does not!
The Breach
✓ None. This was a bug bounty.
Core Issues
✓ Rate limiting missing on beta APIs, which allows brute force guessing on
password reset code
✓ Misconfigured security on beta endpoints
13
A2
A3
A4
A5
A6
A10
A9
A8
A7
A1
https://appsecure.security/blog/we-figured-out-a-way-to-hack-any-of-facebook-s-2-billion-accounts-and-they-paid-us-a-15-000-bounty-for-it
API2 (BROKEN AUTH) MITIGATION
Choose the right authentication depending on data/operation sensitivity !
Enforce 2FA, captcha
Use secure storage for credentials
Use short-lived access tokens and limit their scope
Use MutualTLS when applicable (known/controlled partners)
Use OAuth properly (most likely authorization_code with PKCE)
✓ Financial API Grade profiles as reference (https://openid.net/wg/fapi/)
Make sure you validate JWTs according to Best Practices (RFC 8725) - https://
www.rfc-editor.org/rfc/rfc8725.txt
14
© COPYRIGHT 42CRUNCH | CONFIDENTIAL
Beware of URLs
https://www.trendmicro.com/en_us/research/19/i/when-psd2-opens-more-doors-the-risks-of-open-banking.html
API4 (RATE LIMITING) MITIGATION
Protect all authentication endpoints from abuse (login, password reset,
OAuth endpoints)
✓ Smart rate limiting : by API Key/access token/user identity/fingerprint
✓ Short timespan
✓ Counter example: Instagram, 200 attempts/min/IP for password reset
16
“In a real attack scenario, the attacker needs 5000 IPs to hack an account. It sounds big but that’s actua
easy if you use a cloud service provider like Amazon or Google. It would cost around 150 dollars to
perform the complete attack of one million codes”
APACHE STRUTS : EQUIFAX AND MANY MORE (2017)
The Attack
✓ Remote command injection attack: server executes commands written in ONGL language when a
Content-Type validation error is raised.
✓ Example:
✓
Core Issue
✓ Unpatched Apache Struts library, with remote command injection vulnerability, widely exploited
during months.
17
A2
A3
A4
A5
A6
A10
A9
A8
A7
A1
https://blog.talosintelligence.com/2017/03/apache-0-day-exploited.html
API 7 MITIGATION
Reject requests with unknown path/verbs
TLS is on by default
✓ TLS 1.2 minimum with strong cipher suites
✓ Test your API endpoints with SSLLabs.com
Change default credentials/ports
Automatically inject security headers
18
API 7 MITIGATION
Keep systems and software at
latest level
Limit your external
dependencies
Control those dependencies in-
house (enterprise repository)
No Trust !! Continuously test for
vulnerabilities and leaking
secrets (OS, libraries, docker
images, kubernetes deployment
files, etc.)
19
API 7 MITIGATION
20
API 8 MITIGATION
No Trust! (even for internal APIs and for East-West traffic)
Validate user input, including headers like Content-Type or
Accept
Check behaviour of your dev frameworks when wrong
Content-Type is used
✓ Many default to sending an exception back but experience varies
21
A10 : LOGS, LOGS, LOGS!
Log all API activity
Pushed to security platforms such as SIEMs for automated Threat
detection.
22
FINAL THOUGHTS!
Start worrying about API Security at design time
✓ A vulnerability discovered at production time costs up to 30x more to solve
Hack yourselves!
✓ For each functional test, create 10 negative tests
✓ Hammer your APIs with bad data, bad tokens, bad users
Automate Security
✓ Inject Security into DevOps practices and don’t rely on manual testing of APIs.
23
Thank you!
Contact us | info@42crunch.com | 42crunch.com
Free security tools from 42Crunch
https://42crunch.com/resources-free-tools/
News and tools for better API Security
SUBSCRIBE TODAY!

Contenu connexe

Tendances

REST API Security by Design with Azure Pipelines
REST API Security by Design with Azure PipelinesREST API Security by Design with Azure Pipelines
REST API Security by Design with Azure Pipelines
42Crunch
 

Tendances (20)

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...
 
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
 
Achieving Microservices Maturity
Achieving Microservices MaturityAchieving Microservices Maturity
Achieving Microservices Maturity
 
REST API Security by Design with Azure Pipelines
REST API Security by Design with Azure PipelinesREST API Security by Design with Azure Pipelines
REST API Security by Design with Azure Pipelines
 
Mobile - Your API Security Blindspot by David Stewart, Approov
 Mobile - Your API Security Blindspot by David Stewart, Approov Mobile - Your API Security Blindspot by David Stewart, Approov
Mobile - Your API Security Blindspot by David Stewart, Approov
 
Executing on API Developer Experience
Executing on API Developer Experience Executing on API Developer Experience
Executing on API Developer Experience
 
apidays LIVE New York 2021 - Top 10 API security threats every API team shoul...
apidays LIVE New York 2021 - Top 10 API security threats every API team shoul...apidays LIVE New York 2021 - Top 10 API security threats every API team shoul...
apidays LIVE New York 2021 - Top 10 API security threats every API team shoul...
 
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
AlertSite Slideshow for the Booth at Web 2.0 Expo 2009
 
Api gateway
Api gatewayApi gateway
Api gateway
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API Management
 
apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...
apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...
apidays LIVE India - 10 steps to secure your API by Pabitra Kumar Sahoo, Qual...
 
WEBINAR: OWASP API Security Top 10
WEBINAR: OWASP API Security Top 10WEBINAR: OWASP API Security Top 10
WEBINAR: OWASP API Security Top 10
 
OWASP API Security Top 10 - Austin DevSecOps Days
OWASP API Security Top 10 - Austin DevSecOps DaysOWASP API Security Top 10 - Austin DevSecOps Days
OWASP API Security Top 10 - Austin DevSecOps Days
 
INTERFACE, by apidays - Building contextualized API specifications by Boris ...
INTERFACE, by apidays  - Building contextualized API specifications by Boris ...INTERFACE, by apidays  - Building contextualized API specifications by Boris ...
INTERFACE, by apidays - Building contextualized API specifications by Boris ...
 
Lessons Learned from Revamping Our Doc Site
Lessons Learned from Revamping Our Doc SiteLessons Learned from Revamping Our Doc Site
Lessons Learned from Revamping Our Doc Site
 
API Services: Harness the Power of Enterprise Infrastructure
API Services: Harness the Power of Enterprise InfrastructureAPI Services: Harness the Power of Enterprise Infrastructure
API Services: Harness the Power of Enterprise Infrastructure
 
I Love APIs 2015: Scaling Mobile-focused Microservices at Verizon
I Love APIs 2015: Scaling Mobile-focused Microservices at VerizonI Love APIs 2015: Scaling Mobile-focused Microservices at Verizon
I Love APIs 2015: Scaling Mobile-focused Microservices at Verizon
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
apidays LIVE Paris 2020 - Data Gateways: building “Data-as-a-Service” for the...
apidays LIVE Paris 2020 - Data Gateways: building “Data-as-a-Service” for the...apidays LIVE Paris 2020 - Data Gateways: building “Data-as-a-Service” for the...
apidays LIVE Paris 2020 - Data Gateways: building “Data-as-a-Service” for the...
 
API Security Lifecycle
API Security LifecycleAPI Security Lifecycle
API Security Lifecycle
 

Similaire à apidays LIVE Paris - Protecting financial grade API: adopting the right security stack by Isabelle Mauny

The Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API WorldThe Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API World
42Crunch
 
WEBINAR: Positive Security for APIs: What it is and why you need it!
 WEBINAR: Positive Security for APIs: What it is and why you need it! WEBINAR: Positive Security for APIs: What it is and why you need it!
WEBINAR: Positive Security for APIs: What it is and why you need it!
42Crunch
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
johnpragasam1
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
azida3
 
The Dev, Sec and Ops of API Security - NordicAPIs
The Dev, Sec and Ops of API Security - NordicAPIsThe Dev, Sec and Ops of API Security - NordicAPIs
The Dev, Sec and Ops of API Security - NordicAPIs
42Crunch
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
cgt38842
 

Similaire à apidays LIVE Paris - Protecting financial grade API: adopting the right security stack by Isabelle Mauny (20)

apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
apidays LIVE LONDON - Protecting financial-grade APIs - Getting the right API...
 
OWASP API Security Top 10 Examples
OWASP API Security Top 10 ExamplesOWASP API Security Top 10 Examples
OWASP API Security Top 10 Examples
 
Guidelines to protect your APIs from threats
Guidelines to protect your APIs from threatsGuidelines to protect your APIs from threats
Guidelines to protect your APIs from threats
 
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
APIdays London 2019 - API Security Tips for Developers with Isabelle Mauny, 4...
 
APIDays Paris Security Workshop
APIDays Paris Security WorkshopAPIDays Paris Security Workshop
APIDays Paris Security Workshop
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide
 
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...
 
Better API Security With A SecDevOps Approach
Better API Security With A SecDevOps ApproachBetter API Security With A SecDevOps Approach
Better API Security With A SecDevOps Approach
 
Better API Security with Automation
Better API Security with Automation Better API Security with Automation
Better API Security with Automation
 
The Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API WorldThe Dev, Sec and Ops of API Security - API World
The Dev, Sec and Ops of API Security - API World
 
WEBINAR: Positive Security for APIs: What it is and why you need it!
 WEBINAR: Positive Security for APIs: What it is and why you need it! WEBINAR: Positive Security for APIs: What it is and why you need it!
WEBINAR: Positive Security for APIs: What it is and why you need it!
 
OWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersOWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript Developers
 
OWASP_Top_Ten_Proactive_Controls version 2
OWASP_Top_Ten_Proactive_Controls version 2OWASP_Top_Ten_Proactive_Controls version 2
OWASP_Top_Ten_Proactive_Controls version 2
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
The Dev, Sec and Ops of API Security - NordicAPIs
The Dev, Sec and Ops of API Security - NordicAPIsThe Dev, Sec and Ops of API Security - NordicAPIs
The Dev, Sec and Ops of API Security - NordicAPIs
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxOWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptx
 
Spa Secure Coding Guide
Spa Secure Coding GuideSpa Secure Coding Guide
Spa Secure Coding Guide
 
Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack
 

Plus de apidays

Plus de apidays (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The secrets to Graph success, by Leah Hurwich Adler, ...
Apidays New York 2024 - The secrets to Graph success, by Leah Hurwich Adler, ...Apidays New York 2024 - The secrets to Graph success, by Leah Hurwich Adler, ...
Apidays New York 2024 - The secrets to Graph success, by Leah Hurwich Adler, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - API Discovery - From Crawl to Run by Rob Dickinson, G...
Apidays New York 2024 - API Discovery - From Crawl to Run by Rob Dickinson, G...Apidays New York 2024 - API Discovery - From Crawl to Run by Rob Dickinson, G...
Apidays New York 2024 - API Discovery - From Crawl to Run by Rob Dickinson, G...
 
Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
Apidays Singapore 2024 - Building with the Planet in Mind by Sandeep Joshi, M...
 
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
Apidays Singapore 2024 - Connecting Cross Border Commerce with Payments by Gu...
 
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
Apidays Singapore 2024 - Privacy Enhancing Technologies for AI by Mark Choo, ...
 
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
Apidays Singapore 2024 - Blending AI and IoT for Smarter Health by Matthew Ch...
 
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
Apidays Singapore 2024 - OpenTelemetry for API Monitoring by Danielle Kayumbi...
 
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
Apidays Singapore 2024 - Connecting Product and Engineering Teams with Testin...
 
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
Apidays Singapore 2024 - The Growing Carbon Footprint of Digitalization and H...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
Apidays Singapore 2024 - API Monitoring x SRE by Ryan Ashneil and Eugene Wong...
 
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
Apidays Singapore 2024 - A nuanced approach on AI costs and benefits for the ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
Apidays Singapore 2024 - How APIs drive business at BNP Paribas by Quy-Doan D...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

apidays LIVE Paris - Protecting financial grade API: adopting the right security stack by Isabelle Mauny

  • 1. Protecting Financial Grade APIs Getting the right security stack ISABELLEMAUNY ISABELLE@42CRUNCH.COM
  • 2. © COPYRIGHT 42CRUNCH | CONFIDENTIAL API Breaches are on the rise! • 300+ breaches reported on apisecurity.io since Oct. 2018 • And those are just the public ones! • Most recurrent causes (combination of): • Lack of Input validation • Lack of Rate Limiting • Data/Exception leakage • BOLA/IDOR (Authorization)
  • 3. Applications Architecture has changed! Source: https://apisecurity.io/encyclopedia/content/owasp/owasp-api-security-top-10.htm
  • 4. TITLE TEXT Complex deployments ✓ 4 FROM PROTECTING THE PERIMETER…
  • 6. 6 Hypervisor, VMs Intra-services communication (auth, azn, TLS) App level security (auth, azn, libs, code, images, data) OS / Network / Physical Access API Security Applies at Multiple Levels
  • 7. © COPYRIGHT 42CRUNCH | CONFIDENTIAL OWASP API Security Top 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
  • 8. 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! ✓ Hacker can access any driver, user, partner profile if they know the UUID ✓ 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 8 A2 A3 A4 A5 A6 A10 A9 A8 A7 A1 https://hackernoon.com/how-i-could-have-hacked-all-uber-accounts-rtzl3z72
  • 9. © COPYRIGHT 42CRUNCH | CONFIDENTIAL Leaking Mobile Token • {“data":{“language":"en","userUuid":"xxxxxx1e"},"getUser":{“uuid":"cxxxxxc5f7371e", {"firstname":"Maxxxx","lastname":"XXXX","role":"PARTNER","languageId":1,"countryId":77,"mo bile":null,"mobileToken":1234,"mobileCountryId":77,"mobileCountryCode":"+91","hasAmbig uousMobileCountry":false,"lastConfirmedMobileCountryId":77,"email":"xxxx@gmail.com","em ailToken":"xxxxxxxx","hasConfirmedMobile":"no","hasOptedInSmsMarketing":false,"hasConfir medEmail":true,"gratuity":0.3,"nickname":"abc@gmail.c","location":"00000","banned":false,"car dio":false,"token":"b8038ec4143bb4xxxxxx72d","fraudScore":0,"inviterUuid":null,"pictureU rl":"xxxxx.jpeg","recentFareSplitterUuids": [“xxx"],"lastSelectedPaymentProfileUuid":"xxxxxx","lastSelectedPaymentProfileGoogleWalletU uid":null,"inviteCode": {“promotionCodeId":xxxxx,"promotionCodeUuid":"xxxx","promotionCode":"manishas105","cre atedAt":{“type":"Buffer","data":[0,0,1,76,2,21,215,101]},"updatedAt":{“type":"Buffer","data": [0,0,1,76,65,211,61,9]}},"driverInfo": {“contactinfo":"999999999xx","contactinfoCountryCode":"+91","driverLicense":"None","firstDri verTripUuid":null,"iphone":null,"partnerUserUuid":"xxxxxxx"
  • 10. API1 (BOLA) MITIGATION Fine-grained authorisation in every controller layer Do not use IDs from API request, use ID from session instead (implement session management in controller layer) Additionally: ✓ Avoid guessable IDs (123, 124, 125…) ✓ Avoid exposing internal IDs via the API ✓ Alternative: GET https://myapis.com/resources/me Prevent data scrapping by putting rate limiting in place (by token, not by IP!) 10
  • 11. API3 MITIGATION Take control of your JSON schemas ! ✓ Describe the data thoroughly and enforce the format at runtime (outbound) ✓ Review and approve data returned by APIs Never expose tokens/sensitive/exploitable data in API responses Never rely on client apps to filter data : instead, create various APIs depending on consumer, with just the data they need Beware of GraphQL queries! ✓ Validate fields accessed via query 11
  • 12. © COPYRIGHT 42CRUNCH | CONFIDENTIAL Another API3 vector: JWTs! Recommended best practice: Use opaque tokens for external consumption Use JWTs for internal consumption
  • 13. FACEBOOK (FEB 2018) The Attack ✓ Account takeover via password reset at https://www.facebook.com/login/ identify?ctx=recover&lwv=110. ✓ facebook.com has rate limiting, beta.facebook.com does not! The Breach ✓ None. This was a bug bounty. Core Issues ✓ Rate limiting missing on beta APIs, which allows brute force guessing on password reset code ✓ Misconfigured security on beta endpoints 13 A2 A3 A4 A5 A6 A10 A9 A8 A7 A1 https://appsecure.security/blog/we-figured-out-a-way-to-hack-any-of-facebook-s-2-billion-accounts-and-they-paid-us-a-15-000-bounty-for-it
  • 14. API2 (BROKEN AUTH) MITIGATION Choose the right authentication depending on data/operation sensitivity ! Enforce 2FA, captcha Use secure storage for credentials Use short-lived access tokens and limit their scope Use MutualTLS when applicable (known/controlled partners) Use OAuth properly (most likely authorization_code with PKCE) ✓ Financial API Grade profiles as reference (https://openid.net/wg/fapi/) Make sure you validate JWTs according to Best Practices (RFC 8725) - https:// www.rfc-editor.org/rfc/rfc8725.txt 14
  • 15. © COPYRIGHT 42CRUNCH | CONFIDENTIAL Beware of URLs https://www.trendmicro.com/en_us/research/19/i/when-psd2-opens-more-doors-the-risks-of-open-banking.html
  • 16. API4 (RATE LIMITING) MITIGATION Protect all authentication endpoints from abuse (login, password reset, OAuth endpoints) ✓ Smart rate limiting : by API Key/access token/user identity/fingerprint ✓ Short timespan ✓ Counter example: Instagram, 200 attempts/min/IP for password reset 16 “In a real attack scenario, the attacker needs 5000 IPs to hack an account. It sounds big but that’s actua easy if you use a cloud service provider like Amazon or Google. It would cost around 150 dollars to perform the complete attack of one million codes”
  • 17. APACHE STRUTS : EQUIFAX AND MANY MORE (2017) The Attack ✓ Remote command injection attack: server executes commands written in ONGL language when a Content-Type validation error is raised. ✓ Example: ✓ Core Issue ✓ Unpatched Apache Struts library, with remote command injection vulnerability, widely exploited during months. 17 A2 A3 A4 A5 A6 A10 A9 A8 A7 A1 https://blog.talosintelligence.com/2017/03/apache-0-day-exploited.html
  • 18. API 7 MITIGATION Reject requests with unknown path/verbs TLS is on by default ✓ TLS 1.2 minimum with strong cipher suites ✓ Test your API endpoints with SSLLabs.com Change default credentials/ports Automatically inject security headers 18
  • 19. API 7 MITIGATION Keep systems and software at latest level Limit your external dependencies Control those dependencies in- house (enterprise repository) No Trust !! Continuously test for vulnerabilities and leaking secrets (OS, libraries, docker images, kubernetes deployment files, etc.) 19
  • 21. API 8 MITIGATION No Trust! (even for internal APIs and for East-West traffic) Validate user input, including headers like Content-Type or Accept Check behaviour of your dev frameworks when wrong Content-Type is used ✓ Many default to sending an exception back but experience varies 21
  • 22. A10 : LOGS, LOGS, LOGS! Log all API activity Pushed to security platforms such as SIEMs for automated Threat detection. 22
  • 23. FINAL THOUGHTS! Start worrying about API Security at design time ✓ A vulnerability discovered at production time costs up to 30x more to solve Hack yourselves! ✓ For each functional test, create 10 negative tests ✓ Hammer your APIs with bad data, bad tokens, bad users Automate Security ✓ Inject Security into DevOps practices and don’t rely on manual testing of APIs. 23
  • 24. Thank you! Contact us | info@42crunch.com | 42crunch.com Free security tools from 42Crunch https://42crunch.com/resources-free-tools/
  • 25. News and tools for better API Security SUBSCRIBE TODAY!