SlideShare a Scribd company logo
1 of 32
Download to read offline
OWASP Top 10
A4 – Insecure Direct Object Reference
Narudom Roongsiriwong
CISSP
WhoAmI
● Lazy Blogger
– Japan, Security, FOSS, Politics, Christian
– http://narudomr.blogspot.com
● Information Security since 1995
● Web Application Development since 1998
● Head of IT Security, Kiatnakin Bank PLC (KKP)
● Contact: narudom.roongsiriwong@owasp.org
What Is It?
• Occurs when a developer exposes a reference
to an internal implementation object, such as
a file, directory, or database key.
• Without an access control check or other
protection, attackers can manipulate these
references to access unauthorized data.
Impact = Moderate
●
Such flaws can compromise all the data that
can be referenced by the parameter.
●
Unless object references are unpredictable, it’s
easy for an attacker to access all available data
of that type.
●
Consider the business value of the exposed
data as well as the business impact of public
exposure of the vulnerability.
Why Care About Insecure Direct Object
References?
●
Although this vulnerability is easy to exploit and easy
to detect, it is still usually ignored by developers
●
June 2000, Australian Treasury GST(Goods and
Services Tax) website was hacked and private
information from 17,000 businesses breached, just by
a student typing in an URL
●
February 2014, Insecure Direct Object Reference allow
attacker to delete all the posted thread and comments
on Yahoo's Suggestion Board website → 1.5 million
records
Insecure Direct Object Web Page Query
Not Only Web Page but XML Data Island
Client Account ID
Account ID
Not Only Web Page but XML Data Island
Not Only Web Page but XML Data Island
Not Only Web Page but XML Data Island
Misunderstanding on Insecure Direct
Object Reference
● We use HTTPS nobody can change my POST parameters
– HTTPS protects data in transportation not the end point, attackers
can manipulate data using tools like OWASP Zap Proxy, Burp Suite
or even Firebug plug-in for Firefox
● We use AJAX to exchange data browser's developer mode
cannot see or change data
– Proxy tools like OWASP Zap Proxy and Burp Suites are able to
intercept HTTP(S) protocol including AJAX communication
● Our mobile application with HTTPS cannot be intercepted,
nobody can change object references
– No, attackers can run your app on rooted or jail-broken devices or
in emulator or connect to access point with proxy tools as named
above
Misunderstanding on
Insecure Direct Object Reference
● We can encrypt requests before POSTing
– Be sure you use encryption not encoding like base64
– If you use symmetric encryption, the key will be on
client side somewhere.
● Web application, the encryption key must be
somewhere in your scripts.
● Mobile application, attackers can reverse engineering
you app and find the key
– If you use asymmetric encryption, it is safe, however
your server processing will increase significantly.
Mitigations
● Do not expose internal keys or identifiers
– Keep user ID or key in a session variable
– Use a temporary mapping value (See next slide)
● Use object references that are challenging to guess
– GUID/UUID
– Random Number
● Perform server-side authorization checks before object
accesses (strongly recommend)
– Verify the parameter value is properly formatted
– Verify the user is allowed to access the target object
– Verify the requested mode of access is allowed to the target object
(e.g., read, write, delete)
Temporary Mapping Value
Account Label MapID
112536 Deposit 1
115696 Current 2
Temporary
In session memory
How Do You Test Applications?
• Testing for insecure direct object references can be hard to
automate
– Automated scanners do not know what users should have access to
what data
• Inspect parameters being passed to applications
• Manipulate parameters to see if sensitive information is
disclosed
• Look at pages whose only purpose is to display information
about a single object
– Documents
– Accounts
– Statements
OWASP Testing Guide for A4
● Authorization Testing
– Testing Directory
traversal/file include
(OTG-AUTHZ-001)
– Testing for Bypassing
Authorization Schema
(OTG-AUTHZ-002)
– Testing for Privilege
escalation (OTG-AUTHZ-
003)
– Testing for Insecure
Direct Object References
(OTG-AUTHZ-004)
Testing Directory traversal/file include
(OTG-AUTHZ-001): Enumeration
● Are there request parameters which could be used for file-related
operations?
● Are there unusual file extensions?
● Are there interesting variable names?
– http://example.com/index.php?file=content
– http://example.com/main.cgi?home=index.htm
– http://example.com/getUserProfile.jsp?item=ikki.html
● Is it possible to identify cookies used by the web application for
the dynamic generation of pages or templates?
Cookie: ID=d9ccd3f4f9f18cc1:T-
M=2166255468:LM=1162655568:S=3cFpqbJgMSSPKVMV:-
TEMPLATE=flower
Cookie: USER=1826cc8f:PSTYLE=GreenDotRed
Testing Directory traversal/file include
(OTG-AUTHZ-001): Testing Techniques
● Insert the malicious string “../../../../” to include the
password hash file for a Linux/Unix or boot.ini for Windows
system
– http://example.com/getUserProfile.jsp?
item=../../../../etc/passwd
● For the cookies example:
– Cookie: USER=1826cc8f:PSTYLE=../../../../etc/passwd
● Try to include files and scripts located on external website.
– http://example.com/index.php?
file=http://www.owasp.org/malicioustxt
● Try to show the source code of a CGI component
– http://example.com/main.cgi?home=main.cgi
Testing Directory traversal/file include
(OTG-AUTHZ-001): Testing Techniques
If “../” does not work, try character encoding such as URL
encoding, double URL encoding, Unicode/UTF-8 encoding
Encoding Test with Represent
URL %2e%2e%2f ../
%2e%2e/ ../
..%2f ../
%2e%2e%5c ..
%2e%2e ..
..%5c ..
Double URL %252e%252e%255c ..
..%255c ..
Unicode/UTF-8 ..%c0%af ../
..%c1%9c ..
Testing Directory traversal/file include
(OTG-AUTHZ-001): Testing Tools
● DotDotPwn - The Directory Traversal Fuzzer -
http://dotdotpwn.sectester.net
● Path Traversal Fuzz Strings (from WFuzz Tool) -
http://code.google.com/p/wfuzz/source/brows
e/trunk/wordlist/Injections/Traversal.txt
● Web Proxy (Burp Suite, Paros,
WebScarab,OWASP: Zed Attack Proxy (ZAP))
● Encoding/Decoding tools
Testing Other Authorization
(OTG-AUTHZ-002 to 004): Prerequisite
● Needs to map out all locations in the application where
user input is used to reference objects directly.
– A database row
– A file
– Application pages
● Having at least two (often more) users to cover different
owned objects and functions
– Users each having access to different objects (such as
purchase information, private messages, etc.)
– Users with different privileges (for example administrator
users) to see whether there are direct references to
application functionality
Testing for Bypassing Authorization
Schema (OTG-AUTHZ-002): Summary
● Focus on verifying how the authorization schema has
been implemented for each role or privilege to get
access to reserved functions and resources.
● States to verify
– User is not authenticated
– After the log-out
– User that holds a different role or privilege
● Track all the administrative functions when:
– Logging as a user with standard privileges
– Logging as a user with a different role and for whom that
action should be denied
Testing for Bypassing Authorization
Schema (OTG-AUTHZ-002): How to test
● Testing for access to administrative functions
– Example, Try to post to administrator's “adduser”
when logging on as non-administrative roles
● Testing for access to resources assigned to a
different role
– Example, analyze an application that uses a shared
directory
Testing for Privilege escalation (OTG-
AUTHZ-003): Summary
● Verify that it is not possible for a user to modify his or her
privileges or roles inside the application
● Privilege escalation occurs when a user gets access to more
resources or functionality than they are normally allowed
● The degree of escalation depends on what privileges the
attacker is authorized to possess, and what privileges can be
obtained in a successful exploit
● Vertical escalation – access resources granted to more
privileged accounts (e.g., acquiring administrative privileges
for the application)
● Horizontal escalation – access resources granted to a similarly
configured account (e.g., in an online banking application,
accessing information related to a different user)
Testing for Privilege escalation (OTG-
AUTHZ-003): How to test
POST /user/viewOrder.jsp HTTP/1.1
Host: www.example.com
...
groupID=grp001&orderID=0001
This POST allows the user that
belongs to grp001 to access order
#0001, logon with a user that does
not belong to grp001 then intercept
the post & try to modify the
parameters to gain access
privileged data
Testing for Privilege escalation (OTG-
AUTHZ-003): How to test
HTTP/1.1 200 OK
Server: Netscape-Enterprise/6.0
Date: Wed, 1 Apr 2006 13:51:20 GMT
Set-Cookie: USER=aW78ryrGrTWs4MnOd32Fs51yDqp;
path=/; domain=www.example.com
Set-Cookie: SESSION=k+KmKeHXTgDi1J5fT7Zz;
path=/; domain= www.example.com
Cache-Control: no-cache
Pragma: No-cache
Content-length: 247
Content-Type: text/html
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Connection: close
<form name="autoriz" method="POST" action =
"visual.jsp">
<input type="hidden" name="profile"
value="SysAdmin">
<body onload="document.forms.autoriz.submit()">
</td>
</tr>
This HTML shows a
hidden field to the
user after a
successful
administrative user
authentication.
Logon with another
non-administrative
user and modify
the value of the
variable "profile" to
"SysAdmin"? Is it
possible to become
administrator?
Testing for Insecure Direct Object References
(OTG-AUTHZ-004): Scenarios
● Retrieve a database record
– http://foo.bar/somepage?invoice=12345
● Perform an operation in the application
– http://foo.bar/changepassword?user=someuser
● Retrieve a file system resource
– http://foo.bar/showImage?img=img00011
● Access application functionality
– http://foo.bar/accessPage?menuitem=12
Testing for Insecure Direct Object References
(OTG-AUTHZ-004): Where to Look for
● URL Query String
● Cookie (HTTP Header)
● Request Body (Post Method)
– Query String
– XML SOAP Interface
– JSON Document
● Check Web URL, Web Forms, AJAX
Communication, Mobile HTTP Request and
Web Service
Common Tools for Authorization Testing
● Web Proxy (Burp Suite, Paros,
WebScarab,OWASP: Zed Attack Proxy (ZAP))
Recap
● Insecure direct object references occur when
an application exposes internal references to
objects via parameters passed to the
application
● To guard against:
– Do not expose internal keys or identifiers for
objects
– Use object references that are challenging to guess
– Perform server-side authorization checks before
object accesses (strongly recommend)
References
• OWASP
– OWASP Top 10 2010-A4-Insecure Direct Object References
– ESAPI Access Reference Map
– ESAPI Access Control API (See isAuthorizedForData(),
isAuthorizedForFile(), isAuthorizedForFunction())
• External
– CWE Entry 639 on Insecure Direct Object Reference
– CWE Entry 22 on Path Traversal (an example of a Direct
Object Reference attack)
OWASP Top 10 A4 – Insecure Direct Object Reference

More Related Content

What's hot

Polyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPraPolyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPraMathias Karlsson
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016Frans Rosén
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing TechniquesAvinash Thapa
 
The Game of Bug Bounty Hunting - Money, Drama, Action and Fame
The Game of Bug Bounty Hunting - Money, Drama, Action and FameThe Game of Bug Bounty Hunting - Money, Drama, Action and Fame
The Game of Bug Bounty Hunting - Money, Drama, Action and FameAbhinav Mishra
 
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...Lenur Dzhemiliev
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingAnurag Srivastava
 
Pentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarPentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarOWASP Delhi
 
Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!Abhijeth D
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & TestingDeepu S Nath
 
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim HegazyHackIT Ukraine
 
Bug Bounty - Hackers Job
Bug Bounty - Hackers JobBug Bounty - Hackers Job
Bug Bounty - Hackers JobArbin Godar
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing Priyanka Aash
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...Noppadol Songsakaew
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration Tariq Islam
 

What's hot (20)

Polyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPraPolyglot payloads in practice by avlidienbrunn at HackPra
Polyglot payloads in practice by avlidienbrunn at HackPra
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
The Game of Bug Bounty Hunting - Money, Drama, Action and Fame
The Game of Bug Bounty Hunting - Money, Drama, Action and FameThe Game of Bug Bounty Hunting - Money, Drama, Action and Fame
The Game of Bug Bounty Hunting - Money, Drama, Action and Fame
 
Pentesting ReST API
Pentesting ReST APIPentesting ReST API
Pentesting ReST API
 
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...
OWASP Top 10 Vulnerabilities - A5-Broken Access Control; A6-Security Misconfi...
 
Bug bounty
Bug bountyBug bounty
Bug bounty
 
Hack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhydHack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhyd
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
Pentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarPentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang Bhatnagar
 
Ssrf
SsrfSsrf
Ssrf
 
Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!Recon and Bug Bounties - What a great love story!
Recon and Bug Bounties - What a great love story!
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & Testing
 
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
 
Bug Bounty - Hackers Job
Bug Bounty - Hackers JobBug Bounty - Hackers Job
Bug Bounty - Hackers Job
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Web Application Penetration Testing
Web Application Penetration Testing Web Application Penetration Testing
Web Application Penetration Testing
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration
 

Viewers also liked

A5-Security misconfiguration-OWASP 2013
A5-Security misconfiguration-OWASP 2013   A5-Security misconfiguration-OWASP 2013
A5-Security misconfiguration-OWASP 2013 Sorina Chirilă
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 
InsecureDirectObjectReferences
InsecureDirectObjectReferencesInsecureDirectObjectReferences
InsecureDirectObjectReferencesmacanazon
 
Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)Pichaya Morimoto
 
Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)Narudom Roongsiriwong, CISSP
 
