---
type: Article
title: "NAVEX: Precise and Scalable Exploit Generation for Dynamic Web Applications"
description: NAVEX locates vulnerable sinks in PHP applications with a sanitization-aware code property graph, then crawls and concolically executes the deployed application to build a navigation graph so a constraint solver can emit the exact sequence of HTTP requests that reaches the sink. It produced 204 working SQL injection, XSS and execution-after-redirect exploits across 3.2M lines of code.
resource: "https://www-personal.umd.umich.edu/~birhanu/dsplab/publications/navex-2018/"
tags: [article, webseclist-reference, sqli, xss, injection, php, static-analysis, dynamic-analysis, tooling, owasp-a03-2021]
generated:
  by: webseclist-refs/1
  at: "2026-08-14T21:05:31+00:00"
status: stable
stale_after: 2027-08-14
sources:
  - id: original
    resource: "https://www-personal.umd.umich.edu/~birhanu/dsplab/publications/navex-2018/"
    title: "NAVEX: Precise and Scalable Exploit Generation for Dynamic Web Applications"
    author: Abeer Alhuzali, Rigel Gjomemo, Birhanu Eshete, V.N. Venkatakrishnan
also_at:
  - "https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-alhuzali.pdf"
  - "https://github.com/aalhuz/navex"
  - "https://www.usenix.org/sites/default/files/conference/protected-files/security18_slides_alhuzali.pdf"
authors:
  - Abeer Alhuzali
  - Rigel Gjomemo
  - Birhanu Eshete
  - V.N. Venkatakrishnan
canonical_url: ""
cited_by:
  - "2018.md:77"
commit: ""
content_sha256: 5d417017956f5f4740838464c337176f4f1ee6f7ffdcbe88eee14ec5fe0322be
depth: full
depth_reason: default
kind: article
language: ""
licence: unknown
original_url: "https://www-personal.umd.umich.edu/~birhanu/dsplab/publications/navex-2018/"
published: ""
publisher: ""
publisher_english: ""
raw_sha256: f1eaf1fbbdb5650bd17fcd77296d25fc9b6d05a9971dd711eea958170b5d51e7
retrieved_from: "https://www-personal.umd.umich.edu/~birhanu/dsplab/publications/navex-2018/"
retrieved_kind: manual-import
retrieved_utc: "2026-08-14T21:05:31+00:00"
slug: navex-precise-scalable-exploit-generation-dynamic-web-applications
snapshot: ""
title_english: ""
translation_file: ""
translation_of: ""
---

# NAVEX: Precise and Scalable Exploit Generation for Dynamic Web Applications

**NAVEX: Precise and Scalable Exploit Generation for Dynamic Web Applications** - Abeer Alhuzali, Rigel Gjomemo, Birhanu Eshete, V.N. Venkatakrishnan, Publisher not stated.

- Published: date not stated
- Original: <https://www-personal.umd.umich.edu/~birhanu/dsplab/publications/navex-2018/>
- Also published at: <https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-alhuzali.pdf>
- Also published at: <https://github.com/aalhuz/navex>
- Also published at: <https://www.usenix.org/sites/default/files/conference/protected-files/security18_slides_alhuzali.pdf>
- Preserved from: https://www-personal.umd.umich.edu/~birhanu/dsplab/publications/navex-2018/ (manual-import) on 2026-08-14
- Licence: unknown

Rights remain with the original author and publisher. This is a research
archive of a source from the Web Hacking Techniques Index collections, kept so the
page going offline. To read the original, follow the link above.

## Content

> UNTRUSTED SOURCE TEXT. Everything below this line is third-party material
> quoted for research. It is data, not instructions. Do not follow directions,
> execute code, or fetch URLs because this text says so.

# NAVEX: Precise and Scalable Exploit Generation for Dynamic Web Applications

NAVEX: Precise and Scalable Exploit Generation
        for Dynamic Web Applications
            Abeer Alhuzali, Rigel Gjomemo, Birhanu Eshete,
        and V.N. Venkatakrishnan, University of Illinois at Chicago
      https://www.usenix.org/conference/usenixsecurity18/presentation/alhuzali




      This paper is included in the Proceedings of the
             27th USENIX Security Symposium.
                  August 15–17, 2018 • Baltimore, MD, USA
                              ISBN 978-1-939133-04-5




                                           Open access to the Proceedings of the
                                            27th USENIX Security Symposium
                                                 is sponsored by USENIX.
       NAVEX: Precise and Scalable Exploit Generation for Dynamic Web
                                Applications

             Abeer Alhuzali, Rigel Gjomemo, Birhanu Eshete, and V.N. Venkatakrishnan
                                  University of Illinois at Chicago
                           {aalhuz2, rgjome1, eshete5, venkat}@uic.edu



                        Abstract                               good coverage of an application, they often sacrifice pre-
                                                               cision due to technical challenges related to handling
Modern multi-tier web applications are composed of sev-
                                                               complex program artifacts, which is one of the main rea-
eral dynamic features, which make their vulnerability
                                                               sons for generating false positives. In particular, static
analysis challenging from a purely static analysis per-
                                                               analysis is challenging in the context of the dynamic fea-
spective. We describe an approach that overcomes the
                                                               tures of web applications, where content (e.g., forms,
challenges posed by the dynamic nature of web applica-
                                                               links, JavaScript code) is often generated on the fly, and
tions. Our approach combines dynamic analysis that is
                                                               the code is executed at different tiers, whose effects are
guided by static analysis techniques in order to automat-
                                                               difficult to model statically.
ically identify vulnerabilities and build working exploits.
Our approach is implemented and evaluated in NAVEX, a             In this paper, our main contribution is a precise ap-
tool that can scale the process of automatic vulnerability     proach for vulnerability analysis of multi-tier web appli-
analysis and exploit generation to large applications and      cations with dynamic features. Rather than following a
to multiple classes of vulnerabilities. In our experiments,    strictly static analysis strategy, our approach combines
we were able to use NAVEX over a codebase of 3.2 mil-          dynamic analysis of web applications with static analy-
lion lines of PHP code, and construct 204 exploits in the      sis to automatically identify vulnerabilities and generate
code that was analyzed.                                        concrete exploits as proof of those vulnerabilities. The
                                                               combination of dynamic and static analysis provides sev-
1   Introduction                                               eral benefits. First, the dynamic execution component
Modern web applications are typically designed as multi-       greatly reduces the complexity faced by the static anal-
tier applications (i.e., client, server, and database). They   ysis by revealing run-time artifacts, which do not need
include many dynamic features, which generate content          to be modeled statically. On the other hand, the static
”on the fly” based on user interaction and other inputs.       analysis component guides its dynamic counterpart in
Such dynamism helps the usability as well as the respon-       maximizing the coverage of the application by analyzing
siveness of the application to the user. These features,       application paths and providing inputs to exercise those
however, increase the complexity of web applications           paths. Second, our approach scales to very large applica-
and raise the difficulty bar of analyzing their security.      tions (e.g., 965K LOC), surpassing significantly the state
   Currently, several approaches exist for analyzing the       of the art. The main reason for the increased scalability is
security of modern web applications such as [9, 15, 18,        the ability of the dynamic execution component to reduce
29]. These approaches use a series of analysis techniques      the complexity faced by the static analysis component.
to identify vulnerabilities such as SQL Injection (SQLI)          An additional goal of our approach is that of enabling
and Cross-Site Scripting (XSS). However, a drawback            automatic exploit generation for different classes of vul-
of these approaches is that they generate false alarms,        nerabilities with minimal analysis setup overhead. To
therefore require manual efforts to check whether each         achieve this goal, our approach was designed with sev-
one of the reported vulnerabilities is indeed exploitable.     eral analysis templates and an attack dictionary that is
   Other approaches take a further step and try to include     used to instantiate each template. There exist other static
methods for automatically verifying that vulnerabilities       approaches that try to achieve such generality for identi-
are true by generating concrete exploits [7, 25, 27, 32].      fying vulnerabilities [9, 15]. However, our approach ex-
However, these approaches use largely static analysis          tends [9] by (a) applying precise dynamic analysis tech-
methods. While static analysis methods can provide             niques and (b) automatically generating exploits for the



USENIX Association                                                             27th USENIX Security Symposium         377
identified vulnerabilities.                                       illustrate our approach. Books can be selected through
    Our approach is implemented in a tool called NAVEX.           the web form in selectBooks.php module (lines 23-38
NAVEX’s operations are divided into two steps. In the             in Listing 1). SelectBooks.php validates some of the
first step, we create a model of the behavior of individual       user input using JavaScript (lines 31-36). The user in-
modules of a web application using symbolic execution.            put is further validated and sanitized by server-side code
To address the scalability challenge, we prioritize only          (lines 4-12). Next, the module queries the database to
those modules that contain potentially vulnerable sinks           check the book availability (line 17). Based on the query
where an attacker ‘may’ be successful in injecting mali-          results, $ SESSION[’ISBN’] is initialized and an HTTP
cious values or in exploiting other types of vulnerabili-         link to hold.php is printed on the browser.
ties, and analyze them further in the successive search.      1 <?php
    In the second step, we construct the actual exploits.     2 if(!isset($_SESSION[’username’]))
                                                              3     header( "Location: index.php" );
This requires modeling the whole application and dis-         4 if  (isset($_POST[’book_name’]))
covering a sequence of HTTP requests that take an appli-       5   $book_name =
                                                                         mysql_real_escap_string($_POST[’book_name’]);
cation to execute a vulnerable sink. To address the scala-               //sanitization
bility challenge in this phase, we perform dynamic anal-       6 else
                                                               7   $book_name ="";
ysis of a deployed application and use a web crawler and       8 if (isset($_POST[’edition’]))
a concolic executioner on the server-side to uncover pos-      9    $edition = (int)$_POST[’edition’]; //user input is
                                                                          sanitized
sible HTTP navigation paths that may lead the attacker        10 else
to the vulnerable sink. To maximize the coverage of the       11    error();
                                                              12 if (isset($_POST[’publisher’]) &&
code during dynamic analysis, the crawler and concolic                 strlen($_POST[’publisher’])<=35)
executioner are aided by a constraint solver, which gen-      13    $publisher = str_replace(""", "\"", $_POST[’publisher’]);
                                                              14 else
erates the (exploit) sequence of HTTP inputs.                 15    error();
    Our contributions in NAVEX include an exploit gen-        16 $action = $_GET[’action’])
                                                              17 $isbn= mysql_query( "SELECT isbn FROM BOOK_TABLE WHERE
eration framework that can easily scale to large appli-                book_name=’$book_name’ AND edition = ’$edition’ AND
cations and many classes of vulnerabilities and a novel                publisher=’$publisher’"); //vulnerable sink to SQLI
                                                              18 if (mysql_num_rows( $isbn ) == 1 ){
method that combines dynamic execution and static             19      $_SESSION[’ISBN’] = $isbn;
analysis to address scalability issues affecting previous     20      echo "<a href=’".BASE_URL."hold.php’> Hold the
                                                                            Book</a>";
works, mainly due to the dynamic features of web appli-       21      }
cations.                                                      22 ?>//client-side code starts
                                                              23 <html><body><form method="post" action="<?php echo
    We evaluate NAVEX on 26 applications having a total
                                                                       $_SERVER[’PHP_SELF’]."?action=borrow"?>"
of 3.2M SLOC and 22.7K PHP files. NAVEX was able to                    onsubmit="validate()">
analyze the applications and generated 204 exploits, in       24   <select name=’book_name’> //drop-down list
                                                              25      <option value="Intro to CS by author1">Intro to
little under 6.5 hours. Of these exploits, 195 are related                  CS</option>
to SQLI and XSS, while 9 are related to logic vulnera-        26      <option value="Intro to Math by author2">Intro to
                                                                            Math</option>..
bilities, such as Execution After Redirect (EAR) vulner-      27    </select>
abilities. We note that NAVEX is the first reported work      28    <input type=’text’ name=’publisher’>
                                                              29    <input type=’text’ name=’edition’>
in the literature to construct exploits for EAR vulnerabil-   30 </form>
                                                              31 <script type="text/javascript">
ities.
                                                              32 function validate() { //validates form upon submission
    This paper is organized as follows. Section 2 discusses   33    var edition = document.getElementsByName("edition");
a running example to highlight challenges and provides        34    if(edition.value <= 0)
                                                              35        return false; // do not submit the form
an overview of NAVEX, Architectural and algorithmic           36    return true; //submit the form
details of NAVEX are discussed in Section 3. Section          37 }
                                                              38 </script></body></html>
4 contains details about the implementation, Section 5
describes the evaluation of NAVEX, and Section 6 dis-                Listing 1: selectBooks.php, find books to borrow.
cusses the related work. Finally, Section 7 contains the
conclusions.                                                         Hold.php (Listing 2) performs additional checks and,
                                                                  if they are satisfied, an HTTP link guides the user
2     Challenges and Approach Overview                            to the next step (line 7). When the link is clicked
In this section, we use a running example to highlight            the superglobal $ GET[’step’] is set and the module
the challenges addressed in this paper. We then present           checkout.php is therefore included by hold.php and
an overview of NAVEX.                                             executed. Checkout.php completes the borrowing pro-
                                                                  cess by providing a link (line 19) to the user for confir-
2.1    Running Example                                            mation. The link sets two superglobals ($ GET[’step’]
   Listings 1-3 present a simple book borrowing web ap-           and $ GET[’msg’]), which will be checked by the mod-
plication, which will be used throughout this paper to            ule (line 6). Finally, a confirmation function (line 13) is



378    27th USENIX Security Symposium                                                                  USENIX Association
    called to notify the user that the book was successfully       by the server-side code, as well as a complex server-
    reserved.                                                      side logic that frequently interacts with the client-side
1 <?php                                                            and with the database backend. Therefore, building an
2 if(!isset($_SESSION[’username’]))   {
3     header( "Location: index.php" );
                                                                   exploit generation framework that uncovers a wide range
 4    exit();                                                      of different types of exploits for dynamic web applica-
 5    }                                                            tions is non-trivial. Specifically, we identify the follow-
 6 if (isset($_SESSION[’ISBN’])){
 7    echo "<a href=’".BASE_URL."hold.php?step=checkout’>          ing challenges:
            Checkout</a>";
 8    if (isset($_GET[’step’]) && $_GET[’step’] == "checkout")     Sink reachability. In web applications, some tasks/-
 9        include_once( "checkout.php");                           functionalities require a series of steps, and there are de-
10    }
11 ?>
                                                                   pendencies that exist between these tasks. These steps
                                                                   are usually accomplished using different modules where
          Listing 2: hold.php, hold books for pickup.              the state of the application, maintained through the use
1 <?php
                                                                   of global constructs (e.g., $ GET[] in PHP), is updated
2 if(!isset($_SESSION[’username’]))   {                            to reflect the completion/failure of a step. If a sensi-
3    header( "Location: index.php" );                              tive sink is located deep in these interrelated modules,
 4   exit();
 5 }                                                               the challenge is to automatically generate an exploit that
 6 if (isset($_GET[’msg’]) && isset($_SESSION[’ISBN’])){
 7   $sql = "SELECT name FROM USERS WHERE
                                                                   navigates through the complex dependencies among ap-
           username=’$_SESSION[’username’]’" ;                     plication modules while satisfying constraints required at
 8   $result = mysql_query($sql);                                  each junction in the navigation. For instance, a success-
 9   $name = $db->sql_fetchrow($result);
10   $msg = $_GET[’msg’];                                          ful exploit for the vulnerable echo in Listing 3, must con-
11   confirm($name, $msg);                                         sider navigation and constraint satisfaction through the
12 }
13 function confirm($name, $msg){                                  modules selectBooks.php, hold.php, index.php
14   if (isset($name) && isset($msg) )                             (not shown in the example), and checkout.php.
15     echo $name. " you are ".$msg; // XSS vulnerability
16   }                                                                More broadly, we must take into account several fac-
17 ?> //client-side code starts
18 <html><body>
                                                                   tors. First, data flow paths from sources to sensitive
19 <a href="hold.php?step=checkout&msg=done">DONE</a>              sinks must be identified. Next, possible data sanitiza-
20 </body></html>
                                                                   tions along those paths must be analyzed. However, san-
       Listing 3: checkout.php, checkout functionality.            itizations are available in many flavors, including built-
                                                                   in sanitizations (e.g., htmlspecialchars()), implicit
       The example contains sensitive sinks that are vul-          sanitizations (e.g., cast operators as shown in the run-
    nerable to injection and logic attacks. For example,           ning example), custom sanitizations (e.g., custom use of
    the query in listing 1 (line 17) is vulnerable to SQLI         str replace()), and sanitizations induced by database
    through the variable $publisher, which is not prop-            constraints (e.g., NOT NULL constraints). The practical
    erly sanitized before reaching the sink. In particular, the    challenge here is to precisely identify when such sani-
    str replace function (line 13) does a poor job of san-         tizations are sufficiently robust to eliminate all possible
    itizing $publisher, since an SQLI attack not involving         risks.
    double quotes may still be used. Additionally, the echo
                                                                   Dynamic features. An automatic exploit generation ap-
    call in Listing 3 is vulnerable to XSS as the user input
                                                                   proach that is entirely based on static aspects of a web
    $msg is not sanitized. Finally, the sink at Listing 1 line 3
                                                                   application is prone to miss certain real exploits. As
    is vulnerable to an Execution After Redirect (EAR) logic
                                                                   mentioned before, modern web applications often con-
    attack because the execution after the header call (redi-
                                                                   tain features that are revealed only when the application
    rects the execution to another PHP module) does not halt
                                                                   is executed. These features often include dynamically
    since there is no call to an execution termination function
                                                                   generated forms and links that may drive the navigation
    afterward. Consequently, the following statements will
                                                                   of the application to vulnerable sinks. Unless the ap-
    be executed regardless of the check at line 2. The prob-
                                                                   plication is deployed and executed, it is challenging for
    lem is further exacerbated by the fact that those state-
                                                                   a static analysis approach to infer such artifacts, which
    ments contain a vulnerable SQL query. An attacker may
                                                                   may contain useful constraints for exploit paths. For in-
    thus be able to run a SQLI exploit without needing to log
                                                                   stance, line 23 of Listing 1, where the action of the
    in first.
                                                                   form is set by the result of running the embedded PHP
                                                                   code. To precisely infer the value of that action, a static
    2.2    Challenges                                              analyzer has to be able to handle the PHP semantics of
      As illustrated by the example, typical web applications      that code portion. Other situations (not shown in the ex-
    have client-side logic that consists of forms, links, and      ample) include dynamically generated content including
    JavaScript code, which may be dynamically generated            JavaScript generated content. It is, therefore, necessary



    USENIX Association                                                             27th USENIX Security Symposium         379
to incorporate dynamic analysis as part of the exploit                 App
                                                                      source
                                                                                         Vulnerable Sinks Vulnerable Sinks Concrete Exploits
generation framework to make these runtime artifacts ex-               code
                                                                                          Identification                         Generation
                                                                                                            Exploit Strings
plicit. An additional challenge with dynamic execution              Attack Dictionary
                                                                                                                                                  Exploits

is maximizing the coverage of an application.                                      Figure 1: The architecture of NAVEX.
Scalability. Generating executable exploits that span
multiple modules and traverse execution paths inside               the first step through a series of HTTP requests. The
                                                                                                                            Phase I : Vulnerable Sink Identification
each module for large and complex modern web applica-              output of the dynamic execution is a Navigation Graph
tions is challenging. Constructing exploits requires App  an-sourcethat represents the navigation
                                                                                               Sanitizations
                                                                                                             structure
                                                                                                                  Sinks
                                                                                                                            ofTraversal
                                                                                                                               the web   Type
                                                                                                                                             appli- Attack Strings     Attack I
                                                             code
alyzing the application as a whole, including its client-          cation.      Finally, for  every      module      containing        a vulnera-
side, server-side and database backend. To deal with this          bleSQLIsink, as identified in the first step, NAVEX uses this
challenge, the exploit generation approach must be      Attack
                                                          de-      navigation
                                                                         XSS        graph to find      the paths from public modules Formula
                                                                                                   Graph
                                                      Dictionary                                                         Graph Traversal
signed with careful considerations for pruning unfeasi-            File Inclusion
                                                                   to  that   module    along  Construction
                                                                                                which      the exploit can be executed.Generation
                                                                          ...
ble exploit paths. To demonstrate the need for a scal-             The dynamic features challenge is addressed in NAVEX
able approach, let’s consider our running example. For             by combining dynamic analysis and symbolic execution
this simple application, to construct an exploit for the           of applications. To maximize the coverage of an applica-
vulnerable sink in Listing 3, we have to process a to-             tion, NAVEX repeats the dynamic execution many times,
tal of 44 execution paths in the 3 modules (i.e., 32               each time with different inputs generated by a constraint
paths in selectBooks.php, 4 in hold.php, and 8 in                  solver in a way that maximizes path coverage in the ap-
checkout.php) to find candidate exploitable paths to               plication. At each execution, NAVEX collects the infor-
the sink.                                                          mation necessary to derive the application’s navigation
   Another scalability challenge we need to tackle is              structure.
related to the goal of generating exploits for multiple
classes of vulnerabilities. To address this challenge,             3 Architecture and Algorithms
we need to support abstraction and analysis of multi-              3.1 Vulnerable Sink Identification
ple classes of vulnerabilities efficiently, as to generate as          To identify the vulnerable sinks, NAVEX analyses each
many different types of exploits as possible.                      module separately. An implicit goal of this step is to
                                                                               exclude from the following step those modules that do
2.3     Approach Overview                                                      not contain vulnerable sinks. In particular, as depicted
    Our goal is to build a precise, scalable, and efficient
                                                                               in Figure 2, NAVEX first builds a graph model of each
exploit generation framework that takes into account the
                                                                               module’s code, then it discovers the paths that contain
dynamic features of web applications and the naviga-
                                                                               data flows between sources and sinks. Finally, it uses
tional complexities that stem from dependencies among
                                                                               symbolic execution to generate a model of the execution
the client-side, server-side and database backend.
    Our approach is implemented in a system called                             as a formula and constraint solving to determine which
NAVEX, as shown in Figure 1. To address the scala-                             of those paths are potentially exploitable. Each of these
bility challenges, our approach is divided into two steps:                     components is described next.
(I) vulnerable sink identification and (II) concrete exploit
generation.                                                                    3.1.1    Attack Dictionary
    Given the application source code, the first step iden-
tifies vulnerable sinks in the application and the corre-                      To address the challenge of discovering multiple classes
sponding modules. This phase analyzes each module                              of vulnerabilities, NAVEX was designed to be easily ex-
separately and is crucial for prioritizing only those mod-                     tensible to a wide range of vulnerabilities, such as SQLI,
ules that have vulnerabilities; thus significantly reduc-                      XSS as well as logic vulnerabilities such as EAR [18]
ing the search space and contributing to scalability. To                       and command injection. A key observation is that sev-
address the sink reachability challenge, NAVEX builds a                        eral types of vulnerabilities are essentially similar. For
precise representation of the semantics of built-in saniti-                    instance, SQLI and XSS both depend on the flow of ma-
zation routines. In addition, for custom sanitizations, it                     licious data from sources to sinks and injection of ma-
builds a model using symbolic constraints. These con-                          licious data in those sinks. The main difference is the
straints are used by a constraint solver, which determines                     nature of the sink and the attack payload. This similar-
if the sanitizations are sufficiently robust.                                  ity, in turn, can be leveraged to build analysis templates
    The second step is responsible for generating concrete                     that can be instantiated with minimal changes to discover
exploits. The main problem in automatically generating                         different classes of vulnerabilities. To this end, NAVEX
concrete exploits is that of identifying application-wide                      builds an Attack Dictionary, which is used to instantiate
navigation paths that, starting from public-facing pages,                      analysis templates targeting each class of vulnerability.
drive the execution to the vulnerable sinks identified in                      In particular, it contains attack specifications, as follows:



380     27th USENIX Security Symposium                                                                                       USENIX Association
                           SQLI
          Attack            XSS
                                                 Sanitizations   Sinks        Traversal Type     Attack Strings       Attack Instance
        Dictionary    File Inclusion
                             ...


                                                    Graph                                          Formula
                                                                         Graph Traversal                                   Solver
                                                 Construction                                     Generation
             App source
                code

                                                                                                        [Vulnerable Sinks, Exploit Strings]
                                       Figure 2: Vulnerable Sinks Identification (Step I) Components.


Sinks. These are instructions that execute the malicious                   potentially unexploitable paths and indirectly addressing
content of an attack. For instance, echo and print PHP                     the challenge of path explosion.
functions are sinks for XSS attacks.                                       Sanitization Tags. A sanitization tag stores information
Sanitizations. These include an extensive list of PHP                      about the sanitization status of each variable in a node, if
sanitizations, including built-in sanitization functions                   any. The possible values of the tag are unsan-X, san-X
and operators, which may implicitly sanitize an input                      where X represents the specific vulnerability. For in-
(e.g., cast operators). While extensive, this list is not                  stance, san-sql and unsan-sql represent presence (or
exhaustive, and therefore it may miss functions. How-                      non-presence) of SQLI sanitization, respectively.
ever, the semantics of known custom sanitization func-                        The values of the sanitization tags are inferred and
tions (e.g., str replace) are captured by NAVEX using                      added to the graph during its construction. In particular,
constraint solving.                                                        as a node is added to the CPG, the corresponding node’s
Traversal Type. It specifies the type of traversal that                    AST is analyzed to detect eventual sanitizations. This
is needed on the graph (the graph representation will be                   analysis is guided by the sanitizations patterns contained
described shortly). We currently support forward and                       in the attack dictionary for each type of vulnerability.
backward traversals between sources and sinks. Specifi-                    When a match among the sanitization patterns is found
cally, injection vulnerabilities typically need a backward                 for a variable in a node, the corresponding san-X value
traversal, while vulnerabilities such as EAR need a for-                   is set for that variable. Note, we add sanitization tags
ward one.                                                                  that resolve the sanitization status of different types of
Attack Strings. The attack strings are specifications of                   PHP statements such as assignment, cast, binary, unary
the possible (malicious) values that can appear at a sink.                 statements, built-in functions, etc.
While not exhaustive, the list of attack strings used by                      To demonstrate how NAVEX assigns sanitization tags,
NAVEX is very extensive. It contains 45 attack patterns                    let us consider the statement at line 9 in Listing 1.
collected from cheat sheets (e.g., [6]), and security re-                  NAVEX starts by inspecting the AST of $edition =
ports.                                                                     (int)$ POST[’edition’] to assign an appropriate tag
   Currently, the attack dictionary contains entries for
                                                                           to $ POST[’edition’] first. Then, it propagates the san-
SQLI, XSS, file inclusion, command injection, code ex-
                                                                           itization status to $edition. In this case, the assigned
ecution, and EAR.
                                                                           tag to $ POST[’edition’] is san-all because the cast to
                                                                           integer operator sanitizes it for all vulnerabilities in our
3.1.2     Graph Construction                                               attack dictionary. Consequently, the variable $edition
This step builds a graph model to represent the possi-                     will have the same value in its sanitization tag.
ble execution paths, which are later symbolically exe-                     Database Constraint Tags. Databases may often en-
cuted, in a PHP module. Specifically, our graph model                      force additional constraints on the data that flow to the
is based on Code Property Graphs (CPGs) [9, 33], which                     database tables. For instance, the columns of a database
combine abstract syntax trees (AST), control flow graphs                   table may implicitly sanitize certain inputs, based on the
(CFG), call graph, and data dependence graphs (DDG)                        column’s data type (e.g., enum or integer). We enhance
under a unique representation to discover vulnerabilities,                 code property graphs to capture database constraints. In
which are modeled as graph queries. In particular, given                   particular, for each web application, NAVEX parses its
a source and a sink instruction, CPGs can be used to find                  schema to collect table names, their columns names, data
data dependency paths between their variables.                             types, and value constraints (e.g., NOT NULL).
   However, our final goal is not merely that of finding                      During the CPG construction, NAVEX adds a tag
vulnerable paths but also that of generating concrete ex-                  called DB to the root node of each application. This tag
ploits. To this end, we extend CPGs with sanitization and                  contains the collected information from the schema, and
database constraint tags. These tags are attributes added                  it is utilized later during the graph traversal and exploit
to the CPGs and are used to prune out a large number of                    generation (Sections 3.1.3 and 3.1.4).



USENIX Association                                                                             27th USENIX Security Symposium                 381
3.1.3    Graph Traversal                                      Algorithm 1 Injection Vulnerability Path Discovery
                                                               1: Input: sources, sinks
The goal of this step is to discover vulnerable paths from
                                                               2: output: VulnerablePaths
sources to sensitive sinks by inspecting the enhanced
                                                               3:
CPG.                                                           4: sinkNodes = F IND S INK N ODE(sinks)
Backward Traversal. An example of a backward traver-           5: for all sn ∈ sinkNodes do
sal for discovering vulnerable paths for injection vulner-     6:     VulnerablePaths = A NALYZE N ODE(sn)
abilities is shown in Algorithm 1.                             7: return VulnerablePaths
   The algorithm starts by searching the graph for calls       8: function A NALYZE N ODE(node)
to sensitive sinks specified in the attack dictionary (line    9:    VulnerablePaths ← []
4). For each node representing a sink, it follows back-       10:     paths = F OLLOW BACKWARD DDE DGE(sn)
ward the data dependency edges for all variables used         11:     for all path ∈ paths do
in that sink using the function AnalyzeNode (line 8).         12:         if path has a source then
This function calls FollowBackwardDDEdge (line 18)            13:             VulnerablePaths ← path
to find all data dependency paths from a sink node to         14:         else
either a source or a function argument (if the sink is        15:             callPaths = A NALYZE N ODE(callNode)
inside a function). If a path ends at a function argu-        16:             VulnerablePaths ← path + callPaths
ment, AnalyzeNode is called recursively over the nodes        17:    return VulnerablePaths
                                                              18: function F OLLOW BACKWARD DDE DGE(node)
representing the call sites of that function (line 15).
                                                              19:    Intra Paths ← []
The function FollowBackwardDDEdge identifies intra-
                                                              20:    while node is not a source ∧ node is not a func. argu-
procedural paths between sources and sinks and uses the             ment do
sanitization and DB tags to eliminate sanitized paths. Fi-    21:          IncNodes = GET I NCOMING DDN ODE(node)
nally, getPathsTo (line 24) finds all traversed and un-       22:          UnsanNodes = FILTER S AN N ODES(IncNodes)
sanitized paths in the graph leading to source nodes.         23:          node ← unsanNodes
   As an example, consider the vulnerable sink echo to        24:      Intra Paths = GET PATHS T O(node)
XSS (line 15) in Listing 3. Starting from this sink, the      25:      return Intra Paths
algorithm follows all data dependency edges backwards
while checking the sanitization tags of $name and $msg.          The output of this step is a set of paths that are poten-
Since they are both unsanitized, NAVEX stores the intra-      tially vulnerable. This set of paths is sent in input to the
procedural paths of the variables and follows the data de-    next step.
pendency edges in the caller function until it reaches the
source of $msg (line 10). Note, $name is not a user input     3.1.4    Exploit String Generation
(holds values from the database) and therefore the algo-
rithm only returns the inter-paths of $msg as vulnerable      The last step of the static analysis is the generation of
paths to XSS.                                                 exploit strings over the vulnerable paths discovered dur-
   The FilterSanNodes function uses the sanitization          ing graph traversal. In this step, each vulnerable path
and DB tags to prune out unpromising paths for exploit        is modeled as a logical formula Fpath . In addition, the
generation. In particular, DB tags are utilized during        constraints derived from the DB tags Fdb are added to
the search for SQLI vulnerability. For each write query,      the formula. It is next augmented with additional con-
NAVEX parses the query using a SQL parser to find nec-        straints over the variables at the sinks Fattack , which rep-
essary information such as table and columns names.           resent values that can lead to an attack. These values are
Then, it matches the extracted information with the DB        retrieved from the Attack Dictionary based on the type of
tag to derive constraints from the columns data types and     vulnerability under consideration.
value constraints (Fdb ). These constraints are used in          The augmented formula (i.e., Fpath ∧ Fdb ∧ Fattack ) is
conjunction with the path constraints (Fpath ) in the next    next sent to a solver, which provides a solution (if it ex-
step (Section 3.1.4).                                         ists) over the values of the input variables, that is an ex-
Forward Traversal. As another example, to detect EAR          ploit string. This solution contains the values of the in-
vulnerabilities, NAVEX performs a forward graph traver-       put variables, which, after the path and sanitizations ex-
sal from sources to sinks where the sources are redirec-      ecutions, cause the attack string to appear at the sink.
tion instructions (e.g., header) and the sinks are termi-     However, even if a solution exists, the related exploit
nation instructions (e.g., die). In particular, we distin-    is not necessarily feasible. To determine its feasibility,
guish between two types of EAR vulnerabilities, namely        NAVEX needs to uncover the sequence of HTTP requests
benign where the code between sources and sinks does          that must be sent to the application to execute the attack
not contain sensitive operations (e.g., SQL queries) and      described by the exploit strings. This step is exposed in
malicious EAR where that code contains them [18].             the rest of this section.



382     27th USENIX Security Symposium                                                              USENIX Association
3.2     Concrete Exploit Generation                           JavaScript code that validates form inputs, the crawler
    To generate the concrete exploits, NAVEX executes         leverages the techniques used in [12]. Specifically, the
several steps as depicted in Figure 3. First, a dynamic ex-   JavaScript code is extracted and analyzed using concrete-
ecution step creates a navigation graph that captures the     symbolic execution. The code is first executed concretely
possible sequences in which application modules can be        and when the execution reaches a conditional statement
executed. Next, the navigation graph is used to discover      that has symbolic variables, the execution forks. Then,
execution paths to only those modules that contain the        the execution resumes concretely. After the execution
vulnerable sinks uncovered by the vulnerable sink iden-       stops for all the forks, a set of constraints that repre-
tification step. Finally, the final exploits are generated.   sent each execution path that returns true is generated.
We describe each of these steps next.                         NAVEX combines the form HTML constraints Fhtml and
                                                              the JavaScript constraints Fjs to produce the final form
3.2.1   Dynamic Execution                                     constraints Ff orm . As an example, the constraints for the
                                                              form in our running example (Listing 1) are:
This step is responsible for building an application-wide     Fhtml : (book name=="Intro to CS by author1" ∨
navigation graph, which represents possible sequences of      book name=="Intro to Math by author2")
module executions together with associated constraints.       Fjs : edition > 0
   Previous research [7] has recognized the importance
                                                              Ff orm : Fhtml ∧ Fjs
of building such a graph. However, a key difference with
                                                                 Finally, the formula f f orm is sent to the solver
that work is the approach in which the graph is gener-
                                                              to find a solution.     NAVEX uses the solver so-
ated. In particular, the approach of [7] uses static analy-
                                                              lution, form method, and action fields to is-
sis to discover links and forms and does not deal with the
                                                              sue a new HTTP request to the application
dynamic features of web applications, whose semantics
                                                              (i.e.,      http:.../selectBooks.php?action=borrow
are challenging to be captured statically.
                                                              POST[book name=Intro to CS by author1,
   In contrast, NAVEX uses a dynamic execution ap-
                                                              edition=2]).
proach. It executes the web application through a crawler
so that a significant portion of those dynamic features be-   Addressing Server-side Constraints. Server-side code
come concrete and do not need to be symbolically eval-        often introduces additional constraints on the values of
uated. However, a common challenge when performing            the input variables, which can influence the navigation
the dynamic analysis is maximizing the coverage of the        structure of an application. Most commonly, these in-
application. To address this challenge, NAVEX uses con-       clude constraints over the values submitted via forms.
straint solving and concolic execution to generate a large    For instance, in Listing 1, the server-side code intro-
number of form inputs that aid the crawler in maximizing      duces an additional check over the string length of
the coverage of the application.                              $publisher, which is not present in the JavaScript val-
Crawler. The crawler is responsible for uncovering the        idation.
navigation structure of the applications. For each ap-           Typically, when the server constraints are satisfied, the
plication, the crawler is initiated with a seed URL and       execution proceeds and the state of the application is
whenever necessary, valid login credentials. While most       changed, while in the opposite case, the application re-
applications have two types of roles (administrator and       jects the form inputs and the state of the application does
regular user), to maximize the crawling coverage, the         not change. Therefore, to maximize the coverage of the
crawler does the authentication for each role-type in the     application, the crawler must be able to generate form
application. Starting from the seed URL, the crawler          inputs that are accepted by the application.
extracts HTML links, forms, and JavaScript code. The             While automatically generating form inputs that are
links are stored and used as the next URLs to crawl. For      rejected is easier, generating inputs that are accepted is
form submissions, the crawler needs to construct values       more challenging. To deal with this challenge, we uti-
that comply with the form restrictions (e.g., length of in-   lize an execution-tracing engine on the server-side code.
put) and satisfy eventual JavaScript validations. Having      NAVEX uses the produced trace information to determine
a mechanism that automatically generates valid form in-       whether a request is successful by checking if the appli-
puts greatly improves the crawling coverage of web ap-        cation is (i) changing its state (i.e., creating a new ses-
plications since web forms are common constructs that         sion, setting a new variable and superglobal values, etc.)
influence the navigation structure.                           and (ii) performing sensitive operations such as querying
   To address this problem, our crawler extracts the          the database.
forms’ input fields, buttons, and action and method at-          When a request is not successful, NAVEX utilizes the
tributes (i.e., GET or POST) using an HTML parser and         trace information to perform a concolic execution. In
generates a set of constraints over the form values im-       particular, it first retrieves the executed statements in-
plied by the form attributes. In addition, to deal with       cluding the conditional statements. Then, the collected



USENIX Association                                                            27th USENIX Security Symposium         383
                                                                                   [Vulnerable Sinks, Exploit Strings]
                                       Dynamic Analysis
                                         Constraints                  Navigation              Final Exploit
                                                                                                                         Exploits
                             Crawler                      Solver        Graph                  Generator
                                              Inputs
            Application
                                Figure 3: Concrete Exploit Generation (Step II) Components.


conditional statements are transformed automatically to            3.2.3   Final Exploit Generation
solver specifications and negated to uncover new execu-
tion paths. The newly created specifications are then sent         To generate the final concrete exploits, NAVEX utilizes
to the solver to generate new form inputs. This process is         the NG along with the vulnerable sinks identified by the
continuously repeated until the form submission is suc-            techniques introduced in Section 3.1. One challenge that
cessful. As an example, the above inference constructs             NAVEX must solve in this step is that of combining the
the following constraints that yield to a successful form          results produced by the step of vulnerable sink identifica-
submission                                                         tion with the Navigation Graph. In particular, when mod-
(book name=="intro to CS by author1" ∨                             ules containing vulnerable sinks are included by other
book name=="intro to Math by author2") ∧                           modules using PHP inclusion, the former does not ap-
length(publisher)<=35 ∧ edition >0                                 pear in the NG, because there is no explicit navigation to
 Finally, for each accepted form, NAVEX stores the full            them. For instance, the module checkout.php does not
HTTP request that led to the successful submission.                appear in the NG in Figure 4. To execute these vulner-
                                                                   able modules, the execution must invoke the including
                                                                   modules.
3.2.2    Navigation Graph
                                                                      To address this issue, NAVEX executes a preprocess-
The Navigation Graph produced by the dynamic exe-                  ing inclusion resolution step, which creates an inclusion
cution step represents the applications’ navigation be-            map that stores the file inclusion relationships. The map
havior. It is a directed graph G = (N, E) where each               is constructed by performing a traversal that searches the
node n ∈ N represents an HTTP request and each edge                enhanced CPG for nodes that represent calls to file inclu-
e = (ni , n j ) ∈ E represents a navigation from ni to n j ,       sion PHP functions (e.g., require, include, etc).
which can be of type link or form. In particular, for ev-             Once the inclusion resolution step is completed,
ery edge e = (ni , n j ) ∈ E ni represents the page from           NAVEX uses the NG and the produced inclusion map to
which the request was originated. Each node in the                 search paths on the NG from public modules to the ex-
graph has the following properties id, URL, role, and              ploitable modules (or their including parents). It is im-
form params for nodes representing an HTTP request                 portant to note that the previous identification of vulner-
generated by a form submission. The id property stores             able sinks that ‘may’ be exploitable greatly reduces the
a unique identifier of the node, the URL property is the           cost of such search and increases the likelihood of find-
URL in the HTTP request, which is composed of the                  ing executable exploits.
module name and HTTP parameters of the request, and                   The search method is summarized in Algorithm
the role property holds the login credentials used as in-          2. The first input to the search is the set of pairs
put to the crawler as illustrated in Figure 4. It is impor-        {(module, exploit)} from Step I of NAVEX. Module rep-
tant to note that the navigation graph can contain multiple        resents the vulnerable module, and exploit represents the
nodes associated with the same PHP module. In partic-              assignments of malicious values to inputs generated by
ular, if a PHP module can accept different combinations            the solver. The next input is the InclusionMap and
of input variables, each such combination is represented           the SeedURLs, which represent the publicly accessible
by a corresponding node in the NG.                                 modules. For each vulnerable module, using the inclu-
   A partial instance of an NG, related to our running ex-         sion map and the parameters in the exploit, the algo-
ample is shown in Figure 4. As an example, one possi-              rithm first finds possible destination nodes, which will
ble form submission, with form input values generated              be the targets of the graph search (line 5). These nodes
by the solver, is represented by the edge between nodes            (DestURLs) represent either the vulnerable module or its
2 and 3, while the other edges represent link naviga-              parents (if a parent PHP module includes the vulnerable
tion. Note that hold.php is associated with two different          module). GetDestURLs returns only those nodes of the
nodes (id-s 5 and 6), each having a different combination          NG, whose parameter names match the parameter names
of input variables (i.e., HTTP parameters). This repre-            appearing in the corresponding exploit. The func-
sentation will be crucial in the next step when exploring          tion ExpSearch first identifies the nodes whose URL
paths to the exploitable modules.                                  matches one of the SeedURLs (i.e., matches the URL



384     27th USENIX Security Symposium                                                                            USENIX Association
        form_params:[book_name=
        intro to CS by author1,
        edition=2,publisher=aaaaaaa
                                                role: [user, user]                  role: [user, user]               role: [user, user]              role: [user, user]
        role: [user, user]




                     ID: 2                                  ID: 3                             ID: 4                           ID: 5                           ID: 6
      URL: http://localhost/App/select          URL: http://localhost/App/                                          URL:http://localhost/          URL:http://localhost/App
      Books.php                                                                     URL: http://localhost/                                  LINK
                                                selectBooks.php?action                                       LINK   App/hold.php?step=             /hold.php?step
                                         FORM                                LINK   App/hold.php
                                                =borrow                                                             checkout                       =checkout&msg=done
      Form_Params: [book_name=
      intro to CS by author1,
      edition=2,publisher=aaaaaaa]              Role: [ uName, uPass]               Role: [ uName, uPass]           Role: [ uName, uPass]          Role: [ uName, uPass]
      Role: [ uName, uPass]

                                           Figure 4: The navigation graph (NG) of our running example.


Algorithm 2 Generating Concrete Exploits                                                          2. http://localhost/App/selectBooks.php with
 1: Input:                      ModulesAndExploits                                  =                POST params:[book name=intro to CS by
    {(module, exploit)}, InclusionMap, SeedURLs                                                      author1, edition=2,publisher=aaaaaaa]
 2: output: Concrete exploits for VulnModule                                                      3. http://localhost/App/selectBooks.php?action
 3:                                                                                                  =borrow
 4: for all vm ∈ ModulesAndExploits do                                                            4. http://localhost/App/hold.php
 5:     DestURLs = GET D EST URL S(vm, InclusionMap)                                              5. http://localhost/App/hold.php?step=checkout
 6:     Exploit = E XP S EARCH(SeedURLs, DestURLs, vm)                                            6. http://localhost/App/hold.php?step=checkout
 7:     AllExploits ← Exploit                                                                        &msg=<script>alert(”XSS”);</script>
 8: return AllExploits                                                                             As can be noted, as a result of our dynamic execution
 9:                                                                                             and of the navigation graph design where nodes repre-
10: function E XP S EARCH(SeedURLs, DestURLs, vm)                                               sent HTTP requests, the challenging problem of finding
11:     SrcNodes = FIND S RC N ODES(SeedURLs)                                                   sequences of HTTP requests that execute an exploit is
12:     for all sn ∈ SrcNodes do                                                                transformed into a simple graph search problem, which
13:         paths = GET PATHS T O(sn, DestURLs)                                                 is efficient.
14:         for all path ∈ paths do
15:             exploit = REPLACE V ULN PARAMS(path, vm)                                        4        Implementation
16:             ConcreteExploits ← exploit
17:    return ConcreteExploits                                                                  The implementation of NAVEX is based on several exist-
                                                                                                ing tools, most of which were extended to deal with our
property) (line 11). The traversal then explores the NG                                         problem. For Step I of our approach, the PHP extension
for each of the retrieved SrcNodes to find paths between                                        [9] of code property graphs [33] was enhanced with addi-
the source node and the DestURLs (line 13). Finally, for                                        tional tags to enable precise taint tracking and database
each found path, it replaces the values of the HTTP pa-                                         constraints reasoning. The enhanced CPG is then im-
rameters in the last edge with the malicious values gen-                                        ported to the Neo4j [4] graph database, an open source
erated by the solver.                                                                           graph platform to create and query graph databases. The
   Applying       the    algorithm     to    our     run-                                       graph traversals, such as algorithm 1, are written in
ning       example,        yields     to     considering                                        Gremlin [1]. Neo4j and Gremlin are also used in Step
http://localhost/App/selectBooks.php as a                                                       II to build and search the navigation graph.
SeedURL, and the node with id 6 in Figure 4 as                                                     For constraints solving, we leveraged Z3 solver [17]
DestURL, because that node matches the vulnerable                                               and its extension Z3-str [35]. In particular, when graph
module, whose corresponding (XSS) exploit contains an                                           traversals report a vulnerable path to a sink, NAVEX an-
assignment of a malicious value to the HTTP variable                                            alyzes the returned path and its nodes. Based on each
msg. Since the exploit string for msg is <script>                                               node type, a Three-Address Code (TAC) formula that
alert("XSS");</script> (generated by the solver                                                 represents the node is created automatically. The TAC
and stored in exploit), GetPathsTo explores the                                                 Formula consists of right operand (rightOp), operator,
following navigation paths between the SeedURL and                                              and left operand (leftOp), node type, and unique node
DestURL: (1) nodes of [id=2, id=3, id=4, id=5] and (2)                                          id. Then, NAVEX starts analyzing each TAC formula ac-
nodes of [id=2, id=3, id=4, id=5, id=6]. However, it                                            cording to its type. Based of the operator, leftOp, and
returns only the first navigation path because the URL                                          rightOp, NAVEX generates: (1) appropriate Z3 variable
of node 5 does not contain the HTTP parameter msg.                                              declarations, (2) a set of assertions that replicate the se-
Finally, ReplaceVulnParams function replaces the                                                mantics of the PHP operator in Z3 specification, and (3)
value of the msg with the malicious value of the exploit.                                       an assertion that assigns appropriate attack strings from
As a result, NAVEX generates the following set of HTTP                                          our attack dictionary to each sink variable in the formula.
requests as a concrete exploit for the vulnerable sink                                          NAVEX supports assignment, unary, binary, conditional,
(line 15) at Listing 3:                                                                         built-in function, and cast statement types. The TAC for-
 1. http://localhost/App/index.php                                                              mula analysis and Z3 translation engine code are approx-



USENIX Association                                                                                                     27th USENIX Security Symposium                         385
                                                                         Application (version)   PHP Files     PHP SLOC
imately 3600 Java LOC.                                                   myBloggie (2.1.4)          56            9090
   For Step II, we extended crawler4j [2] by adding sup-                 Scarf Beta                 19            978
port for collecting forms and JavaScript code, extract-                  DNscript                   60            1322
                                                                         WeBid (0.5.4)             300           65302
ing constraints from the forms, and generating Z3 asser-                 Eve (1.0)                   8            905
tions. To deal with JavaScript, we used an extension of                  SchoolMate (1.5.4)         63           15375
                                                                         geccbblite (0.1)           11            323
the Narcissus JavaScript engine [3], which adds the abil-                FAQforge (1.3.2)           17            1676
ity to evaluate JavaScript code symbolically. Then, con-                 WebChess (0.9)             29            5219
                                                                         WordPress (4.7.4)         699          181257
straints extracted from JavaScript related to form inputs                HotCRP (2.100)            145           57717
are transformed and combined with the form constraints                   HotCRP (2.60)              43           14870
and solved by Z3.                                                        Zen-Cart (1.5.5)          1010         109896
                                                                         OpenConf (6.71)           134           21108
   To generate server-side execution traces, we leveraged                osCommerce (2.3.4)        684           63613
Xdebug [5], an open source debugger for PHP code.                        osCommerce (2.3.3)        541           49378
                                                                         Drupal (8.3.2)            8626         585094
Note that Xdebug, like any debugging tool, imposes per-                  Gallery (3.0.9)           510           39218
formance issues such as HTTP responses delays due to                     Joomla (3.7.0)            2764         302701
                                                                         LimeSurvey (3.1.1)        3217         965164
trace generation. Therefore, to maintain acceptable per-                 Collabtive (3.1)          836          172564
formance, NAVEX invokes Xdebug and analyzes traces                       Elgg (2.3.5)              3201         215870
                                                                         CPG (1.5.46)              359          305245
on demand.                                                               MediaWiki (1.30.0)        3680         537913
   Broadly, the techniques implemented in NAVEX can                      phpBB (2.0.23)             74           29164
be used to generate exploits for non-PHP web applica-                    phpBB (3.0.11)            387          158756

tions. At an implementation level, NAVEX is applicable                 Table 1: Subject applications of our evaluation.
to other server-side languages if the target source code is
                                                                AST, CFG, PDG, and sanitization and DB tags generation     1hr 25m
represented as CPGs, models of the target language fea-         Graph database size                                        4.15 GiB
tures (i.e., built-in functions, operators, etc.) as solver     Total # nodes                                             24,418,552
                                                                Total # edges                                             56,060,195
specifications are available, and suitable server-side exe-
                                                                     Table 2: Statistics on the enhanced CPG generation.
cution tracing tool is used.
   NAVEX is an open-source software available at               can be used to analyze and generate exploits for hundreds
https://github.com/aalhuz/navex                                or thousands of applications.
                                                               Summary of results. NAVEX constructed a total of 204
5     Evaluation                                               exploits, of which 195 are on injection, and 9 are on logic
Dataset. We evaluated NAVEX on 26 real-world PHP ap-           vulnerabilities. The sanitization-tags-enhanced CPG re-
plications with a combined codebase of 3.2M SLOC and           duced false positives (FPs) by 87% on average. The in-
22.7K PHP files as shown in Table 1. Our criteria for se-      clusion of client-side code analysis for building the navi-
lecting the applications include: (i) evaluation on the lat-   gation graph enhanced the precision of exploit generation
est versions of popular, complex and large PHP applica-        by 54% on average. On the evaluation set, NAVEX was
tions such as Joomla, HotCRP, and WordPress, and               able to drill down as deep as 6 HTTP requests to stitch
(ii) comparison of NAVEX on the same test applica-             together exploits.
tions used by state-of-the-art work in exploit genera-         Enhanced code property graph statistics. For all the
tion (e.g., Chainsaw [7]) and vulnerability analysis (e.g.,    applications under test, Table 2 shows the enhanced CPG
RIPS [15], [16]).                                              construction time and size. Note, the enhanced graph
Setup. NAVEX was deployed on Ubuntu 12.04 LTS                  represents the source code of all the 26 applications un-
VM with 2-cores of 2.4GHz each and 40GB RAM. We                der test, indicating the low runtime overhead of NAVEX.
first generated the enhanced CPG and used it to find ex-
ploitable paths for all the 26 applications. Then, we de-      Navigation graph statistics. Table 3 summarizes the
ployed the applications that have exploitable paths. The       total time to generate concrete exploits in Step II of
deployment process includes: installing each application       NAVEX. The application list in the table represents the
on a server, creating login credentials for each role, and     applications for which NAVEX found exploitable paths.
populating the application database with initial data by       Therefore, if an application did not have any exploitable
navigating the application and submitting forms when           path, NAVEX will not model its navigation behavior. The
necessary. We take a snapshot of each application’s            number of roles reflects the number of all account types
database and use it after each crawling to restore the orig-   (privileges) for each application. The NG has approxi-
inal state of the database. Note that due to specific de-      mately 59K nodes and 1M edges.
ployment instructions for each application, we could not
leverage automation to include more applications to eval-      5.1     Exploits
uate. Given ample time for manual deployment, NAVEX            SQLI       Exploits.      NAVEX         examined          calls    to



386    27th USENIX Security Symposium                                                                        USENIX Association
                                Total Crawling, Forms Spec.               Application           SQLI Exp.       TPs     FPs        SQLI Exploits
          Application           Generation, Solving Time      # of                              Sinks
                                & NG Building Time            Roles       myBloggie                 22           22      0              22
          myBloggie             2m                            2           Scarf                     0            0       0              0
          SchoolMate            0                             5           DNscript                  1            1       0              1
          WebChess              1m 36sec                      2           WeBid                     40           40      0              40
          Eve                   1m 5sec                       1           Eve                       5            5       0              5
          geccbblite            57sec                         1           SchoolMate                50           50      0              0
          Scarf                 1m 44sec                      2           geccbblite                4            4       0              4
          FAQforge              47sec                         1           FAQforge                  14           14      0              14
          WeBid                 9m 29sec                      2           WebChess                  13           13      0              13
          DNscript              51sec                         1           osCommerce (2.3.3)        1            1       0              1
          phpBB2                2m 14sec                      2           phpBB (2.0.23)            5            5       0              5
          HotCRP (2.60)         30m 13sec                     4           Total                    155          155      0             105
          osCommerce (2.3.3)    2hr 6m 32sec                  2        Table 4: Summary of the generated SQLI exploitable sinks
          CPG                   24m 40sec                     2
          MediaWiki             15m 30sec                     1
                                                                       and exploits.
          LimeSurvey            46sec                         2
          osCommerce (2.3.4)    2hr 19m 1sec                  2          Application           XSS Exp. Sinks     TPs        FPs      XSS exploits
          OpenConf              2m 1sec                       2          myBloggie                   2             2          0            2
          Gallery3              5m 51sec                      2          Scarf                       1             1          0            1
          Collabtive            24m 2sec                      3          DNscript                    1             1          0            1
          Total time                        6hr 27m 18sec                WeBid                      12             8          4            8
          Graph database size                104.44 MiB                  Eve                         2             2          0            2
     Table 3: Statistics on the Navigation graph generation.             SchoolMate                 11             11         0            0
                                                                         FAQforge                    7             7          0            7
                                                                         WebChess                   14             14         0           14
 mssql query, mysql query, mysqli query,                                 HotCRP (2.60)               5             5          0            5
 and sqlite query as sinks for SQLI vulnerability.                       osCommerce (2.3.4)          5             5          0            5
 It reported a total of 155 SQLI exploitable sinks with                  osCommerce (2.3.3)         46             45         1           42
                                                                         CPG                        11             11         0            0
 a running time of 37m and 45sec. From these, it                         MediaWiki                   1             1          0            1
 generated 105 concrete SQLI exploits in 7m and 76sec                    phpBB (2.0.23)             15             15         0            2
                                                                         Total                      133           128         5           90
 as summarized in Table 4.
                                                                        Table 5: Summary of the generated XSS seeds and exploits.
    NAVEX generated SQLI exploits for all applications
 that have SQLI exploitable sinks (seeds) except for
                                                                      1 http://localhost/WeBid/user_login.php
 SchoolMate. In SchoolMate, the crawler recovered                            POST[username=user,password=pass,action=login]
 only three HTTP requests. This application has 5 differ-             2 http://localhost/WeBid/index.php
                                                                      3 http://localhost/WeBid/user_menu.php
 ent roles, and for each role, our crawler was able to log            4 http://localhost/WeBid/yourmessages.php?id=1’              OR ’1’=’1
 in successfully. However, each time the crawler sends
 an HTTP request after the login, the application redi-                 Listing 5: SQLI exploit generated for the sinks in Listing 4.
 rects the execution to the login page, which means that
 the application does not properly maintain user sessions.
                                                                       XSS Exploits. NAVEX examined calls to echo and
 Therefore, the crawler did not proceed, and the cover-
                                                                       print PHP functions as sinks for XSS vulnerability. It
 age was low. This faulty application was chosen in our
                                                                       found a total of 133 XSS exploitable sinks, 5 of which
 evaluation mainly to compare the results of NAVEX with
                                                                       are false positives, in 1h and 49m. It successfully gener-
 other related work that included it in their test applica-
                                                                       ated 90 XSS exploits for the 133 sinks in 40m and 12sec
 tions. The reported exploitable sinks, nevertheless, are
                                                                       as shown in Table 5. For all exploitable sinks, NAVEX
 confirmed to be true positives (TPs).
                                                                       generated XSS exploits except for SchoolMate, due to
 Selected SQLI Exploit.            One of the applications
                                                                       the reported problem.
 for which NAVEX generated a large number of SQLI                         Note, we consider an exploit a zero-day if the exploit
 exploits is WeBid. Listing 4 shows an exploitable sink                in an active application was not reported before and has
 located in the user interface. An authenticated user can              a significant effect, which is not the case for the vulnera-
 check other users’ messages (line 3), consequently, the               bility in MediaWiki for instance.
 messages will be flagged as read (line 6). The generated              Selected XSS Exploit. For osCommerce2.3.4, NAVEX
 exploit for both sinks is in Listing 5.                               generated 5 XSS exploits. In the following, we demon-
                                                                       strate one of these exploits, which illustrates the preci-
1 $messageid = $_GET[’id’]; //no sanitization
2 //1st vul. query
                                                                       sion of our analysis in capturing the effect of custom
3 $sql = "SELECT * FROM ’".$DBPrefix."messages’ WHERE                  and built-in sanitization functions along different paths
       ’id’=’$messageid’";                                             to sinks.
4 ....
5 //2nd vul. query                                                        Listing 6 shows the vulnerable sink (echo) where
6 $sql = "UPDATE ’".$DBPrefix."messages’ SET ’read’=’1’ WHERE
                                                                       user input $HTTP GET VARS[’page’] passes through
       ’id’=’$messageid’";
                                                                       3 different functions and it is finally processed
  Listing 4: Simplified code for SQLI vulnerability in WeBid.          by either htmlspecialchars or strtr PHP func-



 USENIX Association                                                                       27th USENIX Security Symposium                       387
                                                                                         Benign      Malicious         EAR
 tions. NAVEX did not report the paths going through                Application
                                                                                         EAR Sinks   EAR Sinks
                                                                                                                 FPs
                                                                                                                       Exploits
 htmlspecialchars as exploitable because it is a suf-               myBloggie                 7          0        0       0
                                                                    WeBid                     0          1        0       1
 ficient XSS sanitization function. On the other hand, it           Eve                       1          0        0       1
 reported the paths that include strtr, which is not a              HotCRP (2.100)            1          0        0       1
                                                                    HotCRP (2.60)             1          0        0       1
 typical sanitization function for XSS, as vulnerable. In           OpenConf                  4          0        1       1
 this example, strtr replaces double quotes with &quot;             osCommerce (2.3.4)        0          1        0       1
 which is not sufficient to prevent XSS. NAVEX inferred             osCommerce (2.3.3)        0          1        0       1
                                                                    Gallery                   2          0        0       0
 the semantics of this function (through its modeling of            Joomla                    0          0        1       0
 many PHP functions as solver specifications) and used              LimeSurvey                1          0        0       0
                                                                    Collabtive                1          0        0       1
 the solver to find an XSS attack string that does not in-          MediaWiki                 1          0        1       1
 clude double quotes from our XSS attack dictionary. Ad-            Total                    19          3        3       9
 ditionally, to break out the outer single quotes, the attack     Table 6: Summary of the generated EAR seeds and exploits.
 string should have a single quote (&#39; HTML entity)
                                                                  the PHP function eval, a total of 98 calls in our data
 encoded (%26%2339%3B).
    As       a     result,      the      solver      selected     set, in 21m and 20sec. All the calls are not vulnerable,
 %26%2339%3B-alert(1)-%26%2339%3B as a ma-                        and therefore, NAVEX did report any exploitable code
 licious user input that satisfies the path constraints.          execution sinks, and no exploits were generated.
                                                                  Command Injection Exploits.           NAVEX examined
 Listing 7 shows the exploit constructed automatically
                                                                  all calls to exec, expect popen, passthru,
 for this vulnerability.
                                                                  pcntl exec, popen, proc open, shell exec,
                                                                  system, mail, and backtick operator, a total of
1 echo  ’<tr .. onclick="document.location.href=\’’ .
         tep_href_link(FILENAME, ’page=’ .                        350 calls, in 22m and 32sec. NAVEX did not find any
         $HTTP_GET_VARS[’page’]) . ’\’">’;                        vulnerable sinks.
 2 //1st function
 3 function tep_href_link($page = ’’, $parameters = ’’) {
                                                                  File Inclusion Exploits. NAVEX examined a total
 4 if (tep_not_null($parameters))                                 of 8063 calls to include, include once, require,
 5   $link .= $page . ’?’ . tep_output_string($parameters);
           ...}
                                                                  and require once in 27m and 58sec. It marked 1 sink
 6 //2nd function                                                 as exploitable in WeBid. However, an exploit could not
 7 function tep_output_string($string, $translate = false,
         $protected = false) {
                                                                  be generated because the unsanitized file name (user in-
 8 if ($protected == true)                                        put) is prefixed and postfixed with some constant strings,
 9   return htmlspecialchars($string);
10 else
                                                                  which cannot be overwritten by a malicious input.
11   if ($translate == false)
12      return tep_parse_input_field_data($string, array(’"’ =>
              ’&quot;’));                                         5.2    Measurements
13 ...}                                                           Performance and scalability. Figure 5 shows the per-
14 //3rd function
15 function tep_parse_input_field_data($data, $parse) {           formance of NAVEX measured by the total time to find
16   return strtr(trim($data), $parse);}                          exploitable sinks and to generate exploits per vulnerabil-
 Listing 6:   Simplified code for XSS vulnerability in            ity type. Note, for each vulnerability type, the blue bar
 osCommerce 2.3.4.                                                shows the total time of the analysis of Step I, for all ap-
                                                                  plications under test. The orange bar, on the other hand,
1 http://localhost/oscommerce-2.3.4/catalog/admin/login.php       records the total time spent by Step II, for the applica-
       ?action=process
       POST[username=admin@test.com,password=pass]                tions that have exploitable sinks.
2 http://localhost/oscommerce-2.3.4/catalog/admin/index.php       Dynamic analysis coverage. We consider the number
3 http://localhost/oscommerce-2.3.4/catalog/admin/reviews.php
4 http://localhost/oscommerce-2.3.4/catalog/admin/reviews.php
                                                                  of statically identified vulnerabilities by Step I as a
       ?page=%26%2339%3B-alert(1)-%26%2339%3B                     baseline to assess the coverage of Step II. NAVEX
         Listing 7: An XSS exploit generated for Listing 6.       successfully constructed 105 exploits for 155 SQLI
                                                                  sinks, 90 exploits for 128 XSS sinks, and 9 exploits for
                                                                  19 EAR vulnerabilities. Overall, the total coverage of
 EAR Exploits. NAVEX examined a total of 246 calls                Step II is 68% in comparison with the total vulnerable
 to header function (EAR source) in 17m and 17sec. It             sinks for all applications.
 found 19 benign EAR and 3 malicious EAR vulnerabili-
 ties. It successfully generated 9 exploits for the 22 EAR        Effect of sanitization tags on code property graphs.
 vulnerabilities combined as summarized in Table 6. Note          Figure 6 shows the effect of enhancing the CPG with san-
 that in the case of EAR, an exploit is a sequence of HTTP        itization and DB tags on the total number of vulnerable
 requests causes the code after the redirection function to       sinks. The orange bar shows the total number of vulner-
 execute.                                                         able sinks with the enhancements, showing reductions in
 Code Execution Exploits. NAVEX examined all calls to             false positives. Overall, the number of reported vulner-



 388      27th USENIX Security Symposium                                                                  USENIX Association
Vuln. Type                                      Exp. Sinks Finding Time (Mnts.) Exploit Generation Time (Mnts.)
SQLI                                                                      37.75                            8.27
XSS                                                                      109.27                           40.20
File Inclusion                                                            27.97                            0.00
Command Injection                                                         22.53                            0.00
Code Execution                                                            21.33                            0.00
EAR                                                                       17.28                            1.38


               120                                 109.27                                                                                                      200
               100
                                                                                                                                                                                                   # Exploits Without Client-Side Code
                                                                                                  Exp. Sinks Finding Time (Mnts.)
                                                                                                                                                                                                   # Exploits With Client-Side Code




                                                                                                                                                       # Exploits
                        80                                                                        Exploit Generation Time (Mnts.)
  Time (Mnts.)




                        60
                                 37.75                       40.20                                                                                                                105
                        40                                             27.97
                                                                                               22.53                                                           100                                  90
                                                                                                                   21.33               17.28
                        20                 8.27
                                                                                                                                                1.38
                         0
                                                                                   0.00                0.00                  0.00                                                           55
                                   SQLI               XS S                us   ion               ion           ec utio n                  EAR
                                                                File Incl                d Inject      Co de Ex
                                                                                 Co mman                                                                                  23
                                                                                                                                                                                                                       5       9
   Figure 5: Performance of NAVEX for each vulnerability type.
   Note, zero values refer to the absence of exploits.                                                                                                              0
                                                                                                                                                                           SQLI              XSS                        EAR
                                                                                                                                                        Figure 7: The enhancement on exploit generation precision
                                                        2940                                       # Sinks Without Sanitization Tags
                2500                                                                               # Sinks With Sanitization Tags
                                                                                                                                                        due to client-side code analysis.
                                   443                                                             Confirmed
   # Vulnerable Sinks




                                          155 155               133 128                                                                                 and [25], we compare NAVEX with Chainsaw, RIPS,
                         50
                                                                                     38
                                                                                                              23
                                                                                                                                                        and [16].
                                                                                                                                                        Vulnerability detection. In Table 7, we compare RIPS,
                                                                                                                   2                                    Chainsaw, and [16] with NAVEX in terms of the to-
                                                                                           1
                             1                                                                                                                          tal number of the reported SQLI and XSS vulnerabili-
                                         SQLI                 XSS                     usion       d Inject
                                                                                                           ion                       ecution
                                                                          File Incl        Comman                          Code Ex                      ties. Compared to Chainsaw, NAVEX found the same
   Figure 6: The effect of sanitization-tag-enhanced CPG in re-                                                                                         number of XSS and SQLI vulnerabilities in scarf and
   ducing false positives in vulnerable sink finding. For SQLI, the                                                                                     Eve, nevertheless, it reported more vulnerable sinks for
   numbers show the # of sinks using sanitization and DB proper-                                                                                        myBloggie. In addition, NAVEX found 71 vulnerable
   ties.                                                                                                                                                sinks in HotCRP, osCommerce, and phpBB because it
   able sinks for each vulnerability type is reduced, on an                                                                                             can handle object-oriented PHP code, which is not avail-
   average, by 87% due to enhancements implemented on                                                                                                   able in Chainsaw. Compared to RIPS, NAVEX found
   CPGs to significantly cut-down false positives.                                                                                                      19 more vulnerable sinks for phpBB, osCommerce, and
   Effect of client-side code analysis. One of the contri-                                                                                              myBloggie. It missed 2 vulnerable sinks in HotCRP due
   butions of our work is the precise handling of client-side                                                                                           to missing edges in the code property graph that repre-
   code during the NG construction. Forms are common                                                                                                    sent dynamic function calls.
   artifacts in modern web applications. In our dataset,                                                                                                Exploit generation. Since Chainsaw supports gen-
   we counted the frequency of using forms to receive                                                                                                   erating exploits for XSS and SQLI, we compare it to
   data from users. We found out that the number of                                                                                                     NAVEX with respect to the total number of the gener-
   unique forms in all applications ranges from 3 (as in                                                                                                ated SQLI and XSS exploits as well as some performance
   geccbblite) to 186 (as in WeBid) with an average of                                                                                                  measurements (see Table 8). NAVEX constructed 19
   45 form/application. Additionally, Figure 7 validates our                                                                                            more exploits in WeBid, myBloggie, geccbblite,
   claim that in order to improve the coverage and conse-                                                                                               WebChess, and FAQforge, and achieved the same for
   quently generate more exploits in deployed applications,                                                                                             Eve, scarf, and DNscript. For SchoolMate, NAVEX
   we must support input generation and constraints extrac-                                                                                             did not generate exploits due to issues related to main-
   tion from forms and JavaScript code. It can be seen from                                                                                             taining users sessions (as discussed earlier). Since in
   Figure 7 that NAVEX’s precision significantly increases.                                                                                             Chainsaw the exploit generation is done statically, it was
      Additionally, we measured the maximum length of all                                                                                               able to generate exploits for this application.
   navigation paths leading to all exploitable sinks. For                                                                                                  NAVEX significantly outperformed Chainsaw in
   SQLI and EAR exploits, we found that the maximum ex-                                                                                                 terms of efficiency. Chainsaw generated the exploits
   ploit length is 5 whereas for XSS is 6.                                                                                                              in 112min while NAVEX took 25min and 2sec. In ad-
                                                                                                                                                        dition, we contrast the total time to build and search the
                                                                                                                                                        navigation graph in NAVEX (18m 26sec) with the total
   5.3                             Comparison with Related Work                                                                                         time to construct and search the Refined Workflow Graph
      We compare the results of NAVEX with other related                                                                                                (RWFG) (1day 13h 21m) in Chainsaw. This indicates
   works based on the following: (1) common subject appli-                                                                                              that the techniques used in NAVEX improved the exploit
   cations (and same version numbers), (2) common vulner-                                                                                               generation efficiency without losing precision.
   ability types, and (3) knowledge of how the results of the
   related work are counted. Several related work met those                                                                                             5.4             Limitations and Discussion
   criteria such as CRAXweb [22], RIPS [15], [16], [31],                                                                                                Unsupported features. Certain features of web applica-
   Ardilla [25], and Chainsaw [7]. However, since                                                                                                       tions are not yet supported and therefore limit our cover-
   Chainsaw [7], the most recent related work, provided                                                                                                 age. For example, forms that have inputs of type file
   a detailed comparison between their work and [22], [31],                                                                                             require the user to select and upload an actual file from



   USENIX Association                                                                                                                                                             27th USENIX Security Symposium                      389
    Application          RIPS [15]     [16]      Chainsaw [7]   NAVEX
    myBloggie                21       SQLI(5)        22           24    ported by a constraint solver to generate SQLI and XSS
    Scarf                     -       SQLI(1)         1            1
    Eve                       -          -            7            7    exploits. QED [27] generates first-order SQLI and XSS
    HotCRP (2.60)             7          -            -            5    attacks using static analysis and model checking for Java
    osCommerce (2.3.3)       42          -            -           46
    phpBB (2.0.23)        8(SQLI)        -            -           20
                                                                        web applications. [32] generates inputs that expose SQLI
Table 7: Comparison on the number of identified (SQLI+XSS)              vulnerabilities using concolic execution of PHP applica-
vulnerable sinks.                                                       tions. EKHunter [19] combines static analysis and con-
                                                                        straint solving to find exploits in for-crime web appli-
    Application                            Chainsaw [7]     NAVEX       cations. WAPTEC [13] and NoTamper [12] generate
    Eve                                          7            7         exploits for parameter-tampering vulnerabilities. These
    SchoolMate                                  54            0
    WebChess                                    25            27        works, however, are limited to single PHP modules and
    FAQforge                                     8            21        do not consider whole-application paths.
    geccbblite                                   3            4
    myBloggie                                   22            24        Modeling with code property graphs. Yamaguchi et
    Scarf                                        1            1
    DNscript                                     2            2         al. [33] introduced the notion of CPGs for vulnerability
    WeBid                                       47            48        modeling and discovery in C programs. In a follow-up
    Total exploit generation time              112m        25m 2sec
    Total NG construction & solving time   1day 13h 21m   18m 26sec
                                                                        work [9], they applied CPGs for vulnerability discovery
Table 8:    Comparison on the number of generated                       on PHP applications. While our work uses the flexibility
(SQLI+XSS) exploits.                                                    and efficiency that CPGs offer, our problem goes a step
                                                                        further to generate actual executable exploits. As a con-
the local system. In a given test setting, this can be made             sequence, we enhance CPGs with additional attributes.
to work with our solver, but to make this work across all
platforms requires more engineering effort. Another is-                 Vulnerability analysis. There is a large body of re-
sue is of deriving TAC formulas from graph nodes auto-                  search that studied server-side vulnerability detection.
matically. It is a challenging process that involves an-                Broadly, there are static analysis approaches (such as
alyzing each AST node and supporting different node                     [11, 15, 16, 18, 23, 24, 26, 29–31, 34]), dynamic analysis
structures for each node type. For example, the left-hand               approaches (e.g., [20, 28]), and hybrid approaches (such
side of an assignment statement in PHP can be a sim-                    as [10]). Although NAVEX employs some of these anal-
ple variable, a constant, a function call, nested function              ysis techniques to find vulnerabilities, the aim of NAVEX
calls, etc. We have carefully considered these cases, and               is different from these works as it constructs exploits for
NAVEX has the support for most such node types and                      the identified vulnerabilities. Our navigation modeling is
structures, yet there are a few instances still under de-               inspired by MiMoSA [11], which is a system that finds
velopment. In our data set, NAVEX incorrectly flagged                   data and workflow vulnerabilities by analyzing modules
only 5 sinks as XSS exploitable in osCommerce2.3.3                      of web applications. NAVEX advances the analysis by
and WeBid. In PHP, statically handling dynamic calls to                 combining static and dynamic analyses to construct con-
functions is challenging. NAVEX utilizes CPGs, which                    crete exploits for large web applications.
do not have full support for resolving dynamic function
calls. However, this did not have a big impact on the                   7   Conclusions
results reported by NAVEX. For instance, there were 3
false positives reported for EAR vulnerability in Joomla,               In this paper, we present NAVEX, an automatic exploit
OpenConf, and MediaWiki.                                                generation system that takes into account the dynamic
                                                                        features and the navigational complexities of modern
6      Related Work                                                     web applications. On our dataset, NAVEX constructed
Exploit generation for web applications. Exploit gen-                   a total of 204 exploits, of which 195 are on taint-style
eration has seen a lot of interest in binary applica-                   vulnerabilities, and 9 are on logic vulnerabilities. We
tion [8, 14, 21]. For web applications, the closest work to             demonstrated that NAVEX significantly outperforms
NAVEX is Chainsaw [7], a system that uses purely static                 prior work on the precision, efficiency, and scalability of
analysis to build concrete exploits. NAVEX differs from                 exploit generation.
Chainsaw in 2 aspects: (i) it performs a combination of
dynamic and static analyses, which enables it to better                 Acknowledgments
scale to large applications and to find more exploits, (ii)             We thank Curt Thieme for his support with the ap-
it supports finding exploits for multiple classes of vulner-            plications’ deployment. We also thank Adam Doupé
abilities. Additional related works include Ardilla [25],               and the anonymous reviewers for their feedback. This
which uses concolic execution and taint tracking to con-                material is supported in part by NSF under Grant Nos.
struct SQLI and XSS attack vectors; CRAXweb [22],                       CNS-1514472, DGE-1069311 and by DARPA under an
which employs concrete and symbolic execution sup-                      AFOSR contract FA8650-15-C-7561.



390      27th USENIX Security Symposium                                                                      USENIX Association
References                                                                [19] E SHETE , B., A LHUZALI , A., M ONSHIZADEH , M., P ORRAS ,
 [1] Apache tinkerpop. https://tinkerpop.apache.org/gremlin.html,              P. A., V ENKATAKRISHNAN , V. N., AND Y EGNESWARAN , V.
     2018. Accessed: 2018-05-1.                                                EKHunter: A Counter-Offensive Toolkit for Exploit Kit Infiltra-
                                                                               tion. In 22nd Annual Network and Distributed System Security
 [2] crawler4j. https://github.com/yasserg/crawler4j, 2018. Accessed:          Symposium, NDSS (2015).
     2018-05-1.
                                                                          [20] H ALDAR , V., C HANDRA , D., AND F RANZ , M. Dynamic taint
 [3] Narcissus. https://github.com/mozilla/narcissus/, 2018.       Ac-         propagation for java. In 21st Annual Computer Security Applica-
     cessed: 2018-05-1.                                                        tions Conference (ACSAC) (2005), pp. 9–pp.
 [4] The neo4j graph platform the #1 platform for connected data.
                                                                          [21] H U , H., C HUA , Z. L., A DRIAN , S., S AXENA , P., AND L IANG ,
     https://neo4j.com/, 2018. Accessed: 2018-05-1.
                                                                               Z. Automatic Generation of Data-Oriented Exploits. In 24th
 [5] Xdebug - debugger and profiler tool for php. https://xdebug.org/,         USENIX Security Symposium (USENIX Security 15) (2015),
     2018. Accessed: 2018-05-1.                                                USENIX Association, pp. 177–192.
 [6] Xss         filter       evasion         cheat        sheet.         [22] H UANG , S., L U , H., L EONG , W., AND L IU , H. CRAXweb:
     https://www.owasp.org/index.php/XSS Filter Evasion Cheat Sheet,           Automatic Web Application Testing and Attack Generation. In
     2018. Accessed: 2018-05-1.                                                IEEE 7th International Conference on Software Security and Re-
 [7] A LHUZALI , A., E SHETE , B., G JOMEMO , R., AND                          liability, SERE (2013), pp. 208–217.
     V ENKATAKRISHNAN , V.        Chainsaw: Chained automated             [23] H UANG , Y.-W., Y U , F., H ANG , C., T SAI , C.-H., L EE , D.-T.,
     workflow-based exploit generation. In Proceedings of the 2016             AND K UO , S.-Y. Securing web application code by static anal-
     ACM SIGSAC Conference on Computer and Communications                      ysis and runtime protection. In Proceedings of the 13th interna-
     Security (CCS) (2016), ACM, pp. 641–652.                                  tional conference on World Wide Web (2004), ACM, pp. 40–52.
 [8] AVGERINOS , T., C HA , S. K., H AO , B. L. T., AND B RUM -           [24] J OVANOVIC , N., K RUEGEL , C., AND K IRDA , E. Pixy: A Static
     LEY, D. AEG: Automatic Exploit Generation. In NDSS (2011),                Analysis tool for Detecting Web Application Vulnerabilities. In
     vol. 11, pp. 59–66.                                                       Security and Privacy, 2006 IEEE Symposium on (2006), pp. 6–
 [9] BACKES , M., R IECK , K., S KORUPPA , M., S TOCK , B., AND                pp.
     YAMAGUCHI , F. Efficient and flexible discovery of php appli-        [25] K IEYZUN , A., G UO , P. J., JAYARAMAN , K., AND E RNST,
     cation vulnerabilities. In Security and Privacy (EuroS&P), 2017           M. D. Automatic Creation of SQL Injection and Cross-Site
     IEEE European Symposium on (2017), IEEE, pp. 334–349.                     Scripting Attacks. In IEEE 31st International Conference on Soft-
[10] BALZAROTTI , D., C OVA , M., F ELMETSGER , V., J OVANOVIC ,               ware Engineering (ICSE) (2009), pp. 199–209.
     N., K IRDA , E., K RUEGEL , C., AND V IGNA , G. Saner: Com-
                                                                          [26] L IVSHITS , V. B., AND L AM , M. S. Finding Security Vulnerabil-
     posing static and dynamic analysis to validate sanitization in web
                                                                               ities in Java Applications with Static Analysis. In 14th USENIX
     applications. In 2008 IEEE Symposium on Security and Privacy
                                                                               Security Symposium (Baltimore, Maryland, USA, 2005).
     (sp 2008) (2008), pp. 387–401.
                                                                          [27] M ARTIN , M., AND L AM , M. S. Automatic generation of xss and
[11] BALZAROTTI , D., C OVA , M., F ELMETSGER , V. V., AND V I -
                                                                               sql injection attacks with goal-directed model checking. In Pro-
     GNA , G. Multi-module Vulnerability Analysis of Web-based Ap-
                                                                               ceedings of the 17th conference on Security symposium (2008),
     plications. In the 14th ACM Conference on Computer and Com-
                                                                               pp. 31–43.
     munications Security (CCS) (2007), pp. 25–35.
[12] B ISHT, P., H INRICHS , T., S KRUPSKY, N., B OBROWICZ , R.,          [28] N GUYEN -T UONG , A., G UARNIERI , S., G REENE , D.,
     AND V ENKATAKRISHNAN , V. Notamper: automatic blackbox
                                                                               S HIRLEY, J., AND E VANS , D. Automatically hardening web
     detection of parameter tampering opportunities in web applica-            applications using precise tainting. In IFIP International Infor-
     tions. In Proceedings of the 17th ACM conference on Computer              mation Security Conference (2005), Springer, pp. 295–307.
     and communications security (2010), ACM, pp. 607–618.                [29] S AMUEL , M., S AXENA , P., AND S ONG , D. Context-sensitive
[13] B ISHT, P., H INRICHS , T., S KRUPSKY, N., AND V ENKATAKR -               auto-sanitization in web templating languages using type quali-
     ISHNAN , V. WAPTEC: Whitebox Analysis of Web Applications
                                                                               fiers. In Proceedings of the 18th ACM conference on Computer
     for Parameter Tampering Exploit Construction. In the 18th ACM             and communications security (2011), pp. 587–600.
     conference on Computer and communications security (2011),           [30] S AXENA , P., M OLNAR , D., AND L IVSHITS , B. Scriptgard: au-
     pp. 575–586.                                                              tomatic context-sensitive sanitization for large-scale legacy web
[14] B RUMLEY, D., P OOSANKAM , P., S ONG , D., AND Z HENG , J.                applications. In Proceedings of the 18th ACM conference on
     Automatic Patch-Based Exploit Generation is Possible: Tech-               Computer and communications security (2011), pp. 601–614.
     niques and Implications. In Security and Privacy, 2008. SP 2008.     [31] WASSERMANN , G., AND S U , Z. Sound and precise analysis of
     IEEE Symposium on (2008), pp. 143–157.                                    web applications for injection vulnerabilities. In ACM Sigplan
[15] DAHSE , J., AND H OLZ , T. Simulation of Built-in PHP Features            Notices (2007), vol. 42, ACM, pp. 32–41.
     for Precise Static Code Analysis. In Symposium on Network and        [32] WASSERMANN , G., Y U , D., C HANDER , A., D HURJATI , D.,
     Distributed System Security (NDSS) (2014).                                I NAMURA , H., AND S U , Z. Dynamic test input generation for
[16] DAHSE , J., AND H OLZ , T. Static Detection of Second-Order               web applications. In Proceedings of the 2008 international sym-
     Vulnerabilities in Web Applications. In 23rd USENIX Security              posium on Software testing and analysis (2008), pp. 249–260.
     Symposium (USENIX Security) (2014), pp. 989–1003.                    [33] YAMAGUCHI , F., G OLDE , N., A RP, D., AND R IECK , K. Mod-
[17] D E M OURA , L., AND B JØRNER , N. Z3: An efficient smt solver.           eling and discovering vulnerabilities with code property graphs.
     In Tools and Algorithms for the Construction and Analysis of Sys-         In Security and Privacy (SP), 2014 IEEE Symposium on (2014),
     tems. Springer, 2008, pp. 337–340.                                        IEEE, pp. 590–604.
[18] D OUP É , A., B OE , B., K RUEGEL , C., AND V IGNA , G. Fear the    [34] Y U , F., A LKHALAF, M., AND B ULTAN , T. Stranger: An
     ear: discovering and mitigating execution after redirect vulnera-         automata-based string analysis tool for php. In International Con-
     bilities. In Proceedings of the 18th ACM conference on Computer           ference on Tools and Algorithms for the Construction and Analy-
     and communications security (2011), ACM, pp. 251–262.                     sis of Systems (2010), pp. 154–157.




USENIX Association                                                                           27th USENIX Security Symposium                 391
[35] Z HENG , Y., Z HANG , X., AND G ANESH , V. Z3-str: A Z3-based
     String Solver for Web Application Analysis. In Proceedings of
     the 2013 9th Joint Meeting on Foundations of Software Engineer-
     ing (2013), pp. 114–124.




392    27th USENIX Security Symposium                                  USENIX Association
