Title :
Dangling references in multi-configuration and dynamic PHP-based Web applications
Author :
Hung Viet Nguyen ; Hoan Anh Nguyen ; Tung Thanh Nguyen ; Anh Tuan Nguyen ; Nguyen, Tuan N.
Author_Institution :
Electr. & Comput. Eng. Dept., Iowa State Univ., Ames, IA, USA
Abstract :
PHP is a dynamic language popularly used in Web development for writing server-side code to dynamically create multiple versions of client-side pages at run time for different configurations. A PHP program contains code to be executed or produced for multiple configurations/versions. That dynamism and multi-configuration nature leads to dangling references. Specifically, in the execution for a configuration, a reference to a variable or a call to a function is dangling if its corresponding declaration cannot be found. We conducted an exploratory study to confirm the existence of such dangling reference errors including dangling cross-language and embedded references in the client-side HTML/JavaScript code and in data-accessing SQL code that are embedded in scattered PHP code. Dangling references have caused run-time fatal failures and security vulnerabilities. We developed DRC, a static analysis method to detect such dangling references. DRC uses symbolic execution to collect PHP declarations/references and to approximate all versions of the generated output, and then extracts embedded declarations/references. It associates each detected declaration/reference with a conditional constraint that represents the execution paths (i.e. configurations/versions) containing that declaration/reference. It then validates references against declarations via a novel dangling reference detection algorithm. Our empirical evaluation shows that DRC detects dangling references with high accuracy. It revealed 83 yet undiscovered defects caused by dangling references.
Keywords :
Internet; SQL; program diagnostics; HTML code; JavaScript code; PHP program; Web development; client-side pages; dangling cross-language; dangling references; data-accessing SQL code; dynamic PHP-based Web applications; dynamic language; embedded references; multiconfiguration nature; multiple configurations; multiple versions; run-time fatal failures; scattered PHP code; static analysis method; writing server-side code; Databases; Detection algorithms; HTML; Reactive power; Security; Servers; Thumb; Dangling References; Web Code Analysis;
Conference_Titel :
Automated Software Engineering (ASE), 2013 IEEE/ACM 28th International Conference on
Conference_Location :
Silicon Valley, CA
DOI :
10.1109/ASE.2013.6693098