Web Security
Web Security
Internet based applications are very popular and widely used in E-commerce activities. These
are extremely vulnerable to various threats and attacks. This chapter presents two important
security protocols used in the Internet for facilitating commerce i.e., these protocols are mainly
related with E-commerce related activities for example, smooth payment to the merchant over
web, railway reservation, online payment of telephone bills, use of credit/debit cards etc. The
first protocol is Secure Socket Layer (SSL) and the second one is Secure Electronic
Transaction (SET). The former is concerned with providing security services to the
applications that use TCP as the underlying protocol and hence functions between TCP and
application layer. Its Internet standard version is referred to as Transport Layer Security (TLS).
Therefore, the protocol is commonly referred as SSL/TLS. SSL/TLS protects messages of two
users (sender and receiver) via symmetric encryption and message authentication code. The
latter protocol i.e., SET is used for securing credit card transactions. Both these protocols are
discussed and presented in details in this unit.
As classified in unit 1, web related threats are classified into: active and passive.
Active attacks target - website alteration, message alteration between client and server, user
impersonation etc.
Passive attacks target - eavesdropping on web traffic, restricted website information leakage
etc.
The web threats target mainly integrity, confidentiality, availability and authentication.
Integrity threats use modification strategies to endanger user data, memory contents and
message traffic in transit. These may result in loss of information, compromise of machine
and vulnerability to other threats. Such threats are nullified by applying cryptographic
checksums.
Confidentiality threats use sniffing, eavesdropping and theft strategies to endanger server
information, client information (regarding which client/user is talking to server), network
configuration details and client’s communicated data. These may result in loss of
information and loss of privacy. Such threats are nullified by applying encryption and using
web proxies.
Denial of Service threats consider killing of user threads, flooding of a machine with bogus
requests, filling up disk or memory, isolation of machine by DNS attacks to hamper
availability. These may disrupt the user’s work and may cause user annoyance. These
threats can be detected but are difficult to nullify and prevent.
Web related threats are also classified depending upon location of the threat: Web server,
Web browser, and web traffic between browser and server. First two falls under computer
system security.
Web Traffic Security approaches differ depending upon their relative position in the
protocol stack. The approaches fall under following three categories [2]:
(1) Using IP security (IPSec) below TCP (Figure 1(a)). This has following advantages:
IPsec is a general-purpose solution.
It is transparent to end users and applications.
Use of filtering in IPSec implies less processing overhead is required.
HTTP FTP SMTP HTTP FTP SMTP
IP/IPSec TCP/IP
S/MIME SET
UDP TCP
IP
(2) Using Secure Sockets Layer (SSL)/Transport Layer Security (TLS) above TCP
(Figure 1b). SSL/TLS can be implemented as part of the underlying protocol suite or
it can be embedded in specific packages e.g. web browsers and servers can embed
SSL. In former implementation, SSL remains transparent to the applications.
(3) Embedding the security methods within the particular application (Figure 1c). In this
case application-specific security method can be tailored as per the application’s
requirements. For example, SET* on top of HTTP for securing credit card
transactions, S/MIME on top of SMTP for securing E-mail services.
* This is a common implementation; it is also possible that SET makes use of TCP directly in some other implementation.
Secure Socket Layer (SSL) is one of the most popular Web security mechanisms, following
are some of the interesting facts regarding SSL protocol:
SSL is implemented as a transport layer security service.
It was originally developed by Netscape.
It’s version 3 (SSLv3) was designed by taking public and industry input.
Upon reaching a consensus, TLS working group was formed in IETF for developing
the Internet standard and hence it was subsequently named as TLS (Transport Layer
Security). The first TLS version is essentially represented as SSLv3.1
It uses TCP to provide a reliable end-to-end service.
SSL does not represent a single protocol but various protocols at two layers as shown
in the SSL Protocol stack (Figure 2).
The SSL Record Protocol lies above TCP and provides basic security services to various
higher-layer protocols like Hypertext Transfer Protocol (HTTP).
Three higher-layer protocols that manage SSL exchanges exist as part of SSL. These are:
the Handshake Protocol, Change Cipher Spec Protocol, and Alert Protocol [2-4].
TCP/IP
The entire operation of SSL Record Protocol is shown in Figure 3.The Record Protocol
fragments the application message into manageable blocks of fragments. The fragments
may optionally be compressed. The protocol then computes MAC (similar to HMAC),
concatenates MAC with the fragment. It is then followed by message encryption using
shared symmetric secret key. The header (Fig 4) containing SSL details, major/minor
version, and compressed length is added to the message before putting it into the TCP
segment. Receiver performs decryption, MAC verification, decompression, and
reassembling of fragments before delivering the message to application layer.
Fragment 1 Fragment i
…. ….
Fragment compressed
Addition of MAC to
compressed fragment
Addition of SSL
Record Header
The three SSL-specific protocols utilize the SSL Record Protocol. These protocols are SSL
Change Cipher Spec Protocol, SSL Alert Protocol, SSL Handshake Protocol. These are
discussed next.
1 byte
1 byte 1 byte
1 Level Alert
(a) Change Cipher Spec Protocol (b) Alert Protocol
The Change Cipher Spec Protocol is the simplest among the three SSL-specific protocols
utilizing SSL Record Protocol. It has a single message having a single byte (Fig 5 (a))
which is initialized to a value of 1. The message causes copying of pending state into the
current state. Thus, main intension of this protocol is to update the cipher suite of the
connection.
SSL Handshake Protocol is used between client and server before sending any data for the
following purposes:
Server & client authentication to each other.
Negotiation between server & client for deciding encryption & MAC algorithms.
Negotiation of cryptographic keys to be used for encryption & MAC calculations.
The protocol’s message consists of 3 fields: type (1 byte), length (3 bytes) and content (≥ 0
byte).
The Handshake Protocol has 4 phases (Fig 6) during which several messages are exchanged
between client and server. These can be briefly described as:
Establishment of Security Capabilities (Phase 1) - The client initiates a logical
connection with server. In this phase, client sends client_hello whereas server replies
with server_hello for exchanging the security capabilities to be associated with SSL
connection.
Server Authentication and Key Exchange (Phase 2) - The server sends negotiation
parameters (key exchange values) to the client and server certificate for
authentication.
Client Authentication and Key Exchange (Phase 3) - The client verifies the server
certificate and checks that the server parameters are acceptable.
Finish (Phase 4) – Both client and server exchange ‘finish’ and ‘change_cipher_spec’
messages. Both copies the pending CipherSpec into the current CipherSpec. This
completes the handshake and setting up of a secure connection. Now onwards, the
client and server may engage themselves in secure data transfer.
Phase 1
Phase 2
Phase 3
Phase 1
Phase 2
After establishing initial capabilities, Server may send (i) Its own
certificate (ii) Key exchange parameters and (iii) Its request for Client
certificate ((i), (ii) and (iii) are optional or situation-dependent
messages). Towards end, Server signals end of hello message phase.
Phase 3
Phase 4
master_secret=MD5(pre_master_secret||SHA('A'||pre_master_secret||ClientHello.random||Se
rverHello.random))||MD5(pre_master_secret||SHA('BB'||pre_master_secret||ClientHel
lo.random||ServerHello.random))||MD5(pre_master_secret||
SHA('CCC'||pre_master_secret||ClientHello.random||ServerHello.random))
Here, ClientHello.random and ServerHello.random represents the client and server nonce
values exchanged via initial hello messages.
A, BB, CCC represents constant values.
The original specification was developed by group of companies like IBM, Microsoft,
Netscape, RSA, Terisa, and Verisign upon a call from MasterCard and Visa in the mid
90s.This specification (summing to a total of 971 pages) was written in three books (in
1997) namely, Business Description, Programmer's Guide and Formal Protocol
Definition.By the year 1998, the SET complaint products were available.
SET provides three services: secure communication, trust and privacy. As many parties are
involved during communication, SET uses secure communication channel between them for
securing the data exchange. It uses X.509v3 digital certificates for providing trust. It
provides information to only the trusted parties involved in the transaction for enhancing
privacy [2][6][7].
SET defines business requirements, features, and the participants for secure credit card
transactions and processing. These are presented next.
For meeting (i) and (ii) SET uses encryption and digital signatures thereby ensuring:
All information between the communicating parties is safe, authentic and is accessible only
by the authorized users. This also reduces the chances of fraud by either sender or receiver
or by any third party.
For meeting (iii) and (iv) digital signatures and digital certificates are used. Thus, card
holders only identify the merchants for transactions while the merchants have confidence
that the card holder is not fake and has an associated account.
For meeting requirement (v), SET uses well tested, reliable and highly secure algorithms.
For meeting requirement (vi), SET functions independently i.e., without interfering with
IPSec and SSL/TLS. For meeting requirement (vii), SET defines formats and methods that
are independent of any hardware or software.
Striking Features of SET
The striking features of SET can be listed as:
Information Confidentiality: In SET, DES symmetric encryption is used to protect the
following information from access by others.
(i) Cardholder account and other details.
(ii) Payment information.
(iii)Cardholder's credit card number; even merchant is prevented from learning it. The
number is supplied only to the issuing bank.
Data Integrity: For protecting the payment information sent from cardholders to
merchants by any alterations, SET uses either RSA digital signatures with SHA-1 or
HMAC using SHA-1.
Cardholder account authentication: SET enables merchants to verify that a cardholder
is a legitimate user of a valid card account number. SET uses X.509v3 digital
certificates with RSA signatures for this purpose.
Merchant authentication: SET enables cardholders to verify that a merchant has a
relationship with a financial institution allowing it to accept payment cards. Again,
SET uses X.509v3 digital certificates with RSA signatures for this purpose.
In comparison to IPSec and SSL/TLS, SET does not give any options for selecting among
various cryptographic algorithms. This is due to the fact that SET is a single application and
is specifically used for one purpose that of securing credit card based transactions whereas
IPSec and SSL/TLS support a range of applications and provides general security to
applications.
Purchase of items
Merchant
Cardholder
Internet
Certificate
Authority (CA)
Payment
gateway
Payment
Issuer network
Acquirer
Dual Signature (DS) = Encryption of payment order message digest (POMD) using customer’s
private signature key (KC)
= EKC ( POMD )
POMD = Hash of (PI message digest (PIMD) concatenated with OI message digest (OIMD))
= H(PIMD||OIMD)
Hash
POMD
Encrypt using KC
Dual Signature
8. Upon verification of the customer’s request at the payment gateway, merchant sends
order confirmation.
9. The merchant provides the demanded goods or service to the customer.
10. The merchant requests to the payment gateway regarding payment processing.
Payment capture: Refers to merchant’s request to the payment gateway regarding payment.
These are considered next in details.
The entire purchase request (SET enabled) interaction involves four messages. The
customer having credit card also requires public key certificates of the merchant and the
payment gateway. For this first two messages i.e., Initiate Request and Initiate Response are
used.
Preprocessing:
(i) Customer verifies the merchant and gateway certificates using CA signatures
(ii) Creates the OI and PI containing transaction ID (send by the merchant in Initiate
Response)
(iii)An order reference generated in the preliminary phase before starting the SET enabled
interaction.
After completing preprocessing tasks, the customer/cardholder generates a one-time
symmetric encryption key, KS and creates Purchase Request message (Fig 9) containing:
1. Purchase-related information to be forwarded to the payment gateway by the
merchant and it contains the following:
(i) The PI.
(ii) The Dual Signature (DS).
(iii) The OI Message Digest (OIMD).
(i), (ii) and (iii) are encrypted using one time secret key Ks.
The OIMD is used to verify the DS. The bank possesses DS, PI, OIMD along with
the customer's public key and can calculate:
(i) H(H[PI]||OIMD)
(ii) D P (DS) where, Pc is the customer’s public key and D stands for decryption.
C
The key Ks is encrypted using payment gateway's public key and is hence, hidden
from the merchant. Thus, merchant cannot read PI. The encrypted Ks is termed as
digital envelope as it must be decrypted for reading other items in the message.
2. Order-related information required by the merchant and it consists of the following:
(i) The OI, send in clear without encryption.
(ii) The DS.
(iii)The PI Message Digest (PIMD).
The PIMD is used to verify the DS. The merchant possesses DS, OI, PIMD along
with the customer's public key and can calculate:
(i) H(PIMD||H[OI])
(ii) D P (DS) where, PC is the customer’s public key and D stands for decryption.
C
(I + II) to be
+
passed to
Digital Envelope payment gateway
II by merchant
Encrypted KS
Encryption done using Bank’s public key -
exchange key (PB)
E PB ( K S )
+
III
(Purchase Information Message Digest (PIMD))
OI + DS + card holder certificate
Processing steps executed by the merchant upon receiving the Purchase Request message
(Fig 10):
1. Verification of the cardholder’s certificates by verifying CA signatures and extraction
of customer’s public key.
2. Verification of the DS (using the customer's public key), indicating that the message
was indeed sent by the customer and is not tampered in between.
3. OI processing and forwarding of the PI to the payment gateway for authorization.
4. Reply the customer via purchase response.
Customer’s request message for merchant
Upon receiving the purchase response message, customer verifies the merchant's certificate.
It is then followed by verification of the merchant signature on the response block.
Customer may display the message or update the order status based on the response
conveyed via response block.
Because the transaction is approved by the gateway, the merchant can supply services or
goods to the customer. The payment authorization involves: Authorization Request message
and Authorization Response message. Former is send by merchant to the payment gateway
while latter is send by payment gateway to the merchant.
Upon receiving Authorization Request, the payment gateway executes following operation
sequence:
1. All three certificates are verified.
2. Decrypts the digital envelope payment gateway's private key-exchange key.
3. Obtains the symmetric key from digital envelope and then decrypts the authorization
block to obtain signed transaction ID.
4. Verifies the merchant's signature from the signed transaction ID.
5. As done in step 3 extract the symmetric key from digital envelope of the payment
block and use it to decrypt the payment block.
6. Verifies the DS from payment block
7. Compares the transaction ID received from the merchant with that received from the
customer via PI.
8. Upon successful comparison, requests an authorization from the issuer.
9. Upon receiving authorization from the issuer, gateway creates and sends an
Authorization Response message to the merchant.
The Authorization Response includes the following elements:
1. Authorization-related information generated by the payment gateway having the
signed authorization block and digital envelope. Signature on authorization block
done using gateway's private signature key while encryption is done using a one-time
symmetric key generated by the gateway. The one-time symmetric key is encrypted
by merchant’s public key-exchange key to form the digital envelope.
2. Capture token information having a signed, encrypted capture token and a digital
envelope. This token is returned as such by the merchant for payment in the payment
request.
3. Gateway's signature key certificate.
After being authorized from the gateway, the process of goods or service delivery to the
customer can proceed ahead.
The Capture Request message is created by the merchant and it contains: (i) Capture request
block having payment amount and the transaction ID. This capture request block is signed
and encrypted, (ii) Encrypted capture token received via Authorization Response from the
gateway and, (iii) Merchant's signature key and key-exchange key certificates.
Upon receiving Capture Request message, the payment gateway - decrypts and verifies (i)
the capture request block and (ii) the capture token block. Both capture request and capture
token are checked for consistency of information. A clearing request is sent depending upon
success of checking to the issuer over the private payment network for transferring the
funds to the merchant's account.
Finally, the gateway sends payment notification to the merchant using Capture Response
message which contains (i) a signed and encrypted capture response block and, (ii)
gateway's signature key certificate. The capture response is stored by the merchant
(software) for future reconciliation with the acquirer’s details regarding payment [2].