22
TAJ: Effective Taint Analysis of Web Applications Omer Tripp Marco Pistoia Stephen Fink Manu Sridharan Omri Weisman IBM Software Group IBM T. J. Watson Research Center IBM Software Group [email protected] {pistoia,sjfink,msridhar}@us.ibm.com [email protected] Abstract Taint analysis, a form of information-flow analysis, establishes whether values from untrusted methods and parameters may flow into security-sensitive operations. Taint analysis can detect many common vulnerabilities in Web applications, and so has attracted much attention from both the research community and industry. However, most static taint-analysis tools do not address criti- cal requirements for an industrial-strength tool. Specifically, an industrial-strength tool must scale to large industrial Web applica- tions, model essential Web-application code artifacts, and generate consumable reports for a wide range of attack vectors. We have designed and implemented a static Taint Analysis for Java (TAJ) that meets the requirements of industry-level applica- tions. TAJ can analyze applications of virtually any size, as it em- ploys a set of techniques designed to produce useful answers given limited time and space. TAJ addresses a wide variety of attack vec- tors, with techniques to handle reflective calls, flow through con- tainers, nested taint, and issues in generating useful reports. This paper provides a description of the algorithms comprising TAJ, evaluates TAJ against production-level benchmarks, and compares it with alternative solutions. Categories and Subject Descriptors D.2.4 [Software Engineer- Cross-site scripting (XSS) attacks (the most common vulnera- bility) may occur when a Web application accepts data originat- ing from a user and sends it to another user’s browser without first validating or encoding it. For example, suppose an attacker embeds malicious JavaScript code into his or her profile on a social Web site. If the site fails to validate such input, that code may execute in the browser of any other user who visits that profile. Injection flaws (the second most frequent vulnerability) arise when a Web application accepts input from a user and sends it to an interpreter as part of a command or query, without first validating it. Via this vulnerability, an attacker can trick the interpreter into executing unintended commands or changing data. The most common attack of this type is Structured Query Language injection (SQLi). Malicious file executions (the third most common vulnerability) happen when a Web application improperly trusts input files or uses unverified user data in stream functions, thereby allowing hostile content to be executed on the server. Information leakage and improper error-handling attacks (the sixth most common vulnerability) take place when a Web ap- plication leaks information about its own configuration, mech-

TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Embed Size (px)

Citation preview

Page 1: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

TAJ: Effective Taint Analysis of Web Applications

Omer Tripp Marco Pistoia Stephen Fink Manu Sridharan Omri WeismanIBM Software Group IBM T. J. Watson Research Center IBM Software [email protected] {pistoia,sjfink,msridhar}@us.ibm.com [email protected]

AbstractTaint analysis, a form of information-flow analysis, establisheswhether values from untrusted methods and parameters may flowinto security-sensitive operations. Taint analysis can detect manycommon vulnerabilities in Web applications, and so has attractedmuch attention from both the research community and industry.However, most static taint-analysis tools do not address criti-cal requirements for an industrial-strength tool. Specifically, anindustrial-strength tool must scale to large industrial Web applica-tions, model essential Web-application code artifacts, and generateconsumable reports for a wide range of attack vectors.

We have designed and implemented a static Taint Analysis forJava (TAJ) that meets the requirements of industry-level applica-tions. TAJ can analyze applications of virtually any size, as it em-ploys a set of techniques designed to produce useful answers givenlimited time and space. TAJ addresses a wide variety of attack vec-tors, with techniques to handle reflective calls, flow through con-tainers, nested taint, and issues in generating useful reports. Thispaper provides a description of the algorithms comprising TAJ,evaluates TAJ against production-level benchmarks, and comparesit with alternative solutions.

Categories and Subject Descriptors D.2.4 [Software Engineer-ing]: Software/Program Verification; D.2.5 [Software Engineer-ing]: Testing and Debugging

General Terms Static Analysis, Web Applications, Security

Keywords Security, Static Analysis, Taint Analysis, InformationFlow, Integrity, Web Applications

1. IntroductionInformation-flow violations [8] comprise the most serious securityvulnerabilities in today’s Web applications. In fact, according tothe Open Web Application Security Project (OWASP) [26], theyconstitute the top six security problems. Automatically detectingsuch vulnerabilities in real-world Web applications may be difficultdue to their size and complexity. Manual code inspection is oftenineffective for such complex programs, and security testing mayremain inconclusive due to insufficient coverage.

This paper proposes a static-analysis solution that detects fourof the aforementioned top six security vulnerabilities [26]:

Permission to make digital or hard copies of all or part of this work for personal orclassroom use is granted without fee provided that copies are not made or distributedfor profit or commercial advantage and that copies bear this notice and the full citationon the first page. To copy otherwise, to republish, to post on servers or to redistributeto lists, requires prior specific permission and/or a fee.PLDI’09, June 15–20, 2009, Dublin, Ireland.Copyright c! 2009 ACM 978-1-60558-392-1/09/06. . . $5.00

• Cross-site scripting (XSS) attacks (the most common vulnera-bility) may occur when a Web application accepts data originat-ing from a user and sends it to another user’s browser withoutfirst validating or encoding it. For example, suppose an attackerembeds malicious JavaScript code into his or her profile on asocial Web site. If the site fails to validate such input, that codemay execute in the browser of any other user who visits thatprofile.

• Injection flaws (the second most frequent vulnerability) arisewhen a Web application accepts input from a user and sends itto an interpreter as part of a command or query, without firstvalidating it. Via this vulnerability, an attacker can trick theinterpreter into executing unintended commands or changingdata. The most common attack of this type is Structured QueryLanguage injection (SQLi).

• Malicious file executions (the third most common vulnerability)happen when a Web application improperly trusts input files oruses unverified user data in stream functions, thereby allowinghostile content to be executed on the server.

• Information leakage and improper error-handling attacks (thesixth most common vulnerability) take place when a Web ap-plication leaks information about its own configuration, mech-anisms, and internal problems. Attackers use this weakness tosteal sensitive data or refine their attacks.

Each of these vulnerabilities can be cast as a problem in whichtainted information from an untrusted “source” propagates, throughdata and/or control flow, to a high-integrity “sink” without beingproperly endorsed (i.e., corrected or validated) by a “sanitizer”.

To address these vulnerabilities, the research community has fo-cused much attention on static analysis for information-flow secu-rity of Web applications. Unfortunately, many of the published ap-proaches do not immediately apply to industrial Web applications.Many existing solutions require use of complex, non-standard typesystems, which are unlikely to enjoy broad adoption [36; 24; 30].Other solutions, based on precise program slicing [16], have notbeen shown to be sufficiently scalable [31; 13].

In this paper, we present Taint Analysis for Java (TAJ), a tooldesigned to be precise enough to produce a low false-positive rate,yet scalable enough to allow the analysis of large applications. TAJincorporates a number of techniques to produce useful results onextremely large applications, even when constrained to a given timeor memory budget. Furthermore, TAJ supports many complex fea-tures of Java Platform, Enterprise Edition (Java EE) Web applica-tions that were often omitted from discussion in previous work.

In addition to a general overview of TAJ, this paper makes thefollowing specific contributions:

• Hybrid thin slicing. We present a novel thin-slicing algo-rithm [33] that combines flow-insensitive data-flow propaga-tion through the heap with flow- and context-sensitive data-flowpropagation through local variables.

Page 2: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Reality Check

• Anyone read this paper?

• Taint Analysis

• Thin Slicing

• Flow-sensitive Analysis

• Context-sensitive Pointer Analysis

Page 3: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Taint Analysis Problem

Source Sink

Sanitizer

Sanitizer

All paths from a source to a sinkshould pass “Sanitizer” function

2

Page 4: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Taint Analysis Problem

Source Sink

Sanitizer

Sanitizer

All paths from a source to a sinkshould pass “Sanitizer” function

input comment save comment to DBescape function

escape function

Example

2

Page 5: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Taint Analysis Problem

Source Sink

Sanitizer

Sanitizer

All paths from a source to a sinkshould pass “Sanitizer” function

input comment save comment to DBescape function

escape function

Example

2

Page 6: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Taint Analysis Problem

Source Sink

Sanitizer

Sanitizer

All paths from a source to a sinkshould pass “Sanitizer” function

input comment save comment to DBescape function

escape function

Example

2

Page 7: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Taint Analysis Problem

Source Sink

Sanitizer

Sanitizer

All paths from a source to a sinkshould pass “Sanitizer” function

input comment save comment to DBescape function

escape function

Example

2

Page 8: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Taint Analysis Problem

Source Sink

Sanitizer

Sanitizer

XSS is #1 Vulnerability(even more than Buffer Overflow)

input comment save comment to DBescape function

escape function

2

Page 9: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Key Idea : Thin Slicing

Source1

Source2

Source3

Sink1

Sink2

Source4

Sink3

Sanitizer1

Sanitizer3

Sanitizer4

Sanitizer5

Sanitizer2

Thin Slicing Program with Each Source

3

Page 10: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Source1

Sink1

Sink2 Sink3

Sanitizer1

Sanitizer3

Sanitizer2

Thin Slicing Program with Each Source

Key Idea : Thin Slicing

3

Page 11: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Source2

Sink1

Sink2

Sanitizer3

Sanitizer2

Thin Slicing Program with Each Source

Key Idea : Thin Slicing

3

Page 12: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Source3

Sink1

Sink2 Sink3

Sanitizer1

Sanitizer4

Sanitizer2

Thin Slicing Program with Each Source

Key Idea : Thin Slicing

3

Page 13: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Sink1

Source4

Sanitizer5

Thin Slicing Program with Each Source

Key Idea : Thin Slicing

3

Page 14: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Thin Slice from a source = Statements data-dependent on the source=> Much smaller and more understandable

Sink1

Source4

Sanitizer5

temp1 := source4 + "\n"

ret := ret + ret

Key Idea : Thin Slicing

3

Page 15: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Source1

Source2

Source3

Sink1

Sink2

Source4

Sink3

Sanitizer1

Sanitizer3

Sanitizer4

Sanitizer5

Sanitizer2

Key Idea : Hybrid Thin Slicing

Source1

Sink1

Sink2 Sink3

Sanitizer1

Sanitizer3

Sanitizer2

Source3

Sink1

Sink2 Sink3

Sanitizer1

Sanitizer4

Sanitizer2

Sink1

Source4

Sanitizer5

Source2

Sink1

Sink2

Sanitizer3

Sanitizer2

Call Graph

SliceSlice

Slice

Slice

4

Page 16: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Source1

Source2

Source3

Sink1

Sink2

Source4

Sink3

Sanitizer1

Sanitizer3

Sanitizer4

Sanitizer5

Sanitizer2

Key Idea : Hybrid Thin Slicing

Source1

Sink1

Sink2 Sink3

Sanitizer1

Sanitizer3

Sanitizer2

Source3

Sink1

Sink2 Sink3

Sanitizer1

Sanitizer4

Sanitizer2

Sink1

Source4

Sanitizer5

Source2

Sink1

Sink2

Sanitizer3

Sanitizer2

Program

Call Graph

SliceSlice

Slice

Slice

GraphConstruction

via

Pointer Analysis

4

Page 17: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Key Idea : Hybrid Thin Slicing

Precision

Scalability CI(Context-insensitive)Thin Slicing

CS(Context-sensitive)Thin Slicing

5

Page 18: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Key Idea : Hybrid Thin Slicing

Precision

Scalability CI(Context-insensitive)Thin Slicing

CS(Context-sensitive)Thin Slicing

Hybrid Thin Slicingflow-insensitive about heap

flow- and context-sensitive about local variable

5

Page 19: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Key Idea : Hybrid Thin Slicing

Precision

Scalability CI(Context-insensitive)Thin Slicing

CS(Context-sensitive)Thin Slicing

<betterprecision <

betterscalability

Hybrid Thin Slicingflow-insensitive about heap

flow- and context-sensitive about local variable

5

Page 20: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Key Idea : Hybrid Thin Slicing

* Flow- and context-sensitive about local variable

6

* Flow-insensitive about heap

1. For a statement x = e, where x is a local, we add edges to allstatements using x, excluding uses in pointer dereferences ofthe form x.f. We operate on an SSA representation, so theseedges are added flow sensitively.

2. For an actual parameter node for a call to method m(), we querythe pre-computed call graph to find the possible call targetsm1, . . . , mk. Then, for each mi, we add an edge from the actualparameter node to the corresponding formal parameter node.Return values are handled similarly.

Our thin slicing algorithms differ from the standard SDG handlingof data dependence, and from each other, in their treatment ofdefinitions of heap locations (i.e., statements of the form x.f :=e) as described below.

5.2 Context-Insensitive Thin SlicingOur first algorithm computes traditional (context-insensitive) graphreachability on our SDG variant to compute thin slices. In this ap-proach, we represent data dependences for heap access statementsas follows:

• For a statement x.f := e, we add an edge to each statementwith an expression w.f on its right-hand side, such that the pre-computed points-to analysis indicates x may-alias w.

Note that we add direct edges to statements in other procedures.In contrast, the traditional SDG only includes interprocedural edgesfor parameter passing and return values. The advantage of this ap-proach is that we need not model heap accesses using additional pa-rameters and return values, as is done with traditional slicing [11].In practice, not using heap parameters dramatically increases scala-bility without significant loss in precision (discussed further in Sec-tion 5.3 and Section 6).

Having computed the graph, a simple transitive closure gives thethin slice for a particular seed. It is straightforward to construct thegraph and do the traversal in a demand-driven fashion. A potentialdisadvantage of this approach is that it may return unrealizablepaths [21] due to lack of context sensitivity (Section 6 shows thisissue is not significant in practice).

5.3 Context-Sensitive Thin SlicingThe context-sensitive thin slicing algorithm uses an SDG variantcloser to that used in traditional slicing, created compositionallyfrom program dependence graphs (PDGs) for each procedure. In-traprocedurally, this approach handles heap accesses as follows:

• For a statement x.f := e, we add an edge to each statementwith an expression w.f on its right-hand side in the same pro-cedure such that the pre-computed points-to analysis indicatesx may-alias w.

We handle interprocedural heap flow in the same way as thestandard SDG, with heap reads and writes modeled as extra param-eters and return values to each procedure [5, 11]. Our implementa-tion introduces such parameters using the same heap partitions usedby the preliminary pointer analysis. Discovering the appropriate setof parameters for each procedure requires an interprocedural mod-ref analysis [24], computed using the result of the pre-computedpoints-to analysis.

Having built the graph, we compute context-sensitive reacha-bility as a partially balanced parentheses problem [20]. Our imple-mentation relies on a backwards, demand-driven tabulation algo-rithm [21].

In our experience, constructing an SDG using heap parameterscan be very expensive for large programs. Furthermore, we foundthat for realistic usage patterns, context sensitivity did not providemuch benefit for thin slicing. See Section 6 for details.

6. EvaluationWe now present an empirical evaluation of thin slicing for debug-ging and program understanding tasks. Our experiments validatefour hypotheses:

• Thin slices lead the user to desired statements. For the taskswe considered, thin slices often contain the desired statements(e.g., the buggy statement for a debugging task). When state-ments explaining pointer aliasing or control flow were relevant,the statements were always lexically close to statements in thethin slice. Subjectively, we also found a thin slicer very usefulfor understanding one set of benchmarks.

• Thin slices focus better on desired statements than tra-ditional slices. We compared context-insensitive thin slicingto context-insensitive traditional slicing (the context-sensitiveconfigurations did not scale) with identical handling of controldependences and a breadth-first strategy for inspecting state-ments, simulating real-world use of a program understandingtool. The experiments showed that finding desired statementsin a traditional slice required inspecting 3.3 times more state-ments than a thin slice for the debugging tasks, and 9.4 timesmore statements for the program understanding tasks.

• A precise pointer analysis is key to effective thin slicing. Weused a pointer analysis with object-sensitive handling [16] ofkey collections classes for the thin slicer. With a less precisepointer analysis, up to 17.2X more statements required inspec-tion in thin slices to find desired statements.

• Thin slices can be computed efficiently. Our context-insensitive thin slicing algorithm scaled well to large programs,with the cost of computing thin slices insignificant comparedto the pre-requisite call graph construction and pointer anal-ysis. We were unable to scale a context-sensitive traditionalslicer [11] to our larger benchmarks.

6.1 Configuration and MethodologyWe implemented the thin and traditional data slicers using the IBMT.J. Watson Libraries for Analysis (WALA) [2]. We utilized callgraph construction and pointer analysis algorithms provided byWALA, along with its tabulation solver for context-sensitive anal-ysis [21]. We analyzed our benchmarks with the Sun JDK 1.4.2_09standard library code, for which WALA provides models of im-portant native methods. WALA uses heuristics to analyze the mostcommon uses of reflection in Java, but in general reflection and na-tive methods may still cause some unsoundness, as is typical in Javastatic analysis implementations. All experiments were performedon a Lenovo ThinkPad t60p with dual 2.2GHz Intel T2600 proces-sors and 2GB RAM. The analyzer ran on the Sun JDK 1.5_07 usingat most 1GB of heap space.

Table 1 provides information about the programs used in ourexperiments. For pointer analysis and call graph construction, weused a variant of Andersen’s analysis with on-the-fly call graphconstruction [4, 23], with fully object-sensitive cloning [16] for ob-jects of key collections classes, as described in [8] (the importanceof this precision is discussed later in the section). We excluded fromthe call graphs a few large standard libraries (e.g.,javax.swing,java.awt) which we deemed a priori uninteresting for the tasks athand, since none of our tested tasks involved those libraries. For allexperiments reported, call graph construction and pointer analysisran in under 5 minutes.Scalability For the dependence graph traversal, we consideredboth the context-insensitive (flat graph reachability) and context-sensitive (tabulation) algorithms presented in Section 5.

In all cases, the time and space to compute the thin slice or tradi-tional slice with the context-insensitive algorithm was insignificant

x.f := e

_ := ... w1 ...

_ := ... w2 ...

x may alias w1 and w2

Large Spurious Cycle in Static Analyses and Its Algorithmic Mitigation 3

call5

call1

entry

exit

return4

return6

(1)

(2)

(3)

(4)

(5)

(6)

f call1 = · · · · · · (1)entry = call1 � call5 · · · (2)exit = F̂bodyf (entry) · · · (3)return4 = exit · · · (4)call5 = return4 · · · (5)return6 = exit · · · (6)

Fig. 1. Spurious cycles because of abstract procedure calls and returns. The right-handside is a system of equations and the left-hand side shows the dependences betweenthe equations. Note a dependence cycle (2)→ (3)→ (4)→ (5)→ (2)→ · · ·

effectively relieve the performance degradation caused by spurious interprocedu-ral cycles in both context-sensitive (k > 0) and -insensitive (k = 0) analysis.

While solving flow equations, the algorithmic technique simply forces proce-dures to return to their corresponding called site, in order not to follow the lastedge (edge (3)→ (4) in Fig 1) of the “butterfly” cycles. In order to enforce this,we control the equation-solving orders so that each called procedure is analyzedexclusively for its one particular call-site. To be safe, we apply our algorithm toonly non-recursive procedures.

Consider the equation system in Fig 1 again and think of a middle of theanalysis (equation-solving) sequence, · · · → (5) → (2) → (3), which indicatesthat the analysis of procedure f is invoked from (5) and is now finished. Afterthe evaluation of (3), a classical worklist algorithm inserts all the equations,(4) and (6), that depend on (3). But, if we remember the fact that f has beeninvoked from (5) and the other call-site (1) has not invoked the procedure untilthe analysis of f finishes, we can know that continuing with (4) is useless, becausethe current analysis of f is only related to (5), but not to other calls like (1). So,we process only (6), pruning the spurious sequence (3)→ (4)→ · · · .

We integrated the algorithm inside an industrialized abstract-interpretation-based C static analyzer [5, 6] and measured performance gains derived fromavoiding spurious cycles. We have saved 7%-96% of the analysis time for context-insensitive or -sensitive global analysis for open-source benchmarks.

1.3 Contributions

– We present a simple extension of the classical call-strings approach, whicheffectively reduces the inefficiency caused by large, inevitable, spurious in-terprocedural cycles.We prove the effectiveness of the technique by experiments with an industrial-strength C static analyzer [5, 6] in globally analyzing medium-scale open-source programs.

context-insensitive

Large Spurious Cycle in Static Analyses and Its Algorithmic Mitigation 3

call5

call1

entry

exit

return4

return6

(1)

(2)

(3)

(4)

(5)

(6)

f call1 = · · · · · · (1)entry = call1 � call5 · · · (2)exit = F̂bodyf (entry) · · · (3)return4 = exit · · · (4)call5 = return4 · · · (5)return6 = exit · · · (6)

Fig. 1. Spurious cycles because of abstract procedure calls and returns. The right-handside is a system of equations and the left-hand side shows the dependences betweenthe equations. Note a dependence cycle (2)→ (3)→ (4)→ (5)→ (2)→ · · ·

effectively relieve the performance degradation caused by spurious interprocedu-ral cycles in both context-sensitive (k > 0) and -insensitive (k = 0) analysis.

While solving flow equations, the algorithmic technique simply forces proce-dures to return to their corresponding called site, in order not to follow the lastedge (edge (3)→ (4) in Fig 1) of the “butterfly” cycles. In order to enforce this,we control the equation-solving orders so that each called procedure is analyzedexclusively for its one particular call-site. To be safe, we apply our algorithm toonly non-recursive procedures.

Consider the equation system in Fig 1 again and think of a middle of theanalysis (equation-solving) sequence, · · · → (5) → (2) → (3), which indicatesthat the analysis of procedure f is invoked from (5) and is now finished. Afterthe evaluation of (3), a classical worklist algorithm inserts all the equations,(4) and (6), that depend on (3). But, if we remember the fact that f has beeninvoked from (5) and the other call-site (1) has not invoked the procedure untilthe analysis of f finishes, we can know that continuing with (4) is useless, becausethe current analysis of f is only related to (5), but not to other calls like (1). So,we process only (6), pruning the spurious sequence (3)→ (4)→ · · · .

We integrated the algorithm inside an industrialized abstract-interpretation-based C static analyzer [5, 6] and measured performance gains derived fromavoiding spurious cycles. We have saved 7%-96% of the analysis time for context-insensitive or -sensitive global analysis for open-source benchmarks.

1.3 Contributions

– We present a simple extension of the classical call-strings approach, whicheffectively reduces the inefficiency caused by large, inevitable, spurious in-terprocedural cycles.We prove the effectiveness of the technique by experiments with an industrial-strength C static analyzer [5, 6] in globally analyzing medium-scale open-source programs.

1-level call-string context-sensitive

c1

c1

c5c5

Page 21: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Other Contributions• Effective Model for Static Analysis of Web Applications

• Bounded Analysis Techniques

Support reflection, tainted flow through containers, detection of taint in the internal state of objects, JSP, EJB, Struts and Spring frameworks.

Support a prioritization policy that focuses the analysis on portions of the Web application that are likely to participate in taint propagation.

7

Page 22: TAJ: Effective Taint Analysis of Web Applicationssoonhok/talks/20110301.pdf · TAJ: Effective Taint Analysis of Web Applications ... TAJ can analyze applications of virtually any

Thank You