phantm
phantm copied to clipboard
Static analysis using data-flow and type inference for PHP applications - Implemented in Scala
The following code will produce the error Notice: Type mismatch: expected: Array["id" => Any, ...], found: Array["id" => Top] echo $_GET['id']; ```
When inferring types within a function, those should be used to compute the type signature of the function. For example ```
When running phantm against PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) an exception is raised. java -jar ../../../phantm-1.0.7.jar Finder/DefaultFinder.php FinderInterface.php ``` Exception in thread "main" java.lang.RuntimeException: expr() not handling correctly: Closure(List(ArgumentDecl(SimpleVariable(Identifier(file)),Some(THObject(StaticClassRef(NSIdentifier(NSResolved,List(SplFileInfo))))),None,false)),List(ArgumentDecl(SimpleVariable(Identifier(files)),None,None,false)),false,Block(List(Return(BooleanNot(FunctionCall(StaticFunctionRef(NSIdentifier(NSResolved,List(in_array))),List(CallArg(MethodCall(SimpleVariable(Identifier(file)),StaticMethodRef(Identifier(getRelativePathname)),List()),false), CallArg(SimpleVariable(Identifier(files)),false))))))))(/home/skreft/Downloads/PHP-CS-Fixer/Symfony/CS/Finder/DefaultFinder.php line 37 column...
I'd love to re-use the parser component of phantm. Would there be some interest in moving it to a separate repository that can be used independently?
It would be nice if phantm could produce output in Checkstyle XML format so that it can be used in a Continuous Integration environment.
Could PHANTM be modified to detect SQL and XSS injection attacks by having separate types for different strings? If a mysql_query() gets a string that isn't SQL safe, it's counted...