OWASP Enterprise Security API
OWASP Enterprise Security APIOWASP Enterprise Security API
OWASP Enterprise Security APIConFoo
 
OWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsOWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsKaty Anton
 

Viewers also liked (20)

Secure Software Development Adoption Strategy
Secure Software Development Adoption StrategySecure Software Development Adoption Strategy
Secure Software Development Adoption Strategy
 
Securing the Internet from Cyber Criminals
Securing the Internet from Cyber CriminalsSecuring the Internet from Cyber Criminals
Securing the Internet from Cyber Criminals
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)
 
Secure PHP Coding
Secure PHP CodingSecure PHP Coding
Secure PHP Coding
 
Unlock Security Insight from Machine Data
Unlock Security Insight from Machine DataUnlock Security Insight from Machine Data
Unlock Security Insight from Machine Data
 
Application Security: Last Line of Defense
Application Security: Last Line of DefenseApplication Security: Last Line of Defense
Application Security: Last Line of Defense
 
Payment Card System Overview
Payment Card System OverviewPayment Card System Overview
Payment Card System Overview
 
A5-Security misconfiguration-OWASP 2013
A5-Security misconfiguration-OWASP 2013   A5-Security misconfiguration-OWASP 2013
A5-Security misconfiguration-OWASP 2013
 
AnyID: Security Point of View
AnyID: Security Point of ViewAnyID: Security Point of View
AnyID: Security Point of View
 
Risk Management in Project Management
Risk Management in Project ManagementRisk Management in Project Management
Risk Management in Project Management
 
AnyID and Privacy
AnyID and PrivacyAnyID and Privacy
AnyID and Privacy
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 
InsecureDirectObjectReferences
InsecureDirectObjectReferencesInsecureDirectObjectReferences
InsecureDirectObjectReferences
 
Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)Security Misconfiguration (OWASP Top 10 - 2013 - A5)
Security Misconfiguration (OWASP Top 10 - 2013 - A5)
 
Database Firewall with Snort
Database Firewall with SnortDatabase Firewall with Snort
Database Firewall with Snort
 
Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)
 
owaspa4
owaspa4owaspa4
owaspa4
 
OWASP Enterprise Security API
OWASP Enterprise Security APIOWASP Enterprise Security API
OWASP Enterprise Security API
 
OWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsOWASP Top 10 Proactive Controls
OWASP Top 10 Proactive Controls
 

Similar to OWASP Top 10 A4 – Insecure Direct Object Reference

CISSP Week 13
CISSP Week 13CISSP Week 13
CISSP Week 13jemtallon
 
Secure Android Development
Secure Android DevelopmentSecure Android Development
Secure Android DevelopmentShaul Rosenzwieg
 
Annual OktCyberfest 2019
Annual OktCyberfest 2019Annual OktCyberfest 2019
Annual OktCyberfest 2019Fahad Al-Hasan
 
Authorisation: Concepts and Implementation
Authorisation: Concepts and ImplementationAuthorisation: Concepts and Implementation
Authorisation: Concepts and ImplementationOmar Bashir
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on itWSO2
 
Lecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptxLecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptxBalkrishanpatidar
 
OWASP OTG-configuration (OWASP Thailand chapter november 2015)
OWASP OTG-configuration (OWASP Thailand chapter november 2015)OWASP OTG-configuration (OWASP Thailand chapter november 2015)
OWASP OTG-configuration (OWASP Thailand chapter november 2015)Noppadol Songsakaew
 
CohenNancyPresentation.ppt
CohenNancyPresentation.pptCohenNancyPresentation.ppt
CohenNancyPresentation.pptmypc72
 
Federico Toledo - Extra-functional testing.pdf
Federico Toledo - Extra-functional testing.pdfFederico Toledo - Extra-functional testing.pdf
Federico Toledo - Extra-functional testing.pdfQA or the Highway
 
[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answers[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answersOWASP
 
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16AppDynamics
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top TenSecurity Innovation
 
Security Best Practices for Bot Builders
Security Best Practices for Bot BuildersSecurity Best Practices for Bot Builders
Security Best Practices for Bot BuildersMax Feldman
 
Platform Security IRL: Busting Buzzwords & Building Better
Platform Security IRL:  Busting Buzzwords & Building BetterPlatform Security IRL:  Busting Buzzwords & Building Better
Platform Security IRL: Busting Buzzwords & Building BetterEqual Experts
 
API Upload Test
API Upload TestAPI Upload Test
API Upload Testdecatv
 
API Upload Test
API Upload TestAPI Upload Test
API Upload Testdecatv
 

Similar to OWASP Top 10 A4 – Insecure Direct Object Reference (20)

CISSP Week 13
CISSP Week 13CISSP Week 13
CISSP Week 13
 
Secure Android Development
Secure Android DevelopmentSecure Android Development
Secure Android Development
 
Annual OktCyberfest 2019
Annual OktCyberfest 2019Annual OktCyberfest 2019
Annual OktCyberfest 2019
 
Authorisation: Concepts and Implementation
Authorisation: Concepts and ImplementationAuthorisation: Concepts and Implementation
Authorisation: Concepts and Implementation
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
 
Lecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptxLecture32-Web-based-testing-II.pptx
Lecture32-Web-based-testing-II.pptx
 
OWASP OTG-configuration (OWASP Thailand chapter november 2015)
OWASP OTG-configuration (OWASP Thailand chapter november 2015)OWASP OTG-configuration (OWASP Thailand chapter november 2015)
OWASP OTG-configuration (OWASP Thailand chapter november 2015)
 
CohenNancyPresentation.ppt
CohenNancyPresentation.pptCohenNancyPresentation.ppt
CohenNancyPresentation.ppt
 
OWASP Top Ten in Practice
OWASP Top Ten in PracticeOWASP Top Ten in Practice
OWASP Top Ten in Practice
 
Security Design Principles.ppt
 Security Design Principles.ppt Security Design Principles.ppt
Security Design Principles.ppt
 
Federico Toledo - Extra-functional testing.pdf
Federico Toledo - Extra-functional testing.pdfFederico Toledo - Extra-functional testing.pdf
Federico Toledo - Extra-functional testing.pdf
 
Open Science Grid security-atlas-t2 Bob Cowles
Open Science Grid security-atlas-t2 Bob CowlesOpen Science Grid security-atlas-t2 Bob Cowles
Open Science Grid security-atlas-t2 Bob Cowles
 
[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answers[OWASP Poland Day] Application security - daily questions & answers
[OWASP Poland Day] Application security - daily questions & answers
 
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
Security Best Practices for Bot Builders
Security Best Practices for Bot BuildersSecurity Best Practices for Bot Builders
Security Best Practices for Bot Builders
 
Platform Security IRL: Busting Buzzwords & Building Better
Platform Security IRL:  Busting Buzzwords & Building BetterPlatform Security IRL:  Busting Buzzwords & Building Better
Platform Security IRL: Busting Buzzwords & Building Better
 
15 worker directories
15   worker directories15   worker directories
15 worker directories
 
API Upload Test
API Upload TestAPI Upload Test
API Upload Test
 
API Upload Test
API Upload TestAPI Upload Test
API Upload Test
 

More from Narudom Roongsiriwong, CISSP

How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19Narudom Roongsiriwong, CISSP
 
Embedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment IndustryEmbedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment IndustryNarudom Roongsiriwong, CISSP
 
Application Security Verification Standard Project
Application Security Verification Standard ProjectApplication Security Verification Standard Project
Application Security Verification Standard ProjectNarudom Roongsiriwong, CISSP
 
Top 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsTop 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsNarudom Roongsiriwong, CISSP
 

More from Narudom Roongsiriwong, CISSP (16)

Biometric Authentication.pdf
Biometric Authentication.pdfBiometric Authentication.pdf
Biometric Authentication.pdf
 
Security Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdfSecurity Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdf
 
Secure Design: Threat Modeling
Secure Design: Threat ModelingSecure Design: Threat Modeling
Secure Design: Threat Modeling
 
Security Patterns for Software Development
Security Patterns for Software DevelopmentSecurity Patterns for Software Development
Security Patterns for Software Development
 
How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19
 
Secure Software Design for Data Privacy
Secure Software Design for Data PrivacySecure Software Design for Data Privacy
Secure Software Design for Data Privacy
 
Blockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for DummiesBlockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for Dummies
 
DevSecOps 101
DevSecOps 101DevSecOps 101
DevSecOps 101
 
National Digital ID Platform Technical Forum
National Digital ID Platform Technical ForumNational Digital ID Platform Technical Forum
National Digital ID Platform Technical Forum
 
IoT Security
IoT SecurityIoT Security
IoT Security
 
Embedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment IndustryEmbedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment Industry
 
Secure Your Encryption with HSM
Secure Your Encryption with HSMSecure Your Encryption with HSM
Secure Your Encryption with HSM
 
Application Security Verification Standard Project
Application Security Verification Standard ProjectApplication Security Verification Standard Project
Application Security Verification Standard Project
 
Coding Security: Code Mania 101
Coding Security: Code Mania 101Coding Security: Code Mania 101
Coding Security: Code Mania 101
 
Top 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsTop 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security Problems
 
CarbonCredit-V4
CarbonCredit-V4CarbonCredit-V4
CarbonCredit-V4
 

Recently uploaded

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

OWASP Top 10 A4 – Insecure Direct Object Reference

  • 1. OWASP Top 10 A4 – Insecure Direct Object Reference Narudom Roongsiriwong CISSP
  • 2. WhoAmI ● Lazy Blogger – Japan, Security, FOSS, Politics, Christian – http://narudomr.blogspot.com ● Information Security since 1995 ● Web Application Development since 1998 ● Head of IT Security, Kiatnakin Bank PLC (KKP) ● Contact: narudom.roongsiriwong@owasp.org
  • 3. What Is It? • Occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, or database key. • Without an access control check or other protection, attackers can manipulate these references to access unauthorized data.
  • 4. Impact = Moderate ● Such flaws can compromise all the data that can be referenced by the parameter. ● Unless object references are unpredictable, it’s easy for an attacker to access all available data of that type. ● Consider the business value of the exposed data as well as the business impact of public exposure of the vulnerability.
  • 5. Why Care About Insecure Direct Object References? ● Although this vulnerability is easy to exploit and easy to detect, it is still usually ignored by developers ● June 2000, Australian Treasury GST(Goods and Services Tax) website was hacked and private information from 17,000 businesses breached, just by a student typing in an URL ● February 2014, Insecure Direct Object Reference allow attacker to delete all the posted thread and comments on Yahoo's Suggestion Board website → 1.5 million records
  • 6. Insecure Direct Object Web Page Query
  • 7. Not Only Web Page but XML Data Island Client Account ID Account ID
  • 8. Not Only Web Page but XML Data Island
  • 9. Not Only Web Page but XML Data Island
  • 10. Not Only Web Page but XML Data Island
  • 11. Misunderstanding on Insecure Direct Object Reference ● We use HTTPS nobody can change my POST parameters – HTTPS protects data in transportation not the end point, attackers can manipulate data using tools like OWASP Zap Proxy, Burp Suite or even Firebug plug-in for Firefox ● We use AJAX to exchange data browser's developer mode cannot see or change data – Proxy tools like OWASP Zap Proxy and Burp Suites are able to intercept HTTP(S) protocol including AJAX communication ● Our mobile application with HTTPS cannot be intercepted, nobody can change object references – No, attackers can run your app on rooted or jail-broken devices or in emulator or connect to access point with proxy tools as named above
  • 12. Misunderstanding on Insecure Direct Object Reference ● We can encrypt requests before POSTing – Be sure you use encryption not encoding like base64 – If you use symmetric encryption, the key will be on client side somewhere. ● Web application, the encryption key must be somewhere in your scripts. ● Mobile application, attackers can reverse engineering you app and find the key – If you use asymmetric encryption, it is safe, however your server processing will increase significantly.
  • 13. Mitigations ● Do not expose internal keys or identifiers – Keep user ID or key in a session variable – Use a temporary mapping value (See next slide) ● Use object references that are challenging to guess – GUID/UUID – Random Number ● Perform server-side authorization checks before object accesses (strongly recommend) – Verify the parameter value is properly formatted – Verify the user is allowed to access the target object – Verify the requested mode of access is allowed to the target object (e.g., read, write, delete)
  • 14. Temporary Mapping Value Account Label MapID 112536 Deposit 1 115696 Current 2 Temporary In session memory
  • 15. How Do You Test Applications? • Testing for insecure direct object references can be hard to automate – Automated scanners do not know what users should have access to what data • Inspect parameters being passed to applications • Manipulate parameters to see if sensitive information is disclosed • Look at pages whose only purpose is to display information about a single object – Documents – Accounts – Statements
  • 16. OWASP Testing Guide for A4 ● Authorization Testing – Testing Directory traversal/file include (OTG-AUTHZ-001) – Testing for Bypassing Authorization Schema (OTG-AUTHZ-002) – Testing for Privilege escalation (OTG-AUTHZ- 003) – Testing for Insecure Direct Object References (OTG-AUTHZ-004)
  • 17. Testing Directory traversal/file include (OTG-AUTHZ-001): Enumeration ● Are there request parameters which could be used for file-related operations? ● Are there unusual file extensions? ● Are there interesting variable names? – http://example.com/index.php?file=content – http://example.com/main.cgi?home=index.htm – http://example.com/getUserProfile.jsp?item=ikki.html ● Is it possible to identify cookies used by the web application for the dynamic generation of pages or templates? Cookie: ID=d9ccd3f4f9f18cc1:T- M=2166255468:LM=1162655568:S=3cFpqbJgMSSPKVMV:- TEMPLATE=flower Cookie: USER=1826cc8f:PSTYLE=GreenDotRed
  • 18. Testing Directory traversal/file include (OTG-AUTHZ-001): Testing Techniques ● Insert the malicious string “../../../../” to include the password hash file for a Linux/Unix or boot.ini for Windows system – http://example.com/getUserProfile.jsp? item=../../../../etc/passwd ● For the cookies example: – Cookie: USER=1826cc8f:PSTYLE=../../../../etc/passwd ● Try to include files and scripts located on external website. – http://example.com/index.php? file=http://www.owasp.org/malicioustxt ● Try to show the source code of a CGI component – http://example.com/main.cgi?home=main.cgi
  • 19. Testing Directory traversal/file include (OTG-AUTHZ-001): Testing Techniques If “../” does not work, try character encoding such as URL encoding, double URL encoding, Unicode/UTF-8 encoding Encoding Test with Represent URL %2e%2e%2f ../ %2e%2e/ ../ ..%2f ../ %2e%2e%5c .. %2e%2e .. ..%5c .. Double URL %252e%252e%255c .. ..%255c .. Unicode/UTF-8 ..%c0%af ../ ..%c1%9c ..
  • 20. Testing Directory traversal/file include (OTG-AUTHZ-001): Testing Tools ● DotDotPwn - The Directory Traversal Fuzzer - http://dotdotpwn.sectester.net ● Path Traversal Fuzz Strings (from WFuzz Tool) - http://code.google.com/p/wfuzz/source/brows e/trunk/wordlist/Injections/Traversal.txt ● Web Proxy (Burp Suite, Paros, WebScarab,OWASP: Zed Attack Proxy (ZAP)) ● Encoding/Decoding tools
  • 21. Testing Other Authorization (OTG-AUTHZ-002 to 004): Prerequisite ● Needs to map out all locations in the application where user input is used to reference objects directly. – A database row – A file – Application pages ● Having at least two (often more) users to cover different owned objects and functions – Users each having access to different objects (such as purchase information, private messages, etc.) – Users with different privileges (for example administrator users) to see whether there are direct references to application functionality
  • 22. Testing for Bypassing Authorization Schema (OTG-AUTHZ-002): Summary ● Focus on verifying how the authorization schema has been implemented for each role or privilege to get access to reserved functions and resources. ● States to verify – User is not authenticated – After the log-out – User that holds a different role or privilege ● Track all the administrative functions when: – Logging as a user with standard privileges – Logging as a user with a different role and for whom that action should be denied
  • 23. Testing for Bypassing Authorization Schema (OTG-AUTHZ-002): How to test ● Testing for access to administrative functions – Example, Try to post to administrator's “adduser” when logging on as non-administrative roles ● Testing for access to resources assigned to a different role – Example, analyze an application that uses a shared directory
  • 24. Testing for Privilege escalation (OTG- AUTHZ-003): Summary ● Verify that it is not possible for a user to modify his or her privileges or roles inside the application ● Privilege escalation occurs when a user gets access to more resources or functionality than they are normally allowed ● The degree of escalation depends on what privileges the attacker is authorized to possess, and what privileges can be obtained in a successful exploit ● Vertical escalation – access resources granted to more privileged accounts (e.g., acquiring administrative privileges for the application) ● Horizontal escalation – access resources granted to a similarly configured account (e.g., in an online banking application, accessing information related to a different user)
  • 25. Testing for Privilege escalation (OTG- AUTHZ-003): How to test POST /user/viewOrder.jsp HTTP/1.1 Host: www.example.com ... groupID=grp001&orderID=0001 This POST allows the user that belongs to grp001 to access order #0001, logon with a user that does not belong to grp001 then intercept the post & try to modify the parameters to gain access privileged data
  • 26. Testing for Privilege escalation (OTG- AUTHZ-003): How to test HTTP/1.1 200 OK Server: Netscape-Enterprise/6.0 Date: Wed, 1 Apr 2006 13:51:20 GMT Set-Cookie: USER=aW78ryrGrTWs4MnOd32Fs51yDqp; path=/; domain=www.example.com Set-Cookie: SESSION=k+KmKeHXTgDi1J5fT7Zz; path=/; domain= www.example.com Cache-Control: no-cache Pragma: No-cache Content-length: 247 Content-Type: text/html Expires: Thu, 01 Jan 1970 00:00:00 GMT Connection: close <form name="autoriz" method="POST" action = "visual.jsp"> <input type="hidden" name="profile" value="SysAdmin"> <body onload="document.forms.autoriz.submit()"> </td> </tr> This HTML shows a hidden field to the user after a successful administrative user authentication. Logon with another non-administrative user and modify the value of the variable "profile" to "SysAdmin"? Is it possible to become administrator?
  • 27. Testing for Insecure Direct Object References (OTG-AUTHZ-004): Scenarios ● Retrieve a database record – http://foo.bar/somepage?invoice=12345 ● Perform an operation in the application – http://foo.bar/changepassword?user=someuser ● Retrieve a file system resource – http://foo.bar/showImage?img=img00011 ● Access application functionality – http://foo.bar/accessPage?menuitem=12
  • 28. Testing for Insecure Direct Object References (OTG-AUTHZ-004): Where to Look for ● URL Query String ● Cookie (HTTP Header) ● Request Body (Post Method) – Query String – XML SOAP Interface – JSON Document ● Check Web URL, Web Forms, AJAX Communication, Mobile HTTP Request and Web Service
  • 29. Common Tools for Authorization Testing ● Web Proxy (Burp Suite, Paros, WebScarab,OWASP: Zed Attack Proxy (ZAP))
  • 30. Recap ● Insecure direct object references occur when an application exposes internal references to objects via parameters passed to the application ● To guard against: – Do not expose internal keys or identifiers for objects – Use object references that are challenging to guess – Perform server-side authorization checks before object accesses (strongly recommend)
  • 31. References • OWASP – OWASP Top 10 2010-A4-Insecure Direct Object References – ESAPI Access Reference Map – ESAPI Access Control API (See isAuthorizedForData(), isAuthorizedForFile(), isAuthorizedForFunction()) • External – CWE Entry 639 on Insecure Direct Object Reference – CWE Entry 22 on Path Traversal (an example of a Direct Object Reference attack)