Web Security
Web Security
Testing Web
nities to communicate, we also have
new opportunities for misuse. Even
though every application is different,
there are some general industry-
standard risk areas for Web applica-
Unlike most client-only applications, Web required should be based on the security profile. For other Web applications, only
based applications have viewable code, requirements, which should be defined by the system administrator can create user
access to the contents of the Web server, a requirements analyst, like other non- profiles. The registration process should
and information that can be intercepted. functional requirements. When there are be tested for potential security risks. For
Because of these new opportunities to no requirements or requirements are not example, if the user sets the password, it
communicate, there are also new opportu- complete, the tester can use the risk areas should be a required field. If the password
nities for misuse. identified in this article to raise concerns. is assigned by the system, there should be
Even though every application is different, business rules concerning generation,
Most of the security testing literature looks there are some general industry-standard delivery and first-use of passwords. For
at vulnerabilities of the network and Web risk areas for Web applications. The risk example, duplicate, identical users should
server, but this article discusses Web secu- areas that we will examine in this article not be allowed to register.
rity testing at the application level. Much are:
attention is given to the network and Web • User authentication The verification portion of the application
server, but sometimes the applications • User authorization should be tested to ensure that valid user
they are housing are not secure. • Security holes in the application and password combinations allow access
Additionally, when testing a Web applica- • Data access through the URL and that invalid user and password combi-
tion, the tester does not always know the • Altered client code nations do not allow access. There may be
network architecture, operating system, or other security requirements like a log file
Web server for each implementation of the User Authentication of failed logins, the disabling of profiles
application. Finally, the risk areas dis- In order to be identified as a user, so one after a certain number of incorrect logins,
cussed in this article allow average users can gain authority to perform tasks, some or the disabling of access after a certain
to stumble on secure information. These Web systems require users to register and number of failed logins. There should also
risk areas do not require a malicious user be verified via a login process. Generally, be verification of proper logout processes,
to run a Perl script or use network penetra- the users will login with a User ID and a including the handling of session timeouts,
tion tools; they can be exploited with the password. user requested logouts, and logouts by
browser and a text editor. navigating away from the site.
Before one can just log in to the applica-
The amount of security testing one should tion, their user profile must be created in Another potential security risk with logins
perform generally depends on the type of the system. For some Web applications, is when cookies are used. A cookie is
application under test. The level of testing the user can register and create an online information stored on the client machine
delete a message. would be sent to the system’s command these parameters it submits a query for a
line and it would start deleting files. five-year set of data with the detailed view
Security holes in the The same principle applies to proprietary for the ticker of “MCD”. Each value is a
program applications. Buffer overflows and escape specific field in a pre-built query that is
During security testing, the tester should characters should not give access to the sent to a database. Then retrieving the
verify that the system is safeguarded operating system. To avoid this security information in the database, the applica-
against a command language invocation hole, test the application for escape char- tion builds a Web page. Based on the pre-
attack. This type of attack attempts to acters. Make sure that the system does not vious example, we can view the chart for
force the server to execute operating sys- rollover to the command line when the IBM, for example, by changing the
tem commands by using escape charac- application receives bad parameters. In the “MCD” to “IBM”.
ters, overflowing the buffer, or overriding above example, perhaps the application
parameters in the programs. The easiest should give a general error message www.server.com/5yr+DetailView+IBM
targets are the default programs included instead.
with a system since these vulnerabilities Now, let’s take this data access a step fur-
are well known. For example, there are Data access through the ther. Let’s say your current URL is this:
several CGI programs that come standard URL
on UNIX. Since anyone with UNIX has Another attack that can be made from the www.server.com/pgm.exe&Function=Re
access to them, malicious users can figure location field of a browser is parameter view&Order=1029343
out how to use or break them. With some tampering. When a malicious user uses
of these programs, if a bad character is this technique they modify the parameters This URL returned a page that reviewed a
sent as a parameter the program will exit of SQL statements in the URL to try to customer order #1029343. Now, what
and then the rest of the command, still in retrieve or modify data. would happen if the server did not verify
the buffer, is executed at the command commands before invoking them? For
line. You may have done something similar to example, if you changed the order num-
save time. Let’s say you are looking up ber, the system would allow you to see
So, let’s say that a backtick was an escape stock prices on a certain site. If you like other orders, as well as the order details.
character that exited a specific program viewing the 5-year chart for the stock per- What if you changed the Function from
named lookup.pl. This program would be formance, but the default chart is the 1- Review to Create, Update, or Delete?
working fine until it attempted to process year chart, you may just go up the URL
the backtick. Upon hitting the backtick and change the Year field. If you want to Some URLs are not that obvious but
character, the program would hit an error switch tickers you may just change it in unless the URL is encrypted it doesn’t take
condition where it failed over to the com- the URL rather than submitting a new very long to figure out the syntax. One
mand line. Everything after the backtick, request through the Submit button. For a preventative measure that sites can use is
still in the buffer, would be executed at the certain application, the URL for the five- passwords or entry codes that change
command line. Imagine what would hap- year, detailed chart of McDonalds might every second. If the command in the URL
pen if you typed in this URL: be: doesn’t have the code-of-the-second, it
www.server.com/cgi-bin/lookup.pl`rm-rf won’t perform the query.
www.server.com/5yr+DetailView+MCD
Other, less destructive attacks might only For a stock application, like we discussed
steal password files or other sensitive data. above, public users can usually view all of
But in this case, the command “rm-rf” When this specific application receives the data. However, with other applications