An Executable Formal Semantics of PHP
An Executable Formal Semantics of PHP
复制标题
DOI:
10.1007/978-3-662-44202-9_23
复制
发表时间:
2014-08
期刊:
影响因子:
--
通讯作者:
Daniele Filaretti;S. Maffeis
中科院分区:
文献类型:
--
作者:
Daniele Filaretti;S. Maffeis
PHP is among the most used languages for server-side scripting. Although substantial effort has been spent on the problem of automatically analysing PHP code, vulnerabilities remain pervasive in web applications, and analysis tools do not provide any formal guarantees of soundness or coverage. This is partly due to the lack of a precise specification of the language, which is highly dynamic and often exhibits subtle behaviour.We present the first formal semantics for a substantial core of PHP, based on the official documentation and experiments with the Zend reference implementation. Our semantics is executable, and is validated by testing it against the Zend test suite. We define the semantics of PHP in a term-rewriting framework which supports LTL model checking and symbolic execution. As a demonstration, we extend LTL with predicates for the verification of PHP programs, and analyse two common PHP functions.