SlideShare uma empresa Scribd logo
1 de 29
Ole Lensmar, @olensmar 
API SECURITY TESTING
What do these companies have in common?
Their APIs have been hacked!
If you wanted to hack an API… 
HOW WOULD YOU DO IT?
Hacking an API –the basics 
 REST and SOAP APIs predominantly use 
HTTP as their protocol 
 Arguments are sent as part of the URL, as 
HTTP Headers or in the request body 
 Message payload is predominantly JSON for 
REST and XML for SOAP
Understanding HTTP Transactions 
Request 
Response
Security Standards for Web APIs 
 SSL commonly used for transport-level encryption 
 Message level encryption and signatures: 
– SOAP/XML: WS-Security and related standards 
– REST: JSON Web Algorithms 
 Authentication 
– SOAP: WS-Security/SAML 
– REST: Oauth 1 + 2, OpenID Connect, SAML, 
custom
So, we’re hackers… 
WHERE DO WE START?
API Attack Surface Detection 
 We want to know as much as possible about 
an APIs endpoints, messages, parameters, 
behavior 
 The more we know – the better we can target 
our attack! 
 Unfortunately though – an API has no “UI” that 
can show is the attack surface
Attack Surface Detection: API Metadata 
The more we know, the easier it is… 
 api-docs.json 
 WSDL/XML Schema 
 Swagger, RAML, API-Blueprint, ioDocs, etc 
 Hypermedia (JSON-LD, Siren, etc) 
 Documentation / Developer Portals 
Choosing between usability vs hackability
Attack Surface Detection: API Metadata 
the point of attack 
HTTP Method: Are other methods handled correctly? 
Oauth 2.0: are tokens enforced and validated correctly? 
Is access validated? Are ids sequential? Injection point?,etc 
What if we send multiple? Or none at all?
Attack Surface Detection: Other Methods 
 Discovery 
– Record traffic via proxy or network sniffer to record 
and “learn” an API 
 Brute force 
– Try commonly used endpoints (/api, /api/v1, etc) 
– Use error messages to uncover possible paths
With an Attack Surface, we can… 
 Fuzzing 
 Injection attacks 
 Invalid / Out-of bounds content 
 Malicious content 
 Cross Site Scripting 
 Cross-site Request Forgery
Why Hack an API? 
 Provoke error messages or responses that give 
us system details 
– Database names 
– File paths 
– Component versions 
– Etc… 
 Find security holes that give us access to 
system resources 
 Put the API in an unavailable or unstable state 
(DOS)
API Attack Methods 
HOW DO WE TEST FOR THEM?
API Fuzzing 
What is it? 
 Send random content as 
input parameters 
 Automation can help us 
send millions of 
permutations 
 Recursive Fuzzing – try 
all possible values 
 Replacive Fuzzing – try 
common attack vectors 
How do we test for it? 
 Create automated fuzz 
tests that validate 
response messages to: 
– Not conceal system 
information 
– Return correct error messages 
/ status codes 
 Run them for a long time 
 Run them in parallel / as 
load tests
Injection Attacks 
What is it? 
 Using SQL, XML, Xpath, 
JSON, JavaScript etc, 
attempt to inject code that is 
executed where it 
shouldn’t be 
 Primary injection: code is 
executed on the server 
 Secondary injection: code is 
executed by 3rd party 
 Example: 
"SELECT * FROM pets WHERE petID='" + petId +"'"; 
http://petstore.com/api/v1/pet/123 
-> SELECT * FROM pets WHERE petID = ‘123’ 
http://petstore.com/api/v1/pet/' or '1'='1 
SELECT * FROM pets WHERE petID = ‘’ or ‘1’ = ‘1’ 
How do we test for it? 
 Understand how the API 
works: 
SQL? NoSQL? Other APIs? 
 Use well known injection 
vectors – validate for 
“unexpected” responses 
 For example: validate that 
login call does not log you 
in 
 Automate security tests
Invalid / Out-of-bounds attacks 
What is it? 
 Send input that we know 
is invalid 
– Out of range numbers 
– Invalid dates 
– Invalid enumeration values 
– Invalid data-types / formatting 
 Can be auto-generated if 
the API has “good” 
metadata 
How do we test for it? 
 Send input that you know 
is invalid 
– Out of range numbers 
– Invalid dates 
– Random enumerations 
– Etc. 
 Validate for: 
– Not displaying system 
information 
– Returning correct error 
messages / status codes
Malicious Content 
What is it? 
 Where files/images are 
uploaded/”attached”; attempt to 
upload executable files/scripts/etc 
 Exploit server side parsing of 
content 
 Example of XML Bomb: 
How do we test for it? 
 Attempt to upload files that do no 
harm but indicate that they have 
incorrectly handled 
 Both corrupt versions of accepted 
formats, and invalid formats. 
 Validate that you get the right error 
messages! 
 Test for parse vulnerabilities – use 
known Vectors 
Be careful with this one…
Cross-Site Scripting 
What is it? 
 Reflective XSS: Malicious script 
is included in link and “reflected” 
back to user 
 Persistent XSS: Malicious script 
is injected into backend system 
and retrieved by user 
How do we test for it? 
 In either case – create functional 
API tests that upload common 
attack vectors 
 For Reflective XSS tests: 
validate that they are escaped 
(or removed) in the response 
 For Persistent XSS tests: 
create end-to-end test that 
simulates the “other client” and 
validates correspondingly
Cross-Site Request Forgery (CSRF) 
What is it? How do we test for it? 
 The common workaround is 
to include an unpredictable 
token with each request 
 Create functional tests that 
validate: 
– The API call fails without that 
token 
– Tokens can not be re-used 
 Run a fuzzing test on the 
token itself to validate that it 
can’t be spoofed or 
bypassed 
Point of 
attack!
Insufficient SSL configurations 
What is it? 
 Eavesdropping on API 
traffic 
 APIs should always use 
SSL – but sometimes they 
don’t, 
or it isn’t enforced (HTTP 
works also) 
 Is the SSL certificate self-signed? 
(browsers will warn 
you – but code in a native 
mobile apps might silently 
allow access) 
How do we test for it? 
 Create simple tests that fail 
if HTTPS is not enforced 
 Create simple tests that fail 
if certificates are self signed 
 Run these in production as 
monitors – small system 
configuration 
changes/tweaks could have 
side effects
Insecure Direct Object References 
What is it? 
 For parameters that are 
IDs and seem to be 
sequential, try submitting 
IDs to get access. 
 In Query Parameters, 
Headers and Message 
Bodies 
 Call methods/operations 
that you shouldn’t have 
access to 
How do we test for it? 
 Inspect actual API 
requests / metadata 
You should question usage of direct object 
references! 
 Create functional tests 
that validate authorization 
enforcement 
 Combine with fuzzing or 
boundary tests on IDs
Other things to think about… 
Bad Session/Authentication Handling 
 Are session tokens re-used 
or sequential? 
 Do session tokens 
timeout correctly? 
 Are tokens exposed in 
unencrypted traffic? 
 Are tokens added to URL 
when sending links? 
 Are login endpoints 
restricted? 
Bad security configuration 
 Based on error messages 
and system information 
exposed by previous 
attacks 
 Target all layers 
– Network 
– Server 
– Application 
– Client 
 Examples: 
– exposed management consoles 
– directory listings 
– stack-traces 
– default passwords
So where does this leave us? 
GENERAL CONCEPTS TO 
REMEMBER
API Security Testing requires you to 
 Understand API Technologies 
 Understand the API and its implementation 
 Understand how Security Vulnerabilities work
Putting it into practice 
 Automate Basic Security Tests using free tools 
 Run automated Security Tests simultaneously 
as Load and Functional tests 
 Stay up to date on Vulnerabilities
Resources 
OWASP: 
http://owasp.org 
WS-Attacks: 
http://ws-attacks.org/ 
Zed Attack Proxy (ZAP): 
https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project 
Ready! API Secure: 
http://smartbear.com/product/ready-api/secure/overview/
@olensmar 
ole.lensmar@smartbear.com

Mais conteúdo relacionado

Mais procurados

REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspectiveSecuRing
 
A8 cross site request forgery (csrf) it 6873 presentation
A8 cross site request forgery (csrf)   it 6873 presentationA8 cross site request forgery (csrf)   it 6873 presentation
A8 cross site request forgery (csrf) it 6873 presentationAlbena Asenova-Belal
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingAnurag Srivastava
 
