skip to main content
10.1145/2001420.2001441acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Path- and index-sensitive string analysis based on monadic second-order logic

Published:17 July 2011Publication History

ABSTRACT

We propose a novel technique for statically verifying the strings generated by a program. The verification is conducted by encoding the program in Monadic Second-Order Logic (M2L). We use M2L to describe constraints among program variables and to abstract built-in string operations. Once we encode a program in M2L, a theorem prover for M2L, such as MONA, can automatically check if a string generated by the program satisfies a given specification, and if not, exhibit a counterexample. With this approach, we can naturally encode relationships among strings, accounting also for cases in which a program manipulates strings using indices. In addition, our string analysis is path sensitive in that it accounts for the effects of string and Boolean comparisons, as well as regular-expression matches.

We have implemented our string-analysis algorithm, and used it to augment an industrial security analysis for Web applications by automatically detecting and verifying sanitizers---methods that eliminate malicious patterns from untrusted strings, making those strings safe to use in security-sensitive operations. On the 8 benchmarks we analyzed, our string analyzer discovered 128 previously unknown sanitizers, compared to 71 sanitizers detected by a previously presented string analysis.

References

  1. IBM Rational AppScan Source Edition. ibm.com/software/rational/products/appscan/source.Google ScholarGoogle Scholar
  2. Open Web Application Security Project (OWASP). owasp.org/index.php/Category:Attack.Google ScholarGoogle Scholar
  3. A. Ayari and D. Basin. Bounded model construction for monadic second-order logics. In CAV, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Balzarotti, M. Cova, V. Felmetsger, N. Jovanovic, E. Kirda, C. Kruegel, and G. Vigna. Saner: Composing static and dynamic analysis to validate sanitization in web applications. In Security and Privacy (Oakland), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. N. Bjørner, N. Tillmann, and A. Voronkov. Path feasibility analysis for string-manipulating programs. In TACAS, 2009.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Brumley, H. Wang, S. Jha, and D. Song. Creating vulnerability signatures using weakest preconditions. In CSF, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. S. Christensen, A. Feldthaus, and A. Møller. JSA -- the Java String Analyzer. brics.dk/JSA, 2009.Google ScholarGoogle Scholar
  8. A. S. Christensen, A. Møller, and M. I. Schwartzbach. Precise analysis of string expressions. In SAS, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P. Cousot and R. Cousot. Formal language, grammar and set-constraint-based program analysis by abstract interpretation. In FPCA, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. TOPLAS, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. X. Fu and C.-C. Li. A string constraint solver for detecting web application vulnerability. In SEKE, 2010.Google ScholarGoogle Scholar
  12. E. Geay, M. Pistoia, T. Tateishi, B. Ryder, and J. Dolby. Modular string-sensitive permission analysis with demand-driven precision. In ICSE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Grove and C. Chambers. A Framework for Call Graph Construction Algorithms. TOPLSA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Grove, G. DeFouw, J. Dean, and C. Chambers. Call graph construction in object-oriented languages. In OOPSLA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Hammer, R. Schaade, and G. Snelting. Static path conditions for java. In PLAS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. G. Henriksen, J. L. Jensen, M. E. Jørgensen, N. Klarlund, R. Paige, T. Rauhe, and A. Sandholm. MONA: Monadic second-order logic in practice. In TACAS, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. Hooimeijer and W. Weimer. A decision procedure for subset constraints over regular languages. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Kay and R. M. Kaplan. Regular models of phonological rule systems. Computational Linguistics, 20(3), 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Kieżun, V. Ganesh, P. J. Guo, P. Hooimeijer, and M. D. Ernst. HAMPI: A solver for string constraints. In ISSTA, 2009.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. N. Klarlund and A. Møller. MONA Version 1.4 User Manual. BRICS, 2001. Notes Series NS-01-1. http://www.brics.dk/mona.Google ScholarGoogle Scholar
  21. B. Livshits, A. V. Nori, S. K. Rajamani, and A. Banerjee. Merline: Specification inference for explicit information flow problems. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. V. B. Livshits and M. S. Lam. Finding security vulnerabilities in java applications with static analysis. In USENIX Security, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Y. Minamide. Static approximation of dynamically generated web pages. In WWW, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Global value numbers and redundant computations. In POPL, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. Saxena, D. Akhawe, S. Hanna, F. Mao, S. McCamant, and D. Song. A symbolic execution framework for javascript. In Security and Privacy (Oakland), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. D. Shannon, I. Ghosh, S. Rajan, and S. Khurshid. Efficient symbolic execution of strings for validating web applications. In DEFECTS, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. G. Snelting. Combining slicing and constraint solving for validation of measurement software. In SAS, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. T. Tateishi, M. Pistoia, and O. Tripp. Path- and index-sensitive string analysis based on monadic second-order logic. IBM Research Report RT0930, 2011.Google ScholarGoogle Scholar
  29. N. Tillmann and J. D. Halleux. Pex: white box test generation for .NET. In TAP, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. O. Tripp, M. Pistoia, S. Fink, M. Sridharan, and O. Weisman. TAJ: Effective taint analysis of web applications. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M. Veanes, P. de Halleux, and N. Tillmann. Rex: Symbolic regular expression explorer. Microsoft Research Technical Report MSR-TR-2009-137, 2009.Google ScholarGoogle Scholar
  32. T. J. Watson Libraries for Analysis, wala.sf.net/.Google ScholarGoogle Scholar
  33. G. Wassermann and Z. Su. Sound and precise analysis of web applications for injection vulnerabilities. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. TOPLAS, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. F. Yu, M. Alkhalaf, and T. Bultan. Generating vulnerability signatures for string manipulating programs using automata-based forward and backward symbolic analyses. In ASE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. F. Yu, T. Bultan, M. Cova, and O. Ibarra. Symbolic string verification: An automata-based approach. In SPIN Workshop, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Z3, research.microsoft.com/projects/z3.Google ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    ISSTA '11: Proceedings of the 2011 International Symposium on Software Testing and Analysis
    July 2011
    394 pages
    ISBN:9781450305624
    DOI:10.1145/2001420

    Copyright © 2011 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 17 July 2011

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    Overall Acceptance Rate58of213submissions,27%

    Upcoming Conference

    ISSTA '24

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader