SlideShare a Scribd company logo
CNIT 129S: Securing
Web Applications
Ch 1: Web Application (In)security
Updated 1-19-21
Web Applications
• E-commerce, Social networks, Online
banking, etc
.

• Fundamental security problem
:

• Users can supply arbitrary inpu
t

• Malicious input can compromise the site
Static Website: Web 1.0
• Information
fl
ows 

one-wa
y

• Users don't log in, 

shop, or submit comment
s

• An attacker who exploits
fl
aws in the Web
server software ca
n

• Steal data on the Web server (usually
only public data anyway
)

• Deface the site
Modern Web App
• Two-way 

information
fl
o
w

• Users log in, 

submit conten
t

• Content dynamically generated and tailored for
each use
r

• Much data is sensitive and private (e.g.
passwords
)

• Most apps developed in-hous
e

• Developers often naive about security
Common Web App
Functions
• Shopping (Amazon)
 

• Social networking (Facebook)
 

• Banking (Citibank)
 

• Web search (Google)
 

• Auctions (eBay)
 

• Gambling (Betfair)
 

• Web logs (Blogger)
 

• Web mail (Gmail)
 

• Interactive information (Wikipedia)
Internal Web Apps


("Cloud" Services)
• HR -- payroll information, performance review
s

• Admin interfaces to servers, VMs, workstation
s

• Collaboration software (SharePoint
)

• Enterprise Resource Planning (ERP
)

• Email web interfaces (Outlook Web Access
)

• Of
fi
ce apps (Google Apps, MS Of
fi
ce Live)
Bene
fi
ts of Web Apps
• HTTP is lightweight and connectionles
s

• Resilient in event of communications error
s

• Can be proxied and tunneled over other
protocol
s

• Web browsers run on many devices, highly
functional, easy to us
e

• Many platforms and development tools available
Web App Security
• Breaches are commo
n

• Attackers gets sensitive data, possibly
complete control of back-end system
s

• Denial of Service at Application Level
This Site is Secure
• A frequent claim, very far from the truth
100%
Secure
Online
Voting
• Link Ch 1b
Study by Text Authors
SinVR Hack
• Unauthenticated request allows anyone to download
PII from users


• Link Ch 1f
PII
• Link Ch 1c
• Link Ch 1d
The Core Security Problem
• Users can submit arbitrary inpu
t

• Alter parameters, cookies, HTTP header
s

• Client-side controls can't be truste
d

• Developers must assume all input is
maliciou
s

• Attackers have attack tools like Burp; they are
not restricted to using browsers
Possible Attacks
• Change the price of an ite
m

• Modify a session token to enter another user's
accoun
t

• Remove parameters to exploit logic
fl
aw
s

• SQL injectio
n

• SSL doesn't stop any of these
Key Problem Factors
• Underdeveloped security awarenes
s

• Custom developmen
t

• Deceptive simplicit
y

• Easy to make a website, but hard to secure i
t

• Rapidly evolving threat pro
fi
l
e

• Resource and time constraint
s

• Overextended technologie
s

• Increasing demands on functionality
The New Security Perimeter
• Edge
fi
rewalls and "bastion hosts" are no longer
enoug
h

• Keeping the attacker out of critical system
s

• Customers can now send transactions to servers
holding private dat
a

• Via the Web ap
p

• Web app must act as a security barrie
r

• Often it includes components from others, like
widget
s

• Errors by other companies can compromise your
servers
• Attackers can attack users instead of server
s

• XSS, drive-by downloads, etc
.

• E-mail used for password recover
y

• A compromised email account exposes many
other services also
The New Security Perimeter
The Future
• Some vulnerabilities
are decreasin
g

• #1 security
measure:
UPDATE
S

• Logic
fl
aws and
failure to use
controls properly are
not decreasin
g

• Link Ch 1e
Ch 1
CNIT 129S: Securing
Web Applications
Ch 2: Core Defense Mechanisms
Core Defense Elements
• Limiting user access to app's data and
functionalit
y

• Limiting user input to prevent exploits that use
malformed inpu
t

• Frustrating attackers with appropriate behavior
when targete
d

• Administrative monitoring and con
fi
guring the
application
Handling User Access
• Authenticatio
n

• Session managemen
t

• Access Control
Authentication
• Username and password is most common
metho
d

• Better: additional credentials and multistage
logi
n

• Best: client certi
fi
cates, smart cards, challenge-
response token
s

• Also: self-registration, account recovery,
password change
Common Login Problems
• Predictable username
s

• Password that can be guesse
d

• Defects in logic
Session Management
• Session: a set of data structures that track the
state of the use
r

• A token identi
fi
es the session, usually a cooki
e

• Can also use hidden form
fi
elds or the URL
query strin
g

• Sessions expire
Common Session Problems
• Tokens are predictable (not random
)

• Tokens poorly handled, so an attacker can
capture another user's token
Access Control
• Each request must be permitted or denie
d

• Multiple roles within applicatio
n

• Frequent logic errors and
fl
awed assumptions
Handling User Input
• "Input Validation" is the most common solution
Types of Input
• Arbitrary text, like blog post
s

• Cookie
s

• Hidden form
fi
eld
s

• Parameter
s

• HTTP header
fi
elds, like User-Agent
"Reject Known Bad"
• Also called "blacklisting
"

• Least effective metho
d

• Dif
fi
cult to identify all bad inputs
"Accept Known Good"
• Also called "whitelisting
"

• Most effective technique, where feasibl
e

• However, sometimes you can't do i
t

• Human names really contain apostrophes, so
you can't
fi
lter them out
Sanitization
• Render dangerous input harmles
s

• HTML-Encoding: Space becomes %20, etc
.

• Dif
fi
cult if several kinds of data may be present
within an item of inpu
t

• Boundary validation is better (four slides
ahead)
Safe Data Handling
• Write code that can't be fooled by malicious
dat
a

• SQL parameterized querie
s

• Don't pass user input to an OS command lin
e

• Effective when it can be applied
Semantic Checks
• Some malicious input is identical to valid inpu
t

• Such as changing an account number to
another customer's number
 

• Data must be validated in contex
t

• Does this account number being to the
currently logged-in user?
Dif
fi
culties with Simple Input
Validation
• Data coming from user is "bad" or "untrusted
"

• The server-side app is "good" and truste
d

• Many different types of input with different
fi
ltering
requirement
s

• Apps may chain several processing steps togethe
r

• Data may be harmless at one stage, but be
transformed into harmful data at another stage
Boundary Validation
• Trust boundar
y

• Divides a trusted zone from an untrusted zon
e

• Clean data that passes a boundar
y

• Such as from the user into an application
Boundary Validation
• Each component treats its input as potentially
maliciou
s

• Data validation performed at each trust
boundar
y

• Not just between client and server
Example
Example SOAP Request
• Link Ch 2a
• 1. App gets login: username and passwor
d

• Allows only good characters, limits length,
removes known attack signature
s

• 2. App performs a SQL query to verify
credential
s

• Escape dangerous characters
Boundary Validation Example
Boundary Validation Example
• 3. Login succeeds; app passes data from user
pro
fi
le to a SOAP servic
e

• XML metacharacters are encoded to block
SOAP injectio
n

• 4. App displays user's account information back
to the user's browse
r

• User-supplied data is HTML-encoded to block
XSS
Filtering Problems
• App removes this string
:

• <script
>

• So attacker sends thi
s

• <scr<script>ipt>
Multistep Validation
• App
fi
rst removes
 

../


• Then remove
s

..


• Attacker send
s

..../
Canonicalization
• App gets URL-encoded data from Web browse
r

• Apostrophe is %2
7

• Percent is %2
5

• To block apostrophes, app
fi
lters %2
7

• But URL is decoded twice by mistak
e

• %2527 becomes %27 becomes apostrophe
Handling Attackers
• Handling error
s

• Maintaining audit log
s

• Alerting administrator
s

• Reacting to attacks
Handling Errors
• Show appropriate error message
s

• Unhandled errors lead to overly-informative
error messages like this
Audit Logs
• Authentication events: login success and
failure, change of passwor
d

• Key transactions, such as credit card payment
s

• Access attempts that are blocked by access
control mechanism
s

• Requests containing known attack string
s

• For high security, log every client request in full
Protecting Logs
• Logs should contain time, IP addresses, and
usernam
e

• May contain cookies and other sensitive dat
a

• Attackers will try to erase and/or read log
s

• Log must be protecte
d

• Place on an autonomous system that only
accepts update message
s

• Flush logs to write-once media
Alerting Administrators
• Usage anomalies, like a large number of
requests from the same IP address or use
r

• Business anomalies, such as a large number of
funds transfers to/from the same accoun
t

• Requests containing known attack string
s

• Requests where hidden data has been modi
fi
ed
Firewalls
• Web App Firewalls can detect generic attack
s

• But not subtle ones that are speci
fi
c to your
ap
p

• Most effective security control is integrated with
app's input validation mechanism
s

• Check for valid values of your parameters
Reacting to Attacks
• Attackers probe for vulnerabilitie
s

• Sending many similar request
s

• Automated defense
s

• Respond increasingly slowly to request
s

• Terminate the attacker's session
Managing the Application
• Management interface allows administrator to
control user accounts, roles, access monitoring,
auditing, etc.
Attacking the Administration
Panel
• Defeat weak authenticatio
n

• Some administrative functions might not require
high privilege
s

• XSS
fl
aws can allow cookie theft and session
hijacking
Ch 2

More Related Content

What's hot

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 API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World
42Crunch
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)
TzahiArabov
 
CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2
Sam Bowne
 
SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
n|u - The Open Security Community
 
CNIT 123 Ch 10: Hacking Web Servers
CNIT 123 Ch 10: Hacking Web ServersCNIT 123 Ch 10: Hacking Web Servers
CNIT 123 Ch 10: Hacking Web Servers
Sam Bowne
 
CNIT 129S: 8: Attacking Access Controls
CNIT 129S: 8: Attacking Access ControlsCNIT 129S: 8: Attacking Access Controls
CNIT 129S: 8: Attacking Access Controls
Sam Bowne
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
Anurag Srivastava
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsCh 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Sam Bowne
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
Sam Bowne
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
n|u - The Open Security Community
 
Hacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdfHacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdf
Matt Tesauro
 
Web Application Security and Awareness
Web Application Security and AwarenessWeb Application Security and Awareness
Web Application Security and Awareness
Abdul Rahman Sherzad
 
Broken access controls
Broken access controlsBroken access controls
Broken access controls
Akansha Kesharwani
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Xss attack
Xss attackXss attack
Xss attack
Manjushree Mashal
 
Ch 9 Attacking Data Stores (Part 2)
Ch 9 Attacking Data Stores (Part 2)Ch 9 Attacking Data Stores (Part 2)
Ch 9 Attacking Data Stores (Part 2)
Sam Bowne
 
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
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
bilcorry
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
Mohammed Danish Amber
 

What's hot (20)

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 API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)
 
CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2
 
SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
 
CNIT 123 Ch 10: Hacking Web Servers
CNIT 123 Ch 10: Hacking Web ServersCNIT 123 Ch 10: Hacking Web Servers
CNIT 123 Ch 10: Hacking Web Servers
 
CNIT 129S: 8: Attacking Access Controls
CNIT 129S: 8: Attacking Access ControlsCNIT 129S: 8: Attacking Access Controls
CNIT 129S: 8: Attacking Access Controls
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsCh 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Hacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdfHacking and Defending APIs - Red and Blue make Purple.pdf
Hacking and Defending APIs - Red and Blue make Purple.pdf
 
Web Application Security and Awareness
Web Application Security and AwarenessWeb Application Security and Awareness
Web Application Security and Awareness
 
Broken access controls
Broken access controlsBroken access controls
Broken access controls
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
Xss attack
Xss attackXss attack
Xss attack
 
Ch 9 Attacking Data Stores (Part 2)
Ch 9 Attacking Data Stores (Part 2)Ch 9 Attacking Data Stores (Part 2)
Ch 9 Attacking Data Stores (Part 2)
 
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)
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 

Similar to Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms

Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking Authentication
Sam Bowne
 
CNIT 129S: 11: Attacking Application Logic
CNIT 129S: 11: Attacking Application LogicCNIT 129S: 11: Attacking Application Logic
CNIT 129S: 11: Attacking Application Logic
Sam Bowne
 
CNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session ManagementCNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session Management
Sam Bowne
 
CNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking Authentication
Sam Bowne
 
Ch 7: Attacking Session Management
Ch 7: Attacking Session ManagementCh 7: Attacking Session Management
Ch 7: Attacking Session Management
Sam Bowne
 
Ch 13: Attacking Users: Other Techniques (Part 2)
Ch 13: Attacking Users: Other Techniques (Part 2)Ch 13: Attacking Users: Other Techniques (Part 2)
Ch 13: Attacking Users: Other Techniques (Part 2)
Sam Bowne
 
CNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking Authentication
Sam Bowne
 
Complete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIsComplete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIs
Xing (Xingheng) Wang
 
Web authentication
Web authenticationWeb authentication
Web authentication
Pradeep J V
 
CNIT 129S Ch 4: Mapping the Application
CNIT 129S Ch 4: Mapping the ApplicationCNIT 129S Ch 4: Mapping the Application
CNIT 129S Ch 4: Mapping the Application
Sam Bowne
 
E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)
E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)
E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)
Shandy Aditya
 
Web security uploadv1
Web security uploadv1Web security uploadv1
Web security uploadv1
Setia Juli Irzal Ismail
 
Cybercrime
CybercrimeCybercrime
Cybercrime
deepika28g
 
Threats
ThreatsThreats
Threats of Database in ECommerce
Threats of Database in ECommerceThreats of Database in ECommerce
Threats of Database in ECommerce
Mentalist Akram
 
Ch 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side ControlsCh 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side Controls
Sam Bowne
 
Lock it Down: Access Control for IBM i
Lock it Down: Access Control for IBM iLock it Down: Access Control for IBM i
Lock it Down: Access Control for IBM i
Precisely
 
Introduction to Web Security
Introduction to Web SecurityIntroduction to Web Security
Introduction to Web Security
Kamil Lelonek
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Michael Pirnat
 
CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management
Sam Bowne
 

Similar to Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms (20)

Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking Authentication
 
CNIT 129S: 11: Attacking Application Logic
CNIT 129S: 11: Attacking Application LogicCNIT 129S: 11: Attacking Application Logic
CNIT 129S: 11: Attacking Application Logic
 
CNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session ManagementCNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session Management
 
CNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking Authentication
 
Ch 7: Attacking Session Management
Ch 7: Attacking Session ManagementCh 7: Attacking Session Management
Ch 7: Attacking Session Management
 
Ch 13: Attacking Users: Other Techniques (Part 2)
Ch 13: Attacking Users: Other Techniques (Part 2)Ch 13: Attacking Users: Other Techniques (Part 2)
Ch 13: Attacking Users: Other Techniques (Part 2)
 
CNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking Authentication
 
Complete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIsComplete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIs
 
Web authentication
Web authenticationWeb authentication
Web authentication
 
CNIT 129S Ch 4: Mapping the Application
CNIT 129S Ch 4: Mapping the ApplicationCNIT 129S Ch 4: Mapping the Application
CNIT 129S Ch 4: Mapping the Application
 
E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)
E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)
E-Commerce Chap 5: E-COMMERCE SECURITY AND PAYMENT SYSTEMS (D3 B 2018)
 
Web security uploadv1
Web security uploadv1Web security uploadv1
Web security uploadv1
 
Cybercrime
CybercrimeCybercrime
Cybercrime
 
Threats
ThreatsThreats
Threats
 
Threats of Database in ECommerce
Threats of Database in ECommerceThreats of Database in ECommerce
Threats of Database in ECommerce
 
Ch 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side ControlsCh 5: Bypassing Client-Side Controls
Ch 5: Bypassing Client-Side Controls
 
Lock it Down: Access Control for IBM i
Lock it Down: Access Control for IBM iLock it Down: Access Control for IBM i
Lock it Down: Access Control for IBM i
 
Introduction to Web Security
Introduction to Web SecurityIntroduction to Web Security
Introduction to Web Security
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
 
CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management
 

More from Sam Bowne

Cyberwar
CyberwarCyberwar
Cyberwar
Sam Bowne
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
Sam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
Sam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
Sam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
Sam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
10 RSA
10 RSA10 RSA
10 RSA
Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
Sam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
Sam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
Sam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
Sam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
Sam Bowne
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
Sam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 

Recently uploaded

Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Vivekanand Anglo Vedic Academy
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 

Recently uploaded (20)

Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDFLifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
Lifelines of National Economy chapter for Class 10 STUDY MATERIAL PDF
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 

Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms

  • 1. CNIT 129S: Securing Web Applications Ch 1: Web Application (In)security Updated 1-19-21
  • 2. Web Applications • E-commerce, Social networks, Online banking, etc . • Fundamental security problem : • Users can supply arbitrary inpu t • Malicious input can compromise the site
  • 3. Static Website: Web 1.0 • Information fl ows 
 one-wa y • Users don't log in, 
 shop, or submit comment s • An attacker who exploits fl aws in the Web server software ca n • Steal data on the Web server (usually only public data anyway ) • Deface the site
  • 4. Modern Web App • Two-way 
 information fl o w • Users log in, 
 submit conten t • Content dynamically generated and tailored for each use r • Much data is sensitive and private (e.g. passwords ) • Most apps developed in-hous e • Developers often naive about security
  • 5. Common Web App Functions • Shopping (Amazon) • Social networking (Facebook) • Banking (Citibank) • Web search (Google) • Auctions (eBay) • Gambling (Betfair) • Web logs (Blogger) • Web mail (Gmail) • Interactive information (Wikipedia)
  • 6. Internal Web Apps ("Cloud" Services) • HR -- payroll information, performance review s • Admin interfaces to servers, VMs, workstation s • Collaboration software (SharePoint ) • Enterprise Resource Planning (ERP ) • Email web interfaces (Outlook Web Access ) • Of fi ce apps (Google Apps, MS Of fi ce Live)
  • 7. Bene fi ts of Web Apps • HTTP is lightweight and connectionles s • Resilient in event of communications error s • Can be proxied and tunneled over other protocol s • Web browsers run on many devices, highly functional, easy to us e • Many platforms and development tools available
  • 8. Web App Security • Breaches are commo n • Attackers gets sensitive data, possibly complete control of back-end system s • Denial of Service at Application Level
  • 9. This Site is Secure • A frequent claim, very far from the truth
  • 11. Study by Text Authors
  • 12. SinVR Hack • Unauthenticated request allows anyone to download PII from users • Link Ch 1f
  • 13. PII
  • 14.
  • 17. The Core Security Problem • Users can submit arbitrary inpu t • Alter parameters, cookies, HTTP header s • Client-side controls can't be truste d • Developers must assume all input is maliciou s • Attackers have attack tools like Burp; they are not restricted to using browsers
  • 18. Possible Attacks • Change the price of an ite m • Modify a session token to enter another user's accoun t • Remove parameters to exploit logic fl aw s • SQL injectio n • SSL doesn't stop any of these
  • 19. Key Problem Factors • Underdeveloped security awarenes s • Custom developmen t • Deceptive simplicit y • Easy to make a website, but hard to secure i t • Rapidly evolving threat pro fi l e • Resource and time constraint s • Overextended technologie s • Increasing demands on functionality
  • 20. The New Security Perimeter • Edge fi rewalls and "bastion hosts" are no longer enoug h • Keeping the attacker out of critical system s • Customers can now send transactions to servers holding private dat a • Via the Web ap p • Web app must act as a security barrie r • Often it includes components from others, like widget s • Errors by other companies can compromise your servers
  • 21. • Attackers can attack users instead of server s • XSS, drive-by downloads, etc . • E-mail used for password recover y • A compromised email account exposes many other services also The New Security Perimeter
  • 22. The Future • Some vulnerabilities are decreasin g • #1 security measure: UPDATE S • Logic fl aws and failure to use controls properly are not decreasin g • Link Ch 1e
  • 23. Ch 1
  • 24. CNIT 129S: Securing Web Applications Ch 2: Core Defense Mechanisms
  • 25. Core Defense Elements • Limiting user access to app's data and functionalit y • Limiting user input to prevent exploits that use malformed inpu t • Frustrating attackers with appropriate behavior when targete d • Administrative monitoring and con fi guring the application
  • 26. Handling User Access • Authenticatio n • Session managemen t • Access Control
  • 27. Authentication • Username and password is most common metho d • Better: additional credentials and multistage logi n • Best: client certi fi cates, smart cards, challenge- response token s • Also: self-registration, account recovery, password change
  • 28.
  • 29. Common Login Problems • Predictable username s • Password that can be guesse d • Defects in logic
  • 30. Session Management • Session: a set of data structures that track the state of the use r • A token identi fi es the session, usually a cooki e • Can also use hidden form fi elds or the URL query strin g • Sessions expire
  • 31. Common Session Problems • Tokens are predictable (not random ) • Tokens poorly handled, so an attacker can capture another user's token
  • 32. Access Control • Each request must be permitted or denie d • Multiple roles within applicatio n • Frequent logic errors and fl awed assumptions
  • 33. Handling User Input • "Input Validation" is the most common solution
  • 34. Types of Input • Arbitrary text, like blog post s • Cookie s • Hidden form fi eld s • Parameter s • HTTP header fi elds, like User-Agent
  • 35. "Reject Known Bad" • Also called "blacklisting " • Least effective metho d • Dif fi cult to identify all bad inputs
  • 36. "Accept Known Good" • Also called "whitelisting " • Most effective technique, where feasibl e • However, sometimes you can't do i t • Human names really contain apostrophes, so you can't fi lter them out
  • 37. Sanitization • Render dangerous input harmles s • HTML-Encoding: Space becomes %20, etc . • Dif fi cult if several kinds of data may be present within an item of inpu t • Boundary validation is better (four slides ahead)
  • 38. Safe Data Handling • Write code that can't be fooled by malicious dat a • SQL parameterized querie s • Don't pass user input to an OS command lin e • Effective when it can be applied
  • 39. Semantic Checks • Some malicious input is identical to valid inpu t • Such as changing an account number to another customer's number • Data must be validated in contex t • Does this account number being to the currently logged-in user?
  • 40. Dif fi culties with Simple Input Validation • Data coming from user is "bad" or "untrusted " • The server-side app is "good" and truste d • Many different types of input with different fi ltering requirement s • Apps may chain several processing steps togethe r • Data may be harmless at one stage, but be transformed into harmful data at another stage
  • 41. Boundary Validation • Trust boundar y • Divides a trusted zone from an untrusted zon e • Clean data that passes a boundar y • Such as from the user into an application
  • 42. Boundary Validation • Each component treats its input as potentially maliciou s • Data validation performed at each trust boundar y • Not just between client and server
  • 45. • 1. App gets login: username and passwor d • Allows only good characters, limits length, removes known attack signature s • 2. App performs a SQL query to verify credential s • Escape dangerous characters Boundary Validation Example
  • 46. Boundary Validation Example • 3. Login succeeds; app passes data from user pro fi le to a SOAP servic e • XML metacharacters are encoded to block SOAP injectio n • 4. App displays user's account information back to the user's browse r • User-supplied data is HTML-encoded to block XSS
  • 47. Filtering Problems • App removes this string : • <script > • So attacker sends thi s • <scr<script>ipt>
  • 48. Multistep Validation • App fi rst removes ../ • Then remove s .. • Attacker send s ..../
  • 49. Canonicalization • App gets URL-encoded data from Web browse r • Apostrophe is %2 7 • Percent is %2 5 • To block apostrophes, app fi lters %2 7 • But URL is decoded twice by mistak e • %2527 becomes %27 becomes apostrophe
  • 50. Handling Attackers • Handling error s • Maintaining audit log s • Alerting administrator s • Reacting to attacks
  • 51. Handling Errors • Show appropriate error message s • Unhandled errors lead to overly-informative error messages like this
  • 52. Audit Logs • Authentication events: login success and failure, change of passwor d • Key transactions, such as credit card payment s • Access attempts that are blocked by access control mechanism s • Requests containing known attack string s • For high security, log every client request in full
  • 53. Protecting Logs • Logs should contain time, IP addresses, and usernam e • May contain cookies and other sensitive dat a • Attackers will try to erase and/or read log s • Log must be protecte d • Place on an autonomous system that only accepts update message s • Flush logs to write-once media
  • 54. Alerting Administrators • Usage anomalies, like a large number of requests from the same IP address or use r • Business anomalies, such as a large number of funds transfers to/from the same accoun t • Requests containing known attack string s • Requests where hidden data has been modi fi ed
  • 55. Firewalls • Web App Firewalls can detect generic attack s • But not subtle ones that are speci fi c to your ap p • Most effective security control is integrated with app's input validation mechanism s • Check for valid values of your parameters
  • 56. Reacting to Attacks • Attackers probe for vulnerabilitie s • Sending many similar request s • Automated defense s • Respond increasingly slowly to request s • Terminate the attacker's session
  • 57. Managing the Application • Management interface allows administrator to control user accounts, roles, access monitoring, auditing, etc.
  • 58. Attacking the Administration Panel • Defeat weak authenticatio n • Some administrative functions might not require high privilege s • XSS fl aws can allow cookie theft and session hijacking
  • 59. Ch 2