Rest API Security
Rest API SecurityRest API Security
Rest API SecurityStormpath
 
Security testing presentation
Security testing presentationSecurity testing presentation
Security testing presentationConfiz
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Codingbilcorry
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonTEST Huddle
 
Web PenTest Sample Report
Web PenTest Sample ReportWeb PenTest Sample Report
Web PenTest Sample ReportOctogence
 
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
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016bugcrowd
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)TzahiArabov
 
security misconfigurations
security misconfigurationssecurity misconfigurations
security misconfigurationsMegha Sahu
 
Learn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAPLearn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAPPaul Ionescu
 
Secure code practices
Secure code practicesSecure code practices
Secure code practicesHina Rawal
 

Mais procurados (20)

REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspective
 
Api Testing
Api TestingApi Testing
Api Testing
 
A8 cross site request forgery (csrf) it 6873 presentation
A8 cross site request forgery (csrf)   it 6873 presentationA8 cross site request forgery (csrf)   it 6873 presentation
A8 cross site request forgery (csrf) it 6873 presentation
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
API TESTING
API TESTINGAPI TESTING
API TESTING
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 
Security testing presentation
Security testing presentationSecurity testing presentation
Security testing presentation
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
Web PenTest Sample Report
Web PenTest Sample ReportWeb PenTest Sample Report
Web PenTest Sample Report
 
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)
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 
security misconfigurations
security misconfigurationssecurity misconfigurations
security misconfigurations
 
Security testing
Security testingSecurity testing
Security testing
 
Api testing
Api testingApi testing
Api testing
 
Learn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAPLearn to pen-test with OWASP ZAP
Learn to pen-test with OWASP ZAP
 
Secure code practices
Secure code practicesSecure code practices
Secure code practices
 

Destaque

An introduction to api testing | David Tzemach
An introduction to api testing | David TzemachAn introduction to api testing | David Tzemach
An introduction to api testing | David TzemachDavid Tzemach
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlowAiste Stikliute
 
Testing Agile Web Services from soapUI
Testing Agile Web Services from soapUITesting Agile Web Services from soapUI
Testing Agile Web Services from soapUIPLM Mechanic .
 
Automate REST API Testing
Automate REST API TestingAutomate REST API Testing
Automate REST API TestingTechWell
 
Presentation for soap ui
Presentation for soap uiPresentation for soap ui
Presentation for soap uiAnjali Rao
 
Soa testing soap ui (2)
Soa testing   soap ui (2)Soa testing   soap ui (2)
Soa testing soap ui (2)Knoldus Inc.
 
SOAP-UI The Web service Testing
SOAP-UI The Web service TestingSOAP-UI The Web service Testing
SOAP-UI The Web service TestingGanesh Mandala
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API TestingQASource
 
Ppt of soap ui
Ppt of soap uiPpt of soap ui
Ppt of soap uipkslide28
 
Testing web services
Testing web servicesTesting web services
Testing web servicesTaras Lytvyn
 
Web Services Automated Testing via SoapUI Tool
Web Services Automated Testing via SoapUI ToolWeb Services Automated Testing via SoapUI Tool
Web Services Automated Testing via SoapUI ToolSperasoft
 

Destaque (15)

An introduction to api testing | David Tzemach
An introduction to api testing | David TzemachAn introduction to api testing | David Tzemach
An introduction to api testing | David Tzemach
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Testing Agile Web Services from soapUI
Testing Agile Web Services from soapUITesting Agile Web Services from soapUI
Testing Agile Web Services from soapUI
 
Testing soapui
Testing soapuiTesting soapui
Testing soapui
 
Automate REST API Testing
Automate REST API TestingAutomate REST API Testing
Automate REST API Testing
 
Presentation for soap ui
Presentation for soap uiPresentation for soap ui
Presentation for soap ui
 
Soa testing soap ui (2)
Soa testing   soap ui (2)Soa testing   soap ui (2)
Soa testing soap ui (2)
 
SOAP-UI The Web service Testing
SOAP-UI The Web service TestingSOAP-UI The Web service Testing
SOAP-UI The Web service Testing
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
 
API Testing
API TestingAPI Testing
API Testing
 
Soap ui
Soap uiSoap ui
Soap ui
 
Ppt of soap ui
Ppt of soap uiPpt of soap ui
Ppt of soap ui
 
Testing web services
Testing web servicesTesting web services
Testing web services
 
Learn SoapUI
Learn SoapUILearn SoapUI
Learn SoapUI
 
Web Services Automated Testing via SoapUI Tool
Web Services Automated Testing via SoapUI ToolWeb Services Automated Testing via SoapUI Tool
Web Services Automated Testing via SoapUI Tool
 

Semelhante a Getting Started with API Security Testing

香港六合彩
香港六合彩香港六合彩
香港六合彩baoyin
 
Web API Security
Web API SecurityWeb API Security
Web API SecurityStefaan
 
BSidesDC 2016 Beyond Automated Testing
BSidesDC 2016 Beyond Automated TestingBSidesDC 2016 Beyond Automated Testing
BSidesDC 2016 Beyond Automated TestingAndrew McNicol
 
Application Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio ScaleApplication Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio ScaleJeff Williams
 
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
 
Securing Underprotected APIs - Deja vu Security
Securing Underprotected APIs - Deja vu SecuritySecuring Underprotected APIs - Deja vu Security
Securing Underprotected APIs - Deja vu SecurityDeja vu Security
 
Building Secure Apps in the Cloud
Building Secure Apps in the CloudBuilding Secure Apps in the Cloud
Building Secure Apps in the CloudAtlassian
 
Application security 101
Application security 101Application security 101
Application security 101Vlad Garbuz
 
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
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesMarco Morana
 
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...Yuji Kosuga
 
Phpnw security-20111009
Phpnw security-20111009Phpnw security-20111009
Phpnw security-20111009Paul Lemon
 
Application security [appsec]
Application security [appsec]Application security [appsec]
Application security [appsec]Judy Ngure
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide Isabelle Mauny
 
AppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services HackingAppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services HackingShreeraj Shah
 
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)Steve Poole
 
Testingfor Sw Security
Testingfor Sw SecurityTestingfor Sw Security
Testingfor Sw Securityankitmehta21
 

Semelhante a Getting Started with API Security Testing (20)

香港六合彩
香港六合彩香港六合彩
香港六合彩
 
Web API Security
Web API SecurityWeb API Security
Web API Security
 
BSidesDC 2016 Beyond Automated Testing
BSidesDC 2016 Beyond Automated TestingBSidesDC 2016 Beyond Automated Testing
BSidesDC 2016 Beyond Automated Testing
 
Application Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio ScaleApplication Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio Scale
 
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...
 
Securing Underprotected APIs - Deja vu Security
Securing Underprotected APIs - Deja vu SecuritySecuring Underprotected APIs - Deja vu Security
Securing Underprotected APIs - Deja vu Security
 
Building Secure Apps in the Cloud
Building Secure Apps in the CloudBuilding Secure Apps in the Cloud
Building Secure Apps in the Cloud
 
Owasp Top 10-2013
Owasp Top 10-2013Owasp Top 10-2013
Owasp Top 10-2013
 
Application security 101
Application security 101Application security 101
Application security 101
 
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
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root Causes
 
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
 
Phpnw security-20111009
Phpnw security-20111009Phpnw security-20111009
Phpnw security-20111009
 
Application security [appsec]
Application security [appsec]Application security [appsec]
Application security [appsec]
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide
 
AppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services HackingAppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services Hacking
 
OWASP Top10 2010
OWASP Top10 2010OWASP Top10 2010
OWASP Top10 2010
 
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
 
Api Testing.pdf
Api Testing.pdfApi Testing.pdf
Api Testing.pdf
 
Testingfor Sw Security
Testingfor Sw SecurityTestingfor Sw Security
Testingfor Sw Security
 

Mais de SmartBear

Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubSmartBear
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1SmartBear
 
IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...
IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...
IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...SmartBear
 
The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...
The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...
The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...SmartBear
 
How LISI Automotive Accelerated Application Delivery with SwaggerHub
How LISI Automotive Accelerated Application Delivery with SwaggerHubHow LISI Automotive Accelerated Application Delivery with SwaggerHub
How LISI Automotive Accelerated Application Delivery with SwaggerHubSmartBear
 
