Eval Begone! Semi-Automated Removal of Eval from Java']JavaScript Programs

被引:24
|
作者
Meawad, Fadi [1 ]
Richards, Gregor [1 ]
Morandat, Floreal [1 ]
Vitek, Jan [1 ]
机构
[1] Purdue Univ, W Lafayette, IN 47907 USA
关键词
Languages; Dynamic Languages; !text type='Java']Java[!/text]Script; Reflection; Dynamic Analysis;
D O I
10.1145/2398857.2384660
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Eval endows JavaScript developers with great power. It allows developers and end-users, by turning text into executable code, to seamlessly extend and customize the behavior of deployed applications as they are running. With great power comes great responsibility, though not in our experience. In previous work we demonstrated through a large corpus study that programmers wield that power in rather irresponsible and arbitrary ways. We showed that most calls to eval fall into a small number of very predictable patterns. We argued that those patterns could easily be recognized by an automated algorithm and that they could almost always be replaced with safer JavaScript idioms. In this paper we set out to validate our claim by designing and implementing a tool, which we call Evalorizer, that can assist programmers in getting rid of their unneeded evals. We use the tool to remove eval from a real-world website and validated our approach over logs taken from the top 100 websites with a success rate over 97% under an open world assumption.
引用
收藏
页码:607 / 620
页数:14
相关论文
共 50 条
  • [1] A Tested Semantics for Getters, Setters, and Eval in Java']JavaScript
    Politz, Joe Gibbs
    Carroll, Matthew J.
    Lerner, Benjamin S.
    Pombrio, Justin
    Krishnamurthi, Shriram
    [J]. ACM SIGPLAN NOTICES, 2013, 48 (02) : 1 - 16
  • [2] The Eval That Men Do A Large-Scale Study of the Use of Eval in Java']JavaScript Applications
    Richards, Gregor
    Hammer, Christian
    Burg, Brian
    Vitek, Jan
    [J]. ECOOP 2011 - OBJECT-ORIENTED PROGRAMMING, 2011, 6813 : 52 - 78
  • [3] Is eval () Evil : A study of Java']JavaScript in PDF malware
    Lemay, Antoine
    Leblanc, Sylvain P.
    [J]. PROCEEDINGS OF THE 2018 13TH INTERNATIONAL CONFERENCE ON MALICIOUS AND UNWANTED SOFTWARE (MALWARE 2018), 2018, : 13 - 22
  • [4] Eval Is Evil: Analyzing Performance of Web Applications Based on PHP and Java']JavaScript by Static Analysis
    Shah, Nilay
    Gubbala, Praveen
    [J]. COMPUTING AND NETWORK SUSTAINABILITY, 2017, 12 : 109 - 117
  • [5] Semi-automated Verdicts Assignment for Potentially Malicious Programs
    Oprisa, Ciprian
    Cabau, George
    Pal, Gheorghe Sebestyen
    [J]. 2015 IEEE 11TH INTERNATIONAL CONFERENCE ON INTELLIGENT COMPUTER COMMUNICATION AND PROCESSING (ICCP), 2015, : 125 - 130
  • [6] Semi-Automated Extraction of Rivers from Digital Imagery
    Craig R. Dillabaugh
    K. Olaf Niemann
    Dianne E. Richardson
    [J]. GeoInformatica, 2002, 6 : 263 - 284
  • [7] Semi-automated extraction of brain contours from MRI
    Ong, HT
    Tieman, J
    Albert, M
    Jolesz, F
    Sandor, T
    [J]. NEURORADIOLOGY, 1997, 39 (11) : 797 - 803
  • [8] Semi-automated extraction of brain contours from MRI
    H. T. Ong
    J. Tieman
    M. Albert
    F. Jolesz
    T. Sandor
    [J]. Neuroradiology, 1997, 39 : 797 - 803
  • [9] Semi-automated extraction of rivers from digital imagery
    Dillabaugh, CR
    Niemann, KO
    Richardson, DE
    [J]. GEOINFORMATICA, 2002, 6 (03) : 263 - 284
  • [10] BIOTAS: BIOTelemetry Analysis Software, for the semi-automated removal of false positives from radio telemetry data
    Nebiolo, K.
    Castro-Santos, T.
    [J]. ANIMAL BIOTELEMETRY, 2022, 10 (01)