skip to main content
10.1145/3316615.3316662acmotherconferencesArticle/Chapter ViewAbstractPublication PagesicscaConference Proceedingsconference-collections
research-article

Precise String Analysis for JavaScript Programs Using Automata

Published:19 February 2019Publication History

ABSTRACT

Existing static analyzers for JavaScript use constant propagation domains to analyze strings. The simplicity of these domains results in a huge loss of precision when dealing with features such as dynamic property access. This paper presents a string analysis for the full JavaScript language based on abstract interpretation. The analysis uses finite state automata to track all possible strings a variable might hold during execution. We present an empirical performance and precision evaluation on some JavaScript benchmarks and show that the analysis achieves a higher level of precision especially when handling dynamic property access.

References

  1. R. Amadini, A. Jordan, G. Gange, F. Gauthier, P. Schachte, H. Søndergaard, P. J. Stuckey, and C. Zhang. Combining string abstract domains for javascript analysis: An evaluation. In A. Legay and T. Margaria, editors, Tools and Algorithms for the Construction and Analysis of Systems, pages 41--57, Berlin, Heidelberg, 2017. Springer Berlin Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. C. Bartzis and T. Bultan. Widening arithmetic automata. In R. Alur and D. A. Peled, editors, Computer Aided Verification, pages 321--333, Berlin, Heidelberg, 2004. Springer Berlin Heidelberg.Google ScholarGoogle ScholarCross RefCross Ref
  3. T.-H. Choi, O. Lee, H. Kim, and K.-G. Doh. A practical string analyzer by the widening approach. In N. Kobayashi, editor, Programming Languages and Systems, pages 374--388, Berlin, Heidelberg, 2006. Springer Berlin Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. S. Christensen, A. Møller, and M. I. Schwartzbach. Precise analysis of string expressions. In R. Cousot, editor, Static Analysis, pages 1--18, Berlin, Heidelberg, 2003. Springer Berlin Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Costantini, P. Ferrara, and A. Cortesi. Static analysis of string values. In S. Qin and Z. Qiu, editors, Formal Methods and Software Engineering, pages 505--521, Berlin, Heidelberg, 2011. Springer Berlin Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 238--252. ACM, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. H. Jensen, A. Møller, and P. Thiemann. Type analysis for JavaScript. In Static Analysis, pages 238--255. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. V. Kashyap, K. Dewey, E. A. Kuefner, J.Wagner, K. Gibbons, J. Sarracino, B. Wiedermann, and B. Hardekopf. Jsai: A static analysis platform for javascript. In 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 121--132. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. H. Lee, S.Won, J. Jin, J. Cho, and S. Ryu. Safe: Formal specification and implementation of a scalable analysis framework for ecmascript. In International Workshop on Foundations of Object-Oriented Languages (FOOL), 2012.Google ScholarGoogle Scholar
  10. M. Madsen and E. Andreasen. String analysis for dynamic field access. In A. Cohen, editor, Compiler Construction, pages 197--217, Berlin, Heidelberg, 2014. Springer Berlin Heidelberg.Google ScholarGoogle ScholarCross RefCross Ref
  11. C. Park, H. Im, and S. Ryu. Precise and scalable static analysis of jquery using a regular expression domain. In Proceedings of the 12th Symposium on Dynamic Languages, DLS 2016, pages 25--36, New York, NY, USA, 2016. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Sridharan, J. Dolby, S. Chandra, M. Schäfer, and F. Tip. Correlation tracking for points-to analysis of javascript. In J. Noble, editor, ECOOP 2012 -- Object-Oriented Programming, pages 435--458, Berlin, Heidelberg, 2012. Springer Berlin Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. F. Yu, T. Bultan, M. Cova, and O. H. Ibarra. Symbolic string verification: An automata-based approach. In K. Havelund, R. Majumdar, and J. Palsberg, editors, Model Checking Software, pages 306--324, Berlin, Heidelberg, 2008. Springer Berlin Heidelberg. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Precise String Analysis for JavaScript Programs Using Automata

      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 Other conferences
        ICSCA '19: Proceedings of the 2019 8th International Conference on Software and Computer Applications
        February 2019
        611 pages
        ISBN:9781450365734
        DOI:10.1145/3316615

        Copyright © 2019 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: 19 February 2019

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed limited

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader