
appSQA™ Source Code Audit
Service Specification
- Purpose
- General Description
- General Technical Description
- General Security Environment
- Phase I - Code Security Inspection
- Primary Criteria
- Applications and programming language
- Number of lines of code
- General QA programming considerations
- Function testing
- Secondary Criteria
- CGI functionality
- Corporate security policy
- System/program calls
- User input
- "Exec" tags
- Embedded tags
- Hidden input fields
- Programming Language-specific Inspection Criteria
- Perl
- C/C++
- Phase II - Program Security Testing
- Primary Criteria
- Operating System
- Fault tolerance
- Programming Language
- Secondary Criteria
- File protections
- File storage locations
- Data forwarding
- CGI execution
- CGI crashing
- CGI code access
- CGI write permissions
- appSQA™ Exclusions
- Functionality
- Environment
- Performance
- Stressed Conditions
- Presentation
- Installation
[Top]
-
Purpose
This document is the Service Specification of appSQA™
for DeLiberation™ Extranet Release 2.0.
[Top]
-
General Description
appSQA™ Source Code Audit is a service to test and inspect software developed by third parties for security and QA flaws. The process takes into account the client's application design spec and the known security risks of the operating system. There are two phases of testing:
- Phase I - Code Security Inspection - a formal code review and white box testing
- Phase II - Program Security Testing - black box testing
[Top]
-
General Technical Specification
The appSQA™ specs should adhere to the DeLiberation™
Extranet Release 2.0 General Technical Specification (refer to: http://www.arraydev.com/commerce/delibadmin/delib2).
In case of disagreement, the module's spec takes precedence over the General
Spec.
[Top]
-
General Security Environment
Before implementing appSQA, it is essential that the following security concerns are addressed.
- Check if the site is going to be adequately defended against potential breaks.
- Enquire as to whether the site will be periodically audited by an independent security audit service to reveal shortcomings in the service.
- Ensure that the personnel creating web applications (both in-house and third party) are trustworthy and knowledgeble, and hence won't jeopardize security when running the application, either by neglect or by design (i.e, that software includes independent checks and balances to identify internal staff members who would implement unauthorized code changes, time bombs or malicious attacks from within).
[Top]
Phase I - Code Security Inspection
-
Primary Criteria
-
Applications and programming language
The applications for testing will most likely be CGI or ASP scripts. They may also take the form of an Internet-delivered executable program such as a ActiveX or Java applet, or a browser plugin. There will need to be some testing for any malicious code which may employ helper programs to access sensitive data from a user's hard disk and deliver them to the program's author.
Interpreted languages (e.g. Perl, VBScript, JavaScript) are generally easier to test and debug since they can easily be broken into segments and run separately to determine the cause/effect of operating them. Furthermore, some scripting languages include safety features that can be invoked to determine the suitability of the code.
Compiled code is usually much more difficult to assess and test, especially if modularity is not one of the design features of the application.
For a review of network protection measures to safeguard against poorly
written or malicious Java applets and applications, see:
http://www.networkcomputing.com/904/904ws2.html.
-
Number of lines of code
To ensure that the original developers did a proper job
with their software, sample code (at least 300 lines) will need to be provided
before evaluating whether the code is "testable".
-
General QA programming considerations
Does the client have a good technical spec to test against? If the code is badly written, it will die or provide numerous
opportunities to break into it. This is dependent on the above choices
and the development culture.
-
Function testing
System level functions should be highly encapsulated (and tested) at any system level. Operations should go through these functions, and not access the system directly.
-
Secondary Criteria
-
CGI functionality
Does the CGI meet application requirements? If not, has a
change in implementation affected the way it works to the extent that it
is changing data that should not be changed?
-
Corporate security policy
Does the CGI conform to the client's security policy? If
not, why not? Where it does not conform, is that a 'real' security risk,
or just a breach of corporate rules?
-
System/program calls
Minimize the number of system and external program calls
within the CGI.
-
User input
Ensure that user input is not passed on to system calls or
external programs by the CGI. Ensure that user input does not directly effect anything
at the system level.
-
"Exec" tags
Check "exec" tags for "server-side includes" statements.
-
Embedded tags
If a CGI redisplays user input, check for embedded server side "include" tags if the web server allows them (specifically, the "exec" tag).
-
Hidden input fields
Ensure hidden input fields are not being used to pass off
critical data
-
Programming Language-specific Inspection Criteria
-
Perl
-
Use taint checking (perl -T)
-
In addition, execute perl with -w or 'use strict' mode
to ensure that variable scope does not conflict.
-
C/C++ (and other compiled languages)
-
Check that any character buffers cannot overflow... (may
crash the program and give a hacker access to the system).
[Top]
Phase II - Program Security Testing
- Primary Criteria
-
Operating System
Because each OS has its own peculiarities, the effort
involved is contingent on the OS and its "current" failings. Windows NT-based code, for example, will be examined from the perspective of security risks typical for this OS. In addition, any new security patches available for the OS will be applied where necessary. Patches can be found at a number of websites listed at: http://www.csci.ca/links.htm#patches.
- Fault tolerance
This process involves testing the program under stressed environmental conditions such as low memory, low number of file handles, or low to zero available disk space to determine if a fault results in a security vulnerability or breach.
- Programming Language
Each testing tool should usually be implemented as language-specific.
- Secondary Criteria
-
File protections
Can users write to code files?
-
File storage locations
Is the CGI directory under the umbrella of the web site? If so, it is at risk.
-
Data forwarding
Can users insert data into the mechanism which passes it on to the CGI? If so, it is at risk.
-
CGI execution
Is the CGI execute code extracted from
'passed in' information? If so, it is at risk)
-
CGI crashing
Will the CGI crash if given erroneous data?
If so, it is at risk. What happens when it crashes?
-
CGI code access
Ensure that CGI's are not directly readable via web.
-
CGI write permissions
Ensure that Write permissions are turned off on all CGIs.
[Top]
appSQA™ Exclusions
The section outlines the testing criteria that will NOT be part of the appSQA™ process.
- Functionality
Except as it relates to the announced security features, no special code inspection will be performed to verify that the product operates "as advertised" or that it functions correctly.
- Environment
No network or hardware testing will take place. The server/site, therefore, should be audited prior to a code audit to ensure security of the environment. There will be no testing of whether the application operates with different platforms, applications or browsers.
- Performance
No testing will be done to ensure that the transition and response times fall within specified limits.
- Stressed Conditions
No testing will be done to ensure that the program responds with appropriate messages and actions under low resource conditions. There might, however, be a code audit to reveal if stressed environmental conditions (such as low memory, low number of file handles, or low to zero available disk space) affects security features.
- Presentation
appSQA™ service will not check whether the application displays correctly or that it contains any flaws or inconsistencies in artwork, animation, sounds or spelling.
- Installation
appSQA™ service will only verify that the installation code does not pose a security problem. It will not test whether the installation works properly.
[Top]
Please contact us using email (preferred), fax or by phone, to:
array (at) ARRAYdev.com
Phone: (613)733-0399
Fax: (613)248-4819
[Home]