A. The usefulness of the World Wide Web is due not just to browsers, but also to Web components that enable services for end users through their browser interfaces.
B. These Web components use a wide range of protocols and services to deliver the desired content to end users.
C. From a systems point of view, many security concerns have arisen, but they can be grouped in three main tasks:
1. Securing a server that delivers content to users over the Web.
2. Securing the transport of information between users and servers over the Web.
3. Securing the user's computer from attack over a Web connection.
A. Protocols refer to agreed upon sets of rules that allow different vendors to produce hardware and software that can interoperate with pieces developed by other vendors.
B. The specific instantiation of protocols is done through hardware and software components.
C. Encryption (SSL and TLS).
1. SSL is almost ubiquitous with respect to e-commerce—all browsers support it as do Web servers, and virtually all sensitive financial traffic from e-commerce Web sites uses this method to protect information in transit between Web servers and browsers.
2. The Internet Engineering Task Force (IETF) adopted SSL in 1996 through a series of RFCs and named the group Transport Layer Security (TLS).
a) Starting with SSL 3.0, in 1999, the IETF issued RFC 2246, “TLS Protocol Version 1.0,” followed by RFC 2712, which added Kerberos authentication, and then RFCs 2817 and 2818, which extended TLS to HTTP version 1.1 (HTTP/1.1).
b) Although SSL has been through several versions, TLS begins with an equivalency to SSL 3.0, so today SSL and TLS are essentially the same protocol although not interchangeable.
3. SSL/TLS is a series of functions that exist in the OSI model between the application layer and the TCP/IP implementation in the transport and network layers.
a) The goal of TCP is to send an unauthenticated error-free stream of information between two computers. SSL/TLS adds message integrity and authentication functionality to TCP through the use of cryptographic methods.
b) When two programs initiate an SSL/TLS connection, the first task is to compare available protocols and agree on an appropriate common cryptographic protocol for use in this particular communication.
c) As SSL/TLS can use separate algorithms and methods for encryption, authentication, and data integrity, each of these is negotiated and determined depending upon need at the beginning of a communication.
4. SSL/TLS uses a wide range of cryptographic protocols. To use these protocols effectively between a client and a server, an agreement must be reached on which protocol to use. The SSL handshake process is used to accomplish this task.
a) The handshake process begins with a client request for a secure connection, and a server's response.
(1) For the client and server to communicate, both sides have to agree on a commonly held protocol (SSL v1, v2, v3, or TLS v1).
(2) Commonly available cryptographic algorithms include Diffie-Hellman and RSA.
(3) The handshake begins with the exchange to agree on parameters.
b) The next step is to exchange certificates and keys as necessary to enable authentication.
(1) The certificate exchange is via X.509 certificates, and public key cryptography is used to establish authentication.
(2) Once authentication is established, the channel is secured with symmetric key cryptographic methods and hashes, typically RC4 or 3DES for symmetric key and MD5 or SHA-1 for hash functions.
c) At this point, the authenticity of the server and possibly the client has been established, and the channel is protected by encryption against eavesdropping. All of this work requires CPU time, hence SSL/TLS connections require significantly more overhead than unprotected connections. Establishing connections is time consuming, so even stateless Web connections are held in a stateful fashion when secured via SSL/TLS, to avoid repeating the handshake process for each request.
d) The use of certificates is a way to have a third party act as a notary in the electronic world.
(1) A certificate is merely a standard set of formatted data that represents the authenticity of the public key associated with the signer.
(2) A certificate can be trusted as a notary to a signature.
(3) Certificates provide a method of proving who someone is, provided the issuer is trustworthy.
e) SSL/TLS is designed to provide protection from man-in-the-middle attacks.
(1) By authenticating the server end of the connection, SSL/TLS prevents the initial hijacking of a session.
1. The Hypertext Transfer Protocol (HTTP) is the protocol used to transfer hypertext-linked data over the Internet, from Web servers to browsers. When a user types a URL such as http://www.example.com into a browser, the http:// portion indicates that the desired method of data transfer is via the Hypertext Transfer Protocol.
2. One of the primary drivers behind the development of SSL/TLS was the desire to hide the complexities of cryptography from end users.
a) When using an SSL/TLS-enabled browser, this can be done by requesting a secure connection from a Web server instead of a nonsecure connection. To request a secure connection, use https:// instead of http://.
b) When a browser is SSL/TLS-aware, the entry of an SSL/TLS-based protocol will cause the browser to perform the necessary negotiations with the Web server to establish the required level of security.
3. The objective of enabling cryptographic methods in this fashion is to enable end users to use these protocols easily.
a) SSL/TLS is designed to be protocol agnostic.
b) Although designed to run on top of TCP/IP, it can operate on top of other lower-level protocols, such as X.25.
c) SSL/TLS requires a reliable lower-level protocol, so it cannot function properly on top of a non-reliable protocol such as the IP User Datagram Protocol (UDP).
F. Web Services.
1. Web Services is a widely used industry term. Its underlying core is an application program accessible using open protocols.
2. With a distributed computing lineage, Web Services have been defined through industry standardization around a series of specifications including XML Schema and Web Services Description Language (WSDL).
3. A common method of invoking a Web Service is via a Simple Object Access Protocol (SOAP) request over an HTTP connection.
b) In simple terms, a Web Service can be seen as an application that is accessed via a standard set of remote procedure calls implemented over HTTP, where the content will be passed using XML over SOAP.
4. Since the deployment of Web Services is still in the initial stages, the effectiveness of the security mechanisms being built into the standards is unknown. There are several areas that Web Services are vulnerable, including:
5. As Web Services communicate over HTTP and through Web servers, any vulnerability of the Web server can manifest itself as a vulnerability to the Web service.
6. The greatest risk is associated with the actual Web service code itself.
a) As Web Services are designed to increase distributed code and usage, control over users of Web Services lessens and it is far from safe to assume every usage will be with properly conformed messages for a particular Web Service.
b) This places a responsibility on the Web Services application programmer to develop secure code.
a) Simple Object Access Protocol (SOAP) began as a method of invoking remote procedures over the Internet.
b) SOAP forms a framework for generalized XML messaging between applications in a language-neutral and platform-independent fashion.
(1) The basic SOAP framework is devoid of many features, such as routing and security, since these are taken care of in the extensible nature of the basic framework.
(2) Layered extensions allow adding these services in a cohesive and controlled fashion.
a) Extensible Markup Language (XML) is used to format messages used by SOAP to access and return data from Web Services.
b) XML Schemas are used to define the communication interfaces and to carry information between Web Services. Invoking elements allows for a standard method that is independent of any firm or platform. The use of XML Schemas is extensible and language neutral.
G. Directory Services (DAP and LDAP).
1. A directory is a data storage mechanism similar to a database, but it has several distinct differences designed to provide efficient data retrieval services compared to standard database mechanisms.
a) A directory is designed and optimized for reading data, offering very fast search and retrieval operations.
b) The types of information stored in a directory tend to be descriptive attribute data.
c) A directory offers a static view of data that can be changed without a complex update transaction.
d) The data is hierarchically described in a tree-like structure, and a network interface for reading is used.
a) The primary method for accessing an X.500 directory is through the Directory Access Protocol (DAP), a heavyweight protocol that is difficult to implement completely, especially on PCs and platforms that are more constrained.
b) This led to the Lightweight Directory Access Protocol (LDAP), which contains the most commonly used functionality.
(1) LDAP can interface with X.500 services, and, most importantly, LDAP can be used over TCP with significantly less computing resources than a full X.500 implementation.
(2) LDAP offers all the functionality most directories will need and is easier and more economical to implement, hence LDAP has become the Internet standard for directory services.
3. SSL/TLS LDAP.
a) LDAP over TCP is a plaintext protocol, meaning data is susceptible to eavesdropping. To counter this issue, encryption can be used. The application of SSL/TLS-based service protects directory queries and replies from eavesdroppers.
b) SSL/TLS provides several important functions to LDAP services.
(1) SSL/TLS can establish the identity of a data source through the use of certificates.
(2) SSL/TLS can also provide integrity and confidentiality of the data being presented from an LDAP source.
(3) As LDAP and SSL/TLS are two separate independent protocols, interoperability is more a function of correct setup than anything else. To achieve LDAP over SSL/TLS, the typical setup is to establish an SSL/TLS connection and then open an LDAP connection over the protected channel. This requires both the client and the server to be enabled for SSL/TLS.
c) Once an LDAP server is set up to function over an SSL/TLS connection, it essentially operates as it always has.
(1) The LDAP server responds to specific queries with the data returned from a node in the search.
(2) The SSL/TLS functionality operates to secure the channel of communication, and it is transparent to the data flow from the user's perspective.
(3) From the outside, SSL/TLS prevents observation of the data request and response, ensuring confidentiality.
H. File Transfer (FTP and SFTP).
1. Originally, the Internet was used for transferring files between machines. Scientific researchers needed to transfer files from one machine to another in a simple, secure, and reliable fashion.
a) FTP is an application-level protocol, allowing it to operate over a wide range of lower-level protocols.
b) FTP is embedded in most operating systems and provides a method of transferring files from a sender to a receiver.
c) Most FTP implementations are designed to operate both ways, sending and receiving, and can enable remote file operations over a TCP/IP connection.
d) FTP clients are used to initiate transactions and FTP servers are used to respond to transaction requests. The actual request can be either to upload (send data from a client to a server) or download (send data from a server to a client).
e) To open an FTP data store in a browser, entering ftp://url in the browser's address field shows the data associated with the URL via an FTP session—the browser handles the details. File transfers via FTP can be either binary or in text mode, but in either case, they are plaintext across the network.
3. Blind FTP (Anonymous FTP).
a) To access resources on a computer, an account must be used to allow the operating system-level authorization function to work.
b) In an FTP server, a standard account called anonymous exists which allows unlimited public access to the files and is commonly used to have unlimited distribution.
c) On a server, access permissions can be established to allow only downloading or only uploading or both, depending upon the system's function.
d) As FTP can be used to allow anyone access to upload files to a server, it is considered a security risk and is commonly implemented on specialized servers isolated from other critical functions.
d) As FTP servers can present a security risk, they are typically not permitted on workstations and are disabled on servers that do not need this functionality.
a) FTP operates in plaintext mode, so an eavesdropper can observe the data being passed. If confidential transfer is required, Secure FTP (SFTP) utilizes both Secure Shell (SSH) protocol and FTP to accomplish this task.
b) SFTP is an application program that encodes both the commands and the data being passed and requires SFTP to be on both the client and the server.
(a) SFTP is not interoperable with standard FTP—the encrypted commands cannot be read by the standard FTP server program.
(b) To establish SFTP data transfers, the server must be enabled with the SFTP program, and then clients can access the server provided they have the correct credentials.
(c) The first SFTP operation is the same as with FTP: an identification function that uses a username, and an authorization function that uses a password.
(d) There is no anonymous SFTP account by definition, so access is established and controlled from the server using standard access control lists, IDs, and passwords.
A. The use of protocols such as SSL/TLS provides a convenient method for end users to use cryptography without having to understand the methods and steps.
1. This can result in complacency—the impression that once SSL/TLS is enabled, the user is safe, and this is not necessarily the case.
2. If a Trojan program is recording keystrokes and sending the information to another unauthorized user, SSL/TLS cannot prevent this security breach.
3. If the user is connecting to an untrustworthy site, the mere fact that the connection is secure does not prevent the other site from running a scam.
4. Using SSL/TLS and other encryption methods does not guard against the credit card information being “lost” by a company you do business with.
B. The key to understanding what is protected and where it is protected requires an understanding of what these protocols can and cannot do.
1. The SSL/TLS suite can protect data in transit, but not on either end in storage.
2. It can authenticate users and servers, provided that the certificate mechanisms are established and used by both parties.
3. Properly set up and used, SSL/TLS can provide a very secure method of authentication, followed by confidentiality in data transfers and data integrity checking.
4. This occurs during transit, and the protection ends once the data is stored.
III. Code-Based Vulnerabilities
A. Browsers can perform many types of data transfer. In some cases, additional helper programs, or plug-ins, can increase functionality for specific types of data transfers, while in other cases, separate application programs may be called by a browser to handle the data being transferred.
B. The opportunity exists for these applications or plug-ins to include malicious code that performs actions not desired by the end user.
C. Buffer overflows.
1. The most common exploit used to hack into software is the buffer overflow which is the result of poor coding practices on the part of software programmers—when any program reads input into a buffer and does not validate the input for correct length, the potential for a buffer overflow exists.
2. The concept is simple.
a) A hacker writes an executable program that performs some action on the target machine and appends this code fragment to a legitimate response to a program on the target machine.
b) When the target machine reads through the too-long response, a buffer overflow condition causes the original program to fail.
c) The extra malicious code fragment is now in the machine's memory, awaiting execution.
d) If the hacker executes it correctly, the program will skip into the hacker's code, running it before failing.
3. Buffer overflows have been shown to be exploitable in a wide range of programs.
a) It has been estimated that 50 percent of the security incidents by type are from buffer overflow exploits making it one of the most common hacks used.
b) The primary defense users have is to keep their machines up to date with patches from software manufacturers.
1. Designed to be platform independent and based on C, Java offered a low learning curve and a way of implementing programs across an enterprise, independent of platform.
3. Java was initially designed to be used in trusted environments, and when it moved to the Internet for general use, safety became one of its much hyped benefits. Safety is not security, however, and although safe, a Java program can still cause significant damage to a system.
1. ActiveX is a broad collection of APIs, protocols, and programs developed by Microsoft to download and execute code automatically over an Internet-based channel.
a) The code is bundled together into an ActiveX control and given an .ocx extension.
b) These controls are referenced in HTML using the tag.
2. To enable security and consumer confidence in downloaded programs such as ActiveX controls, Microsoft developed Authenticode, a system that uses digital signatures and allows Windows users to determine who produced a specific piece of code and whether or not the code has been altered.
a) As in the case of Java, safety and security are different things, and Authenticode promotes neither in reality.
b) Authenticode provides limited accountability at the time of download and guarantees that the code has not been changed since the time of signing. Authenticode does not identify whether a piece of code will cause damage to a system, nor does it regulate how the code is used.
1. The Common Gateway Interface (CGI) was used to have a Web server execute a program outside the Web server process, yet on the same server.
2. CGI offers many advantages to Web-based programs.
a) Although Perl is a preferred language, the programs can be written in any language.
b) These scripted programs contain the functionality of a server, allowing access to databases, UNIX commands, and other programs.
G. Server-side scripts.
1. CGI has been replaced in many Web sites through newer server-side scripting technologies such as Java, Active Server Pages (ASP), and PHP.
2. These technologies allow programs to be run outside the Web server and to return data to the Web server to be returned to end users via a Web page.
3. Each of these newer technologies has stronger security models than CGI.
1. Cookies are small chunks of ASCII text passed within an HTML stream to store data temporarily in a Web browser instance.
2. Cookies pass back and forth between Web server and browser and act as a mechanism to maintain state in a stateless world.
a) State is a term that describes the dependence on previous actions.
3. By definition, an HTTP session served by a Web server is stateless—each request is completely independent of all previous requests.
4. Cookies are passed along with HTML data through a Set-Cookie message in the header portion of an HTML transaction, or via script in the HTML body.
5. A cookie is a series of name-value pairs that is stored in memory during a browser instance.
a) The specification for cookies established several specific name-value pairs for defined purposes but additional name-value pairs may be defined by a developer.
b) The specified set of name-value pairs includes the following:
(1) Expires= This specifies when the cookie expires. If no value exists, then the cookie is only good during the current browser session and will not be persisted to the user's hard drive. If a value is given, the cookie will be written to the user's machine and persisted until this datetime value occurs.
(2) Domain= This name-value pair specifies the domain where the cookie is used.
(3) Path= This name-value pair further resolves the applicability of the cookie into a specific path within a domain. If path= /directory, the cookie will only be sent for requests within the /directory on the given domain allowing a level of granular control over the information being passed between the browser and server, and limiting unnecessary data exchanges.
(4) Secure= The presence of the keyword [secure] in a cookie indicates that it is to be used only when connected in an SSL/TLS session. This does not indicate any other form of security, as cookies are stored in plaintext on the client machine.
6. Cookie management on a browser is normally an invisible process, but both Internet Explorer and Communicator have methods for users to examine and manipulate cookies on the client side.
7. Disabling cookies.
a) If the user disables cookies in a browser, this type of information will not be available for the Web server to use.
b) IETF RFC 2109 describes the HTTP state-management system (cookies) and specifies several specific cookie functions to be enabled in browsers, specifically:
(1) The ability to turn on and off cookie usage.
(2) An indicator as to whether cookies are in use.
(3) A means of specifying cookie domain values and lifetimes.
c) Telling a browser to stop accepting cookies is a setup option available through an options menu, but this has no effect on cookies already received and stored on the system.
d) To prevent the browser from sending cookies already received, the user must delete the cookies from the system.
I. Signed applets.
1. Code signing works by adding a digital signature and a digital certificate to a program file to demonstrate file integrity and authenticity. The certificate identifies the author, and the digital signature contains a hash value that covers code, certificate, and signature to prove integrity. This establishes the integrity of the code and the publisher via a standard browser certificate check.
2. The ability to use a certificate to sign an applet or control allows establishing the identity of the author of the applet or control. This signing of a piece of code identifies the code's manufacturer and guarantees that the code has not been modified since it was signed.
3. A signed applet can be hijacked as easily as a graphic, or any other file. The two ways an attacker could hijack a signed control are by in-line access or copying the file in its entirety and republishing it.
a) In-lining is using an embedded control from another site with or without the other site's permission.
b) Republishing a signed control is done by maintaining a copy of the file on the unauthorized site and serving from there instead of from the original location.
4. The primary security concern of signed controls comes from how the control is used.
a) A hacker may be able to use a control in an unintended manner, resulting in file loss or buffer overflow. These conditions weaken a system and may allow exploitation of other vulnerabilities.
J. Browser plug-ins.
1. Plug-ins are small application programs that increase a browser's ability to handle new data types and add new functionality.
2. To date, plug-ins have had a remarkable safety record and although plug-ins change a browser, and how they can manipulate data, security holes have not been the norm in this area.