Standardising APIs: Powering the Platform Economy in Financial Services
Standardising APIs: Powering the Platform Economy in Financial ServicesStandardising APIs: Powering the Platform Economy in Financial Services
Standardising APIs: Powering the Platform Economy in Financial ServicesSmartBear
 
Getting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHubGetting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHubSmartBear
 
Adopting a Design-First Approach to API Development with SwaggerHub
Adopting a Design-First Approach to API Development with SwaggerHubAdopting a Design-First Approach to API Development with SwaggerHub
Adopting a Design-First Approach to API Development with SwaggerHubSmartBear
 
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...SmartBear
 
Effective API Lifecycle Management
Effective API Lifecycle Management Effective API Lifecycle Management
Effective API Lifecycle Management SmartBear
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...SmartBear
 
The API Lifecycle Series: Evolving API Development and Testing from Open Sour...
The API Lifecycle Series: Evolving API Development and Testing from Open Sour...The API Lifecycle Series: Evolving API Development and Testing from Open Sour...
The API Lifecycle Series: Evolving API Development and Testing from Open Sour...SmartBear
 
Artificial intelligence for faster and smarter software testing - Galway Mee...
Artificial intelligence for faster and smarter software testing  - Galway Mee...Artificial intelligence for faster and smarter software testing  - Galway Mee...
Artificial intelligence for faster and smarter software testing - Galway Mee...SmartBear
 
Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSmartBear
 
The Best Kept Secrets of Code Review | SmartBear Webinar
The Best Kept Secrets of Code Review | SmartBear WebinarThe Best Kept Secrets of Code Review | SmartBear Webinar
The Best Kept Secrets of Code Review | SmartBear WebinarSmartBear
 
How Capital One Scaled API Design to Deliver New Products Faster
How Capital One Scaled API Design to Deliver New Products FasterHow Capital One Scaled API Design to Deliver New Products Faster
How Capital One Scaled API Design to Deliver New Products FasterSmartBear
 
Testing Without a GUI Using TestComplete
 Testing Without a GUI Using TestComplete Testing Without a GUI Using TestComplete
Testing Without a GUI Using TestCompleteSmartBear
 
Hidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script ExtensionsHidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script ExtensionsSmartBear
 
How Bdd Can Save Agile
 How Bdd Can Save Agile How Bdd Can Save Agile
How Bdd Can Save AgileSmartBear
 
API Automation and TDD to Implement Master Data Survivorship Rules
API Automation and TDD to Implement Master Data Survivorship RulesAPI Automation and TDD to Implement Master Data Survivorship Rules
API Automation and TDD to Implement Master Data Survivorship RulesSmartBear
 

Mais de SmartBear (20)

Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHub
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1
 
IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...
IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...
IATA Open Air: How API Standardization Enables Innovation in the Airline Indu...
 
The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...
The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...
The State of API 2020 Webinar – Exploring Trends, Tools & Takeaways to Drive ...
 
How LISI Automotive Accelerated Application Delivery with SwaggerHub
How LISI Automotive Accelerated Application Delivery with SwaggerHubHow LISI Automotive Accelerated Application Delivery with SwaggerHub
How LISI Automotive Accelerated Application Delivery with SwaggerHub
 
Standardising APIs: Powering the Platform Economy in Financial Services
Standardising APIs: Powering the Platform Economy in Financial ServicesStandardising APIs: Powering the Platform Economy in Financial Services
Standardising APIs: Powering the Platform Economy in Financial Services
 
Getting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHubGetting Started with API Standardization in SwaggerHub
Getting Started with API Standardization in SwaggerHub
 
Adopting a Design-First Approach to API Development with SwaggerHub
Adopting a Design-First Approach to API Development with SwaggerHubAdopting a Design-First Approach to API Development with SwaggerHub
Adopting a Design-First Approach to API Development with SwaggerHub
 
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...
 
Effective API Lifecycle Management
Effective API Lifecycle Management Effective API Lifecycle Management
Effective API Lifecycle Management
 
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
 
The API Lifecycle Series: Evolving API Development and Testing from Open Sour...
The API Lifecycle Series: Evolving API Development and Testing from Open Sour...The API Lifecycle Series: Evolving API Development and Testing from Open Sour...
The API Lifecycle Series: Evolving API Development and Testing from Open Sour...
 
Artificial intelligence for faster and smarter software testing - Galway Mee...
Artificial intelligence for faster and smarter software testing  - Galway Mee...Artificial intelligence for faster and smarter software testing  - Galway Mee...
Artificial intelligence for faster and smarter software testing - Galway Mee...
 
Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile World
 
The Best Kept Secrets of Code Review | SmartBear Webinar
The Best Kept Secrets of Code Review | SmartBear WebinarThe Best Kept Secrets of Code Review | SmartBear Webinar
The Best Kept Secrets of Code Review | SmartBear Webinar
 
How Capital One Scaled API Design to Deliver New Products Faster
How Capital One Scaled API Design to Deliver New Products FasterHow Capital One Scaled API Design to Deliver New Products Faster
How Capital One Scaled API Design to Deliver New Products Faster
 
Testing Without a GUI Using TestComplete
 Testing Without a GUI Using TestComplete Testing Without a GUI Using TestComplete
Testing Without a GUI Using TestComplete
 
Hidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script ExtensionsHidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script Extensions
 
How Bdd Can Save Agile
 How Bdd Can Save Agile How Bdd Can Save Agile
How Bdd Can Save Agile
 
API Automation and TDD to Implement Master Data Survivorship Rules
API Automation and TDD to Implement Master Data Survivorship RulesAPI Automation and TDD to Implement Master Data Survivorship Rules
API Automation and TDD to Implement Master Data Survivorship Rules
 

Ú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
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
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
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
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
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
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.
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
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
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
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 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
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-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
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
 
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
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
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 ☂️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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 ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
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
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
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...
 

Getting Started with API Security Testing

  • 1. Ole Lensmar, @olensmar API SECURITY TESTING
  • 2. What do these companies have in common?
  • 3. Their APIs have been hacked!
  • 4. If you wanted to hack an API… HOW WOULD YOU DO IT?
  • 5. Hacking an API –the basics  REST and SOAP APIs predominantly use HTTP as their protocol  Arguments are sent as part of the URL, as HTTP Headers or in the request body  Message payload is predominantly JSON for REST and XML for SOAP
  • 7. Security Standards for Web APIs  SSL commonly used for transport-level encryption  Message level encryption and signatures: – SOAP/XML: WS-Security and related standards – REST: JSON Web Algorithms  Authentication – SOAP: WS-Security/SAML – REST: Oauth 1 + 2, OpenID Connect, SAML, custom
  • 8. So, we’re hackers… WHERE DO WE START?
  • 9. API Attack Surface Detection  We want to know as much as possible about an APIs endpoints, messages, parameters, behavior  The more we know – the better we can target our attack!  Unfortunately though – an API has no “UI” that can show is the attack surface
  • 10. Attack Surface Detection: API Metadata The more we know, the easier it is…  api-docs.json  WSDL/XML Schema  Swagger, RAML, API-Blueprint, ioDocs, etc  Hypermedia (JSON-LD, Siren, etc)  Documentation / Developer Portals Choosing between usability vs hackability
  • 11. Attack Surface Detection: API Metadata the point of attack HTTP Method: Are other methods handled correctly? Oauth 2.0: are tokens enforced and validated correctly? Is access validated? Are ids sequential? Injection point?,etc What if we send multiple? Or none at all?
  • 12. Attack Surface Detection: Other Methods  Discovery – Record traffic via proxy or network sniffer to record and “learn” an API  Brute force – Try commonly used endpoints (/api, /api/v1, etc) – Use error messages to uncover possible paths
  • 13. With an Attack Surface, we can…  Fuzzing  Injection attacks  Invalid / Out-of bounds content  Malicious content  Cross Site Scripting  Cross-site Request Forgery
  • 14. Why Hack an API?  Provoke error messages or responses that give us system details – Database names – File paths – Component versions – Etc…  Find security holes that give us access to system resources  Put the API in an unavailable or unstable state (DOS)
  • 15. API Attack Methods HOW DO WE TEST FOR THEM?
  • 16. API Fuzzing What is it?  Send random content as input parameters  Automation can help us send millions of permutations  Recursive Fuzzing – try all possible values  Replacive Fuzzing – try common attack vectors How do we test for it?  Create automated fuzz tests that validate response messages to: – Not conceal system information – Return correct error messages / status codes  Run them for a long time  Run them in parallel / as load tests
  • 17. Injection Attacks What is it?  Using SQL, XML, Xpath, JSON, JavaScript etc, attempt to inject code that is executed where it shouldn’t be  Primary injection: code is executed on the server  Secondary injection: code is executed by 3rd party  Example: "SELECT * FROM pets WHERE petID='" + petId +"'"; http://petstore.com/api/v1/pet/123 -> SELECT * FROM pets WHERE petID = ‘123’ http://petstore.com/api/v1/pet/' or '1'='1 SELECT * FROM pets WHERE petID = ‘’ or ‘1’ = ‘1’ How do we test for it?  Understand how the API works: SQL? NoSQL? Other APIs?  Use well known injection vectors – validate for “unexpected” responses  For example: validate that login call does not log you in  Automate security tests
  • 18. Invalid / Out-of-bounds attacks What is it?  Send input that we know is invalid – Out of range numbers – Invalid dates – Invalid enumeration values – Invalid data-types / formatting  Can be auto-generated if the API has “good” metadata How do we test for it?  Send input that you know is invalid – Out of range numbers – Invalid dates – Random enumerations – Etc.  Validate for: – Not displaying system information – Returning correct error messages / status codes
  • 19. Malicious Content What is it?  Where files/images are uploaded/”attached”; attempt to upload executable files/scripts/etc  Exploit server side parsing of content  Example of XML Bomb: How do we test for it?  Attempt to upload files that do no harm but indicate that they have incorrectly handled  Both corrupt versions of accepted formats, and invalid formats.  Validate that you get the right error messages!  Test for parse vulnerabilities – use known Vectors Be careful with this one…
  • 20. Cross-Site Scripting What is it?  Reflective XSS: Malicious script is included in link and “reflected” back to user  Persistent XSS: Malicious script is injected into backend system and retrieved by user How do we test for it?  In either case – create functional API tests that upload common attack vectors  For Reflective XSS tests: validate that they are escaped (or removed) in the response  For Persistent XSS tests: create end-to-end test that simulates the “other client” and validates correspondingly
  • 21. Cross-Site Request Forgery (CSRF) What is it? How do we test for it?  The common workaround is to include an unpredictable token with each request  Create functional tests that validate: – The API call fails without that token – Tokens can not be re-used  Run a fuzzing test on the token itself to validate that it can’t be spoofed or bypassed Point of attack!
  • 22. Insufficient SSL configurations What is it?  Eavesdropping on API traffic  APIs should always use SSL – but sometimes they don’t, or it isn’t enforced (HTTP works also)  Is the SSL certificate self-signed? (browsers will warn you – but code in a native mobile apps might silently allow access) How do we test for it?  Create simple tests that fail if HTTPS is not enforced  Create simple tests that fail if certificates are self signed  Run these in production as monitors – small system configuration changes/tweaks could have side effects
  • 23. Insecure Direct Object References What is it?  For parameters that are IDs and seem to be sequential, try submitting IDs to get access.  In Query Parameters, Headers and Message Bodies  Call methods/operations that you shouldn’t have access to How do we test for it?  Inspect actual API requests / metadata You should question usage of direct object references!  Create functional tests that validate authorization enforcement  Combine with fuzzing or boundary tests on IDs
  • 24. Other things to think about… Bad Session/Authentication Handling  Are session tokens re-used or sequential?  Do session tokens timeout correctly?  Are tokens exposed in unencrypted traffic?  Are tokens added to URL when sending links?  Are login endpoints restricted? Bad security configuration  Based on error messages and system information exposed by previous attacks  Target all layers – Network – Server – Application – Client  Examples: – exposed management consoles – directory listings – stack-traces – default passwords
  • 25. So where does this leave us? GENERAL CONCEPTS TO REMEMBER
  • 26. API Security Testing requires you to  Understand API Technologies  Understand the API and its implementation  Understand how Security Vulnerabilities work
  • 27. Putting it into practice  Automate Basic Security Tests using free tools  Run automated Security Tests simultaneously as Load and Functional tests  Stay up to date on Vulnerabilities
  • 28. Resources OWASP: http://owasp.org WS-Attacks: http://ws-attacks.org/ Zed Attack Proxy (ZAP): https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project Ready! API Secure: http://smartbear.com/product/ready-api/secure/overview/