Chapter 6 - Web Security
Chapter 6 - Web Security
Web Security
1
Outline
2
Web Security
Key Points
•Secure socket layer (SSL) provides security services between
TCP and applications that use TCP.
•The Internet standard version is called transport layer
service (TLS).
•SSL/TLS provides confidentiality using symmetric encryption
and message integrity using a message authentication code.
•Kerberos is an authentication service designed for use in a
distributed environment.
•Secure electronic transaction (SET) is an open encryption
and security specification designed to protect credit card
transactions on the Internet
3
Web Security
5
The Top 10 OWASP vulnerabilities in
2021
• Injection
• Broken authentication
• Sensitive data exposure
• XML external entities (XXE)
• Broken access control
• Security misconfigurations
• Cross site scripting (XSS)
• Insecure deserialization
• Using components with known vulnerabilities
• Insufficient logging and monitoring
6
OWASP Top Ten Web Application Risks
OWASP Top ten 2010
Types of Web threats and countermeasures
Threats Consequences Countermeasures
Integrity • Modification of user • Loss of Cryptographic
data information checksums
• Trojan horse browser • Compromise of
• Modification of machine
memory • Vulnerability to
• Modification of all other
message traffic in threats
transit
Confidentiality • Eavesdropping on the • Loss of • Encryption
Net information • Web proxies
• Theft of info from • Loss of privacy
server
• Theft of data from
client
• Info about network
configuration
• Info about which
9
client talks to server
Types of Web threats and counter measures
Threats Consequences Countermeasures
DoS • Killing of user threads • Disruptive Difficult to prevent
• Flooding machine • Annoying
with bogus requests • Prevent user
• Filling up disk or from getting
memory work done
• Isolating machine by
DNS attacks
Authentication • Impersonation of • Misrepresentat Cryptographic
legitimate users ion of user techniques
• Data forgery • Belief that
false
information is
valid
10
Web Security
• Types of threats faced in using the Web can also be
classified in terms of the location of the threat:
- Web server (computer system security)
- Web browser (computer system security)
- Network traffic between browser and server (network security)
12
Web Security
• Use of IP Security (IPSec)
- Transparent to applications
- Provide general purpose solution
- Provides filtering capability
• Security just above TCP
- SSL: Secure Socket Layer
- TLS: Transport Layer Security
- SSL/TLS could be provided as part of the underlying protocol suite
=> Transparent to applications
- Alternatively, can be embedded into applications
• Example: Netscape and Microsoft Explorer browsers are
equipped with SSL
• Application specific security services
- Embedded within specific application
- Best examples are SET (Secure Electronic Transaction) on top of
HTTP and MIME on SMTP. 13
Web Security: Secure Channels
• Encrypted Traffic may use
– Symmetric Key
– Public/Private Key
• Negotiated Secure Session
– Secure Socket Layer (SSL)
– Transport Layer Security (TLS)
– SSL or TLS provides the following services
• Authenticate users and servers
• Encryption to hide transmitted data - symmetric or asymmetric
• Integrity to provide assurance that data has not been altered during
transmission
– SSL or TLS require certificates to be issued by a CA
14
Web Security: Secure Channels
• Internet Tunnels
– Virtual Private Network circuit across the Internet between
specified remote sites
– uses an encrypting router that automatically encrypts all
traffic that traverses the links of the virtual circuit
• Tunneling Protocols
– PPTP by Microsoft - http://www.microsoft.com
– Layer 2 Forwarding (L2F) by Cisco - http://www.cisco.com
– L2TP/IPSec(combines PPTP and L2F) - http://www.ietf.com
– SSTP (Secured Socket Tunneling Protocol)
15
HTTPS (HTTP Secure)
• HTTPS uses cryptography with HTTP
– Alice, Bob have public, private keys; public keys
accessible via certificate authority (CA)
– Alice encrypts message with Bob’s public key,
signs message with her private key
– Bob decrypts message with his private key, verifies
message using Alice’s public key
– Once they “know” each other, they can
communicate via symmetric crypto keys
17
Secure Socket Layer (SSL)
• Secure Sockets Layer SSL is transport-layer protocol that
provides encryption technology for the web services.
19
Secure Sockets Layer
• SSL Characteristics
– Operates at the TCP/IP transport layer
– Encrypts (decrypts) input from application (transport) layer
– Any program using TCP can be modified to use SSL connections
– SSL connection uses a dedicated TCP/IP socket (e.g. port 443
for https or port 465 for ssmtp)
SSL
Transport
Network 20
Secure Sockets Layer
• SSL Characteristics…
– SSL is flexible in choice of which symmetric
encryption, message digest, and authentication
algorithms can be used
– When SSL client makes contact with SSL server
they try to pick strongest encryption methods
they have in common.
– SSL provides built in data compression
• compress first then encrypt
21
Secure Sockets Layer
• SSL Characteristics…
– When SSL connection established browser-to-
server and server-to-browser communications are
encrypted.
– This includes:
• URL of requested document
• Contents of the document
• Contents of browser forms
• Cookies sent from browser to server
• Cookies sent from server to browser
• Contents of HTTP header…
22
SSL Architecture
INITIALIZES SECURE
COMMUNICATION ERROR HANDLING
HANDLES COMMUNICATION
WITH THE APPLICATION
Protocols
INITIALIZES
COMMUNCATION
BETWEEN CLIENT &
HANDLES DATA SERVER
COMPRESSION
AND ENCRYPTION
23
SSL Architecture
SSL
SSL consists
consists two
two layers
layers of protocols: SSL
of protocols: SSL Record
Record Protocol
Protocol
Layer and Upper
Layer and Upper Layer
Layer Protocols
Protocols..
25
SSL Record Protocol
• Confidentiality
– using symmetric encryption with a shared
secret key defined by Handshake Protocol
– IDEA, RC2-40, DES, 3DES, RC4-40, RC4-
128
– message is compressed before encryption
• Message integrity
– using a MAC with shared secret key
26
SSL Record Protocol Operation
27
SSL Record Format
•• Content
ContentType
Type(8bit):
(8bit):The
The
higher
higherlayer
layerprotocol
protocolused
usedtoto
process
processthetheenclosed
enclosed
fragment
fragment
•• Major/Minor
Major/Minorversion
version(8/8
(8/8bit)
bit)::
Indicates
Indicatesmajor/minor
major/minorversion
version
of
ofSSL
SSLininuse
use
•• Compressed
CompressedLengthLength(16
(16bit):
bit):
The
Thelength
lengthininbytes
bytesof
ofthe
the
plain
plaintext
textfragment
fragment
(compressed
(compressedfragment)
fragment)
28
Cipher Suite
• For public-key, symmetric encryption and
certificate verification we need
– public-key algorithm
– symmetric encryption algorithm
– message digest (hash) algorithm
• This collection is called a cipher suite
• SSL supports many different suites
• Client and server must decide on which one to
use
• The client offers a choice; the server picks one
29
Cipher Suites
INITIAL (NULL) CIPHER SUITE
SSL_NULL_WITH_NULL_NULL = { 0, 0 }
37
Kerberos
• Kerberos is an authentication service designed for use in a
distributed environment.
• Kerberos makes use of a trusted third-part authentication service
that enables clients and servers to establish authenticated
communication.
42
Kerberos: etymology
43
44
Security Techniques/ Authentication
Kerberos…
45
Kerberos Requirements
• security
– opponents should not be able to gain access to KDC
• reliability (availability)
– a Kerberos server or its substitute should be available all the time
• scalability
– system should be able to support large amount of users
• reliability and scalability imply a distributed architecture
• transparency
– users should see the system as a username/password system
Kerberos 4 Overview
47
Kerberos v4 Dialogue
1. obtain ticket granting ticket from AS
• once per session
• AS knows the passwords of all users and stores in
centralized DB
• AS shares a unique secret key with each server
Message 3
(3) C -> V: IDC || Ticket
– Server V decrypts the ticket and checks various fields
– ADC in the ticket binds the ticket to the network address of C
– However this authentication scheme has problems
50
Kerberos: How it works
51
Kerberos Version 5
52
Web Security
Secure Electronic Transactions (SET)
•An open encryption and security specification.
•Designed to protect credit card transaction on the
Internet.
•Companies involved:
- MasterCard, Visa, IBM, Microsoft, Netscape, RSA, Terisa and
Verisign
56
Web Security…
SET Participants
57
Web Security…
SET (Sequence of events for transactions)
1.The customer opens a credit card account.
2.The customer receives a certificate, which is signed by the Bank.
3.Merchants have their own certificates.
4.The customer places an order.
5.The merchant is verified by sending a copy of its certificate.
6.The order and payment are sent to the merchant along with cus.cert
7.The merchant request payment authorization to payment gateway
8.The merchant confirm the order.
9.The merchant provides the goods or service.
10.The merchant requests payments, the request is sent to the payment
gateway, which handles all of the payment processing
58
59
Web Security…
SET – Dual Signature
•Dual signature is an important innovation by SET
•Used to link two messages that are intended for two different recipients.
•The customer wants to send Order Information (OI) to the merchant and
Payment Information (PI) to the bank.
•Merchant – Does not need to know customer’s CC number.
•Bank – Does not need to know details of customer’s order.
Privacy!!
•The two items, however, must be linked somehow to prove that the
payment is intended for this order and not for some other goods or
services.
60
Web Security…
• SET – Dual Signature (customer side)
DS = E(PRc, [H(H(PI)||H(OI)])
61
Web Security…
SET – Dual Signature (Merchant side)
•Now suppose that the merchant is in possession of:
– the dual signature (DS),
– the OI, and
– the message digest for the PI (PIMD)
– The merchant also has the public key of the
customer, taken from the customer's certificate.
•Then the merchant can compute the quantities:
H(PIMD||H[OI]) ; D(PUc, DS)
•If these two quantities are equal, then the merchant has
verified the signature.
62
Web Security…
SET – Dual Signature (Bank side)
•Similarly, if the bank is in possession of:
– DS, PI,
– the message digest for OI (OIMD), and
– the customer's public key, then the bank can compute:
64
Web Security…
SET payment processing
Merchant Verifies Customer Purchase Request
det of
ails
for 7.3
n
llin ctio
S ta a d S e
gs
Re
65