SlideShare a Scribd company logo
1 of 59
Download to read offline
CNIT 129S: Securing
Web Applications
Ch 1: Web Application (In)security
Updated 1-17-18
Web Applications
• E-commerce, Social networks, Online
banking, etc.
• Fundamental security problem:
• Users can supply arbitrary input
• Malicious input can compromise the site
Static Website: Web 1.0
• Information flows 

one-way
• Users don't log in, shop, 

or submit comments
• An attacker who exploits flaws in the Web server
software can
• Steal data on the Web server (usually only
public data anyway)
• Deface the site
Modern Web App
• Two-way 

information flow
• Users log in, 

submit content
• Content dynamically generated and tailored for
each user
• Much data is sensitive and private (e.g. passwords)
• Most apps developed in-house
• 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 reviews
• Admin interfaces to servers, VMs, workstations
• Collaboration software (SharePoint)
• Enterprise Resource Planning (ERP)
• Email web interfaces (Outlook Web Access)
• Office apps (Google Apps, MS Office Live)
Benefits of Web Apps
• HTTP is lightweight and connectionless
• Resilient in event of communications errors
• Can be proxied and tunneled over other
protocols
• Web browsers run on many devices, highly
functional, easy to use
• Many platforms and development tools available
Web App Security
• Breaches are common
• Attackers gets sensitive data, possibly
complete control of back-end systems
• Denial of Service at Application Level
This Site is Secure
100%
Secure
Online
Voting
• Link Ch 1b
Study by Text Authors
SinVR Hack
• Unauthenticated request
• Link Ch 1f
• Link Ch 1c
• Link Ch 1d
The Core Security Problem
• Users can submit arbitrary input
• Alter parameters, cookies, HTTP headers
• Client-side controls can't be trusted
• Developers must assume all input is
malicious
• Attackers have attack tools like Burp; they are
not restricted to using browsers
Possible Attacks
• Change the price of an item
• Modify a session token to enter another user's
account
• Remove parameters to exploit logic flaws
• SQL injection
• SSL doesn't stop any of these
Key Problem Factors
• Underdeveloped Security Awareness
• Custom Development
• Deceptive Simplicity
• Easy to make a website, but hard to secure it
• Rapidly Evolving Threat Profile
• Resource and Time Constraints
• Overextended Technologies
• Increasing Demands on Functionality
The New Security Perimeter
• Edge firewalls and "bastion hosts" are no longer enough
• Keeping the attacker out of critical systems
• Customers can now send transactions to servers
holding private data
• Via the Web app
• Web app must act as a security barrier
• Often it includes components from others, like widgets
• Errors by other companies can compromise your
servers
• Attackers can attack users instead of servers
• XSS, drive-by downloads, etc.
• E-mail used for password recovery
• A compromised email account exposes many
other services also
The New Security Perimeter
The Future
• Some vulnerabilities
are decreasing
• #1 security
measure: UPDATES
• Logic flaws and
failure to use controls
properly are not
decreasing
• Link Ch 1e
CNIT 129S: Securing
Web Applications
Ch 2: Core Defense Mechanisms
Core Defense Elements
• Limiting user access to app's data and
functionality
• Limiting user input to prevent exploits that use
malformed input
• Frustrating attackers with appropriate behavior
when targeted
• Administrative monitoring and configuring the
application
Handling User Access
• Authentication
• Session management
• Access Control
Authentication
• Username and password is most common
method
• Better: additional credentials and multistage
login
• Best: client certificates, smart cards, challenge-
response tokens
• Also: self-registration, account recovery,
password change
Common Login Problems
• Predictable usernames
• Password that can be guessed
• Defects in logic
Session Management
• Session: a set of data structures that track the state of
the user
• A token identifies the session, usually a cookie
• Can also use hidden form fields or the URL query
string
• 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 denied
• Multiple roles within application
• Frequent logic errors and flawed assumptions
Handling User Input
• "Input Validation" is the most common solution
Types of Input
• Arbitrary text, like blog posts
• Cookies
• Hidden form fields
• Parameters
• HTTP header fields, like User-Agent
"Reject Known Bad"
• Also called "blacklisting"
• Least effective method
• Difficult to identify all bad inputs
"Accept Known Good"
• Also called "whitelisting"
• Most effective technique, where feasible
• However, sometimes you can't do it
• Human names really contain apostrophes, so
you can't filter them out
Sanitization
• Render dangerous input harmless
• HTML-Encoding: Space becomes %20, etc.
• Difficult if several kinds of data may be present
within an item of input
• Boundary validation is better (four slides
ahead)
Safe Data Handling
• Write code that can't be fooled by malicious
data
• SQL parameterized queries
• Don't pass user input to an OS command line
• Effective when it can be applied
Semantic Checks
• Some malicious input is identical to valid input
• Such as changing an account number to
another customer's number
• Data must be validated in context
• Does this account number being to the
currently logged-in user?
Difficulties with Simple Input
Validation
• Data coming from user is "bad" or "untrusted"
• The server-side app is "good" and trusted
• Many different types of input with different filtering
requirements
• Apps may chain several processing steps together
• Data may be harmless at one stage, but be
transformed into harmful data at another stage
Boundary Validation
• Trust boundary
• Divides a trusted zone from an untrusted zone
• Clean data that passes a boundary
• Such as from the user into an application
Boundary Validation
• Each component treats its input as potentially
malicious
• Data validation performed at each trust
boundary
• Not just between client and server
Example
Example SOAP Request
• Link Ch 2a
Boundary Validation
Example
• 1. App gets login: username and password
• Allows only good characters, limits length,
removes known attack signatures
• 2. App performs a SQL query to verify
credentials
• Escape dangerous characters
Boundary Validation
Example
• 3. Login succeeds; app passes data from user
profile to a SOAP service
• XML metacharacters are encoded to block
SOAP injection
• 4. App displays user's account information back
to the user's browser
• User-supplied data is HTML-encoded to block
XSS
Filtering Problems
• App removes this string:
• <script>
• So attacker sends this
• <scr<script>ipt>
Multistep Validation
• App first removes
../
• Then removes
..
• Attacker sends
..../
Canonicalization
• App gets URL-encoded data from Web browser
• Apostrophe is %27
• Percent is %25
• To block apostrophes, app filters %27
• But URL is decoded twice by mistake
• %2527 becomes %27 becomes apostrophe
Handling Attackers
• Handling errors
• Maintaining audit logs
• Alerting administrators
• Reacting to attacks
Handling Errors
• Show appropriate error messages
• Unhanded errors lead to overly-informative
error messages like this
Audit Logs
• Authentication events: login success and
failure, change of password
• Key transactions, such as credit card payments
• Access attempts that are blocked by access
control mechanisms
• Requests containing known attack strings
• For high security, log every client request in full
Protecting Logs
• Logs should contain time, IP addresses, and username
• May contain cookies and other sensitive data
• Attackers will try to erase and/or read logs
• Log must be protected
• Place on an autonomous system that only accepts
update messages
• Flush logs to write-once media
Alerting Administrators
• Usage anomalies, like a large number of
requests from the same IP address or user
• Business anomalies, such as a large number of
funds transfers to/from the same account
• Requests containing known attack strings
• Requests where hidden data has been modified
Firewalls
• Web App Firewalls can detect generic attacks
• But not subtle ones that are specific to your
app
• Most effective security control is integrated with
app's input validation mechanisms
• Check for valid values of your parameters
Reacting to Attacks
• Attackers probe for vulnerabilities
• Sending many similar requests
• Automated defenses
• Respond increasingly slowly to requests
• 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 authentication
• Some administrative functions might not require
high privileges
• XSS flaws can allow cookie theft and session
hijacking
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms

More Related Content

What's hot

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-2Sam Bowne
 
CNIT 129S: 11: Attacking Application Logic
CNIT 129S: 11: Attacking Application LogicCNIT 129S: 11: Attacking Application Logic
CNIT 129S: 11: Attacking Application LogicSam Bowne
 
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 ApplicationSam Bowne
 
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)Sam Bowne
 
User authentication
User authenticationUser authentication
User authenticationCAS
 
Practical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-DisassemblyPractical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-DisassemblySam Bowne
 
x.509-Directory Authentication Service
x.509-Directory Authentication Servicex.509-Directory Authentication Service
x.509-Directory Authentication ServiceSwathy T
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTIONAnoop T
 
Authentication(pswrd,token,certificate,biometric)
Authentication(pswrd,token,certificate,biometric)Authentication(pswrd,token,certificate,biometric)
Authentication(pswrd,token,certificate,biometric)Ali Raw
 
Web Application Vulnerabilities
Web Application VulnerabilitiesWeb Application Vulnerabilities
Web Application VulnerabilitiesPreetish Panda
 
Secure electronic transaction
Secure electronic transactionSecure electronic transaction
Secure electronic transactionNishant Pahad
 
Kerberos : An Authentication Application
Kerberos : An Authentication ApplicationKerberos : An Authentication Application
Kerberos : An Authentication ApplicationVidulatiwari
 
Secure shell ppt
Secure shell pptSecure shell ppt
Secure shell pptsravya raju
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket LayerNaveen Kumar
 

What's hot (20)

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
 
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 4: Mapping the Application
CNIT 129S: Ch 4: Mapping the ApplicationCNIT 129S: Ch 4: Mapping the Application
CNIT 129S: Ch 4: Mapping the Application
 
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
 
Ipsec
IpsecIpsec
Ipsec
 
IP security
IP securityIP security
IP security
 
User authentication
User authenticationUser authentication
User authentication
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
Practical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-DisassemblyPractical Malware Analysis: Ch 15: Anti-Disassembly
Practical Malware Analysis: Ch 15: Anti-Disassembly
 
x.509-Directory Authentication Service
x.509-Directory Authentication Servicex.509-Directory Authentication Service
x.509-Directory Authentication Service
 
Password management
Password managementPassword management
Password management
 
Chapter- I introduction
Chapter- I introductionChapter- I introduction
Chapter- I introduction
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
 
Authentication(pswrd,token,certificate,biometric)
Authentication(pswrd,token,certificate,biometric)Authentication(pswrd,token,certificate,biometric)
Authentication(pswrd,token,certificate,biometric)
 
Web Application Vulnerabilities
Web Application VulnerabilitiesWeb Application Vulnerabilities
Web Application Vulnerabilities
 
Secure electronic transaction
Secure electronic transactionSecure electronic transaction
Secure electronic transaction
 
Kerberos : An Authentication Application
Kerberos : An Authentication ApplicationKerberos : An Authentication Application
Kerberos : An Authentication Application
 
Secure shell ppt
Secure shell pptSecure shell ppt
Secure shell ppt
 
Secure Socket Layer
Secure Socket LayerSecure Socket Layer
Secure Socket Layer
 
Authentication techniques
Authentication techniquesAuthentication techniques
Authentication techniques
 

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

CNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationSam Bowne
 
Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking AuthenticationSam 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 iPrecisely
 
Introduction to Web Security
Introduction to Web SecurityIntroduction to Web Security
Introduction to Web SecurityKamil Lelonek
 
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)Sam Bowne
 
Building an Identity Management Business Case
Building an Identity Management Business CaseBuilding an Identity Management Business Case
Building an Identity Management Business CaseHitachi ID Systems, Inc.
 
CNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationSam Bowne
 
Threats of Database in ECommerce
Threats of Database in ECommerceThreats of Database in ECommerce
Threats of Database in ECommerceMentalist Akram
 
Securing Applications in the Cloud
Securing Applications in the CloudSecuring Applications in the Cloud
Securing Applications in the CloudSecurity Innovation
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfnanangAris1
 
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 APIsXing (Xingheng) Wang
 
#MFSummit2016 Secure: Is your mainframe less secure than your fileserver
#MFSummit2016 Secure: Is your mainframe less secure than your fileserver#MFSummit2016 Secure: Is your mainframe less secure than your fileserver
#MFSummit2016 Secure: Is your mainframe less secure than your fileserverMicro Focus
 
Controlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and DataControlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and DataPrecisely
 
What Does a Full Featured Security Strategy Look Like?
What Does a Full Featured Security Strategy Look Like?What Does a Full Featured Security Strategy Look Like?
What Does a Full Featured Security Strategy Look Like?Precisely
 
CNIT 160 4e Security Program Management (Part 5)
CNIT 160 4e Security Program Management (Part 5)CNIT 160 4e Security Program Management (Part 5)
CNIT 160 4e Security Program Management (Part 5)Sam Bowne
 
OWASP TOP 10 by Team xbios
OWASP TOP 10  by Team xbiosOWASP TOP 10  by Team xbios
OWASP TOP 10 by Team xbiosVi Vek
 
Web authentication
Web authenticationWeb authentication
Web authenticationPradeep J V
 
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
 

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

CNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking Authentication
 
Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking Authentication
 
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
 
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
 
Building an Identity Management Business Case
Building an Identity Management Business CaseBuilding an Identity Management Business Case
Building an Identity Management Business Case
 
Web security uploadv1
Web security uploadv1Web security uploadv1
Web security uploadv1
 
CNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking Authentication
 
Threats
ThreatsThreats
Threats
 
Threats of Database in ECommerce
Threats of Database in ECommerceThreats of Database in ECommerce
Threats of Database in ECommerce
 
Securing Applications in the Cloud
Securing Applications in the CloudSecuring Applications in the Cloud
Securing Applications in the Cloud
 
Secure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdfSecure Coding BSSN Semarang Material.pdf
Secure Coding BSSN Semarang Material.pdf
 
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
 
#MFSummit2016 Secure: Is your mainframe less secure than your fileserver
#MFSummit2016 Secure: Is your mainframe less secure than your fileserver#MFSummit2016 Secure: Is your mainframe less secure than your fileserver
#MFSummit2016 Secure: Is your mainframe less secure than your fileserver
 
Controlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and DataControlling Access to IBM i Systems and Data
Controlling Access to IBM i Systems and Data
 
What Does a Full Featured Security Strategy Look Like?
What Does a Full Featured Security Strategy Look Like?What Does a Full Featured Security Strategy Look Like?
What Does a Full Featured Security Strategy Look Like?
 
CNIT 160 4e Security Program Management (Part 5)
CNIT 160 4e Security Program Management (Part 5)CNIT 160 4e Security Program Management (Part 5)
CNIT 160 4e Security Program Management (Part 5)
 
OWASP TOP 10 by Team xbios
OWASP TOP 10  by Team xbiosOWASP TOP 10  by Team xbios
OWASP TOP 10 by Team xbios
 
Web authentication
Web authenticationWeb authentication
Web authentication
 
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)
 

More from 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 SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam 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 CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam 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
 
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 3Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam 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 MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam 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 CiphersSam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam 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
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
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
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 

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-17-18
  • 2. Web Applications • E-commerce, Social networks, Online banking, etc. • Fundamental security problem: • Users can supply arbitrary input • Malicious input can compromise the site
  • 3. Static Website: Web 1.0 • Information flows 
 one-way • Users don't log in, shop, 
 or submit comments • An attacker who exploits flaws in the Web server software can • Steal data on the Web server (usually only public data anyway) • Deface the site
  • 4. Modern Web App • Two-way 
 information flow • Users log in, 
 submit content • Content dynamically generated and tailored for each user • Much data is sensitive and private (e.g. passwords) • Most apps developed in-house • 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 reviews • Admin interfaces to servers, VMs, workstations • Collaboration software (SharePoint) • Enterprise Resource Planning (ERP) • Email web interfaces (Outlook Web Access) • Office apps (Google Apps, MS Office Live)
  • 7. Benefits of Web Apps • HTTP is lightweight and connectionless • Resilient in event of communications errors • Can be proxied and tunneled over other protocols • Web browsers run on many devices, highly functional, easy to use • Many platforms and development tools available
  • 8. Web App Security • Breaches are common • Attackers gets sensitive data, possibly complete control of back-end systems • Denial of Service at Application Level
  • 9. This Site is Secure
  • 11. Study by Text Authors
  • 12. SinVR Hack • Unauthenticated request • Link Ch 1f
  • 13.
  • 14.
  • 17. The Core Security Problem • Users can submit arbitrary input • Alter parameters, cookies, HTTP headers • Client-side controls can't be trusted • Developers must assume all input is malicious • Attackers have attack tools like Burp; they are not restricted to using browsers
  • 18. Possible Attacks • Change the price of an item • Modify a session token to enter another user's account • Remove parameters to exploit logic flaws • SQL injection • SSL doesn't stop any of these
  • 19. Key Problem Factors • Underdeveloped Security Awareness • Custom Development • Deceptive Simplicity • Easy to make a website, but hard to secure it • Rapidly Evolving Threat Profile • Resource and Time Constraints • Overextended Technologies • Increasing Demands on Functionality
  • 20. The New Security Perimeter • Edge firewalls and "bastion hosts" are no longer enough • Keeping the attacker out of critical systems • Customers can now send transactions to servers holding private data • Via the Web app • Web app must act as a security barrier • Often it includes components from others, like widgets • Errors by other companies can compromise your servers
  • 21. • Attackers can attack users instead of servers • XSS, drive-by downloads, etc. • E-mail used for password recovery • A compromised email account exposes many other services also The New Security Perimeter
  • 22. The Future • Some vulnerabilities are decreasing • #1 security measure: UPDATES • Logic flaws and failure to use controls properly are not decreasing • Link Ch 1e
  • 23.
  • 24. CNIT 129S: Securing Web Applications Ch 2: Core Defense Mechanisms
  • 25. Core Defense Elements • Limiting user access to app's data and functionality • Limiting user input to prevent exploits that use malformed input • Frustrating attackers with appropriate behavior when targeted • Administrative monitoring and configuring the application
  • 26. Handling User Access • Authentication • Session management • Access Control
  • 27. Authentication • Username and password is most common method • Better: additional credentials and multistage login • Best: client certificates, smart cards, challenge- response tokens • Also: self-registration, account recovery, password change
  • 28.
  • 29. Common Login Problems • Predictable usernames • Password that can be guessed • Defects in logic
  • 30. Session Management • Session: a set of data structures that track the state of the user • A token identifies the session, usually a cookie • Can also use hidden form fields or the URL query string • 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 denied • Multiple roles within application • Frequent logic errors and flawed assumptions
  • 33. Handling User Input • "Input Validation" is the most common solution
  • 34. Types of Input • Arbitrary text, like blog posts • Cookies • Hidden form fields • Parameters • HTTP header fields, like User-Agent
  • 35. "Reject Known Bad" • Also called "blacklisting" • Least effective method • Difficult to identify all bad inputs
  • 36. "Accept Known Good" • Also called "whitelisting" • Most effective technique, where feasible • However, sometimes you can't do it • Human names really contain apostrophes, so you can't filter them out
  • 37. Sanitization • Render dangerous input harmless • HTML-Encoding: Space becomes %20, etc. • Difficult if several kinds of data may be present within an item of input • Boundary validation is better (four slides ahead)
  • 38. Safe Data Handling • Write code that can't be fooled by malicious data • SQL parameterized queries • Don't pass user input to an OS command line • Effective when it can be applied
  • 39. Semantic Checks • Some malicious input is identical to valid input • Such as changing an account number to another customer's number • Data must be validated in context • Does this account number being to the currently logged-in user?
  • 40. Difficulties with Simple Input Validation • Data coming from user is "bad" or "untrusted" • The server-side app is "good" and trusted • Many different types of input with different filtering requirements • Apps may chain several processing steps together • Data may be harmless at one stage, but be transformed into harmful data at another stage
  • 41. Boundary Validation • Trust boundary • Divides a trusted zone from an untrusted zone • Clean data that passes a boundary • Such as from the user into an application
  • 42. Boundary Validation • Each component treats its input as potentially malicious • Data validation performed at each trust boundary • Not just between client and server
  • 45. Boundary Validation Example • 1. App gets login: username and password • Allows only good characters, limits length, removes known attack signatures • 2. App performs a SQL query to verify credentials • Escape dangerous characters
  • 46. Boundary Validation Example • 3. Login succeeds; app passes data from user profile to a SOAP service • XML metacharacters are encoded to block SOAP injection • 4. App displays user's account information back to the user's browser • User-supplied data is HTML-encoded to block XSS
  • 47. Filtering Problems • App removes this string: • <script> • So attacker sends this • <scr<script>ipt>
  • 48. Multistep Validation • App first removes ../ • Then removes .. • Attacker sends ..../
  • 49. Canonicalization • App gets URL-encoded data from Web browser • Apostrophe is %27 • Percent is %25 • To block apostrophes, app filters %27 • But URL is decoded twice by mistake • %2527 becomes %27 becomes apostrophe
  • 50. Handling Attackers • Handling errors • Maintaining audit logs • Alerting administrators • Reacting to attacks
  • 51. Handling Errors • Show appropriate error messages • Unhanded errors lead to overly-informative error messages like this
  • 52. Audit Logs • Authentication events: login success and failure, change of password • Key transactions, such as credit card payments • Access attempts that are blocked by access control mechanisms • Requests containing known attack strings • For high security, log every client request in full
  • 53. Protecting Logs • Logs should contain time, IP addresses, and username • May contain cookies and other sensitive data • Attackers will try to erase and/or read logs • Log must be protected • Place on an autonomous system that only accepts update messages • Flush logs to write-once media
  • 54. Alerting Administrators • Usage anomalies, like a large number of requests from the same IP address or user • Business anomalies, such as a large number of funds transfers to/from the same account • Requests containing known attack strings • Requests where hidden data has been modified
  • 55. Firewalls • Web App Firewalls can detect generic attacks • But not subtle ones that are specific to your app • Most effective security control is integrated with app's input validation mechanisms • Check for valid values of your parameters
  • 56. Reacting to Attacks • Attackers probe for vulnerabilities • Sending many similar requests • Automated defenses • Respond increasingly slowly to requests • 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 authentication • Some administrative functions might not require high privileges • XSS flaws can allow cookie theft and session hijacking