Static Analysis of a Source Code

938 Words2 Pages

Introduction

The main purpose of performing a static analysis of a source code as far

as web applications auditing is concern is to detect vulnerability. This article

describes therefore an algorithm proposal that will be used to examine two main

PHP source code potential vulnerabilities; LFI (Local File Inclusion) and RFI

(Remote File Inclusion). The approach will be as follow, a de nition of the pat-

tern used to nd such les function whose potential for abuse is very high as a

result of having user inputs that are unhandled, is rst made. In speci c terms,

to detect the vulnerability of this pattern utilizes normal expressions which are

deemed as a fast and uncomplicated technique. In this process some result we

call false positive (FP) will result as a consequence of using, in a safe way, in-

clusion function. The resultant FP's to begin with may come about since this

function's arguments are not part of those variables supplied by the user. To de-

tect the vulnerability in the code lines therefore, an extract of all those variables

supplied by the user is made. Just like a multi-level assignment, vulnerability

on the other hand would spread mound the variables hence also prompting the

extraction of hidden user supplied variables. So in order to decrease these FP's

another pattern de nition is made in order to establish a means of vulnerability

prevention of the inclusion functions.

Despite permitting the generation of extensively used dynamic codes and

indirection multi levels as far as function access and variables are concerned, the

results in a number of similar projects bring to the light that many presented

problems using this approach can be detected and eliminated. This is in spite of

static ana...

... middle of paper ...

...n the areas that pertains the entries should be rmly certi ed

to avoid various security threats. This section will provide some in sight on

the prevention methods of LFI and RFI susceptibilities. Also highlighted are

the various ways to deal with the abuses of le enclosure on websites and more

signi cantly in codes and nally PHP format examples in code will be provided.

One of the best and ecient way is the use of a white le of good recognized

values for example the list of all the areas and the languages that are supported

by the application and at the same time, eliminating any entry that doesn't

meet these criteria or also the ones that do not appear on the list. The next

step is to check the source code after a le has been displayed and included,

therefore, if the code checks, then the it is given access to the le and if not

then it is excluded.

Open Document