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 条
  • [31] Semi-automated development of conceptual models from natural language text
    Omar, Mussa
    Baryannis, George
    [J]. DATA & KNOWLEDGE ENGINEERING, 2020, 127 (127)
  • [32] SEMI-AUTOMATED CLOUD/SHADOW REMOVAL AND LAND COVER CHANGE DETECTION USING SATELLITE IMAGERY
    Sah, A. K.
    Sah, B. P.
    Honji, K.
    Kubo, N.
    Senthil, S.
    [J]. XXII ISPRS CONGRESS, TECHNICAL COMMISSION VII, 2012, 39 (B7): : 335 - 340
  • [33] Semi-automated background removal limits data loss and normalizes imaging mass cytometry data
    Ijsselsteijn, Marieke E.
    Somarakis, Antonios
    Lelieveldt, Boudewijn P. F.
    Hollt, Thomas
    Miranda, Noel F. C. C.
    [J]. CYTOMETRY PART A, 2021, 99 (12) : 1187 - 1197
  • [34] A method of semi-automated ontology population from multiple semi-structured data sources
    Leshcheva, Irina
    Begler, Alena
    [J]. JOURNAL OF INFORMATION SCIENCE, 2022, 48 (02) : 223 - 236
  • [35] Semi-automated algorithm for cortical and trabecular bone separation from CT scans
    Janc, K.
    Tarasiuk, J.
    Bonnet, A. S.
    Lipinski, P.
    [J]. COMPUTER METHODS IN BIOMECHANICS AND BIOMEDICAL ENGINEERING, 2011, 14 : 217 - 218
  • [36] Development and validation of a semi-automated and unsupervised method for femur segmentation from CT
    Aldieri, Alessandra
    Biondi, Riccardo
    La Mattina, Antonino A.
    Szyszko, Julia A.
    Polizzi, Stefano
    Dall'Olio, Daniele
    Curti, Nico
    Castellani, Gastone
    Viceconti, Marco
    [J]. SCIENTIFIC REPORTS, 2024, 14 (01)
  • [37] Reproducible protocol for the extraction and semi-automated quantification of macroscopic charcoal from soil
    Ruiz-Perez, Javier
    Aleman, Julie C.
    Veldman, Joseph W.
    [J]. PLOS ONE, 2024, 19 (07):
  • [38] Semi-automated, Membrane-Based Protocol for DNA Isolation from Plants
    Ivanova, Natalia V.
    Fazekas, Aron J.
    Hebert, Paul D. N.
    [J]. PLANT MOLECULAR BIOLOGY REPORTER, 2008, 26 (03) : 186 - 198
  • [39] Semi-Automated Field Plot Segmentation From UAS Imagery for Experimental Agriculture
    Robb, Ciaran
    Hardy, Andy
    Doonan, John H.
    Brook, Jason
    [J]. FRONTIERS IN PLANT SCIENCE, 2020, 11
  • [40] iSyn: Semi-automated Smart Contract Synthesis from Legal Financial Agreements
    Fang, Pengcheng
    Zou, Zhenhua
    Xiao, Xusheng
    Liu, Zhuotao
    [J]. PROCEEDINGS OF THE 32ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2023, 2023, : 727 - 739