Phpmoneybooks 1.03 stored XSS and repair

Source: Internet
Author: User

Title: phpmoneybooks 1.03 Stored XSS
Author: chap0-chap0.blogspot.com-@ _ chap0
Official Website: http://phpmoneybooks.com/
: Http://sourceforge.net/projects/phpmoneybooks/files/phpMoneyBooks103.zip/download
Affected procedures: 1.03
 
Patch: upgrade to 1.04
 
Program introduction:
 
PhpMoneyBooks is an open sourced php/mysql program. A free alternative to QuickBooks.
 
Abstract:
Phpmoneybooks 1.03 is vulnerable to Stored XSS vulnerability enabling an attacker
 
To execute arbitrary JavaScript code withing the application. The vulnerability
 
Can be utilized when adding a new bank account or customer account. Users other
 
Then the admin account is able to input this information which in return can
 
Enable the super admin user to fall victim to this attack. The vulnerable index
 
Pages reside in/banks/index. php and/Mers MERs/index. php.
 

 
Stored XSS example
 

 
'> <Script> alert ('xss') </script>
 

Defect code
 
Www.2cto.com/banks/index. php
 

 
40 $ _ POST [AcctName] = trim ($ _ POST [AcctName]);
 
41 if (strtolower ($ row [1]) = strtolower ($ _ POST ['acctname']) {
 
42 echo "<script type = 'text/javascript '>
 
43 alert ('duplicate account: $ _ POST [AcctName] already exists .');
 
44 </script> ";
 
45 $ _ GET [action] = "AddForm ";
 

 

 
/Customers/index. php
 

 
36 if ($ _ GET [action] = "AddUser "){
 

 
37 $ query = "insert into phpMB_customers (AcctNo, DisplayName, CompanyName, MrMs, FirstName, MiddleIn, LastName, Contact, Phone, Phone2, Fax, Email, Rela
 
Tion, BillingAddress, ShippingAddress, Notes) VALUES ('$ _ POST [AcctNo]', '$ _ POST [DisplayName]', '$ _ POST [CompanyName]', '$ _ POST [MrMs]', '$ _ POST [FirstName]', '$ _ POST [MiddleIn]', '$ _ POST [LastName]', '$ _ POST [Contact]', '$ _ POST [Phone]', '$ _ POST [Phone2]', '$ _ POST [FAX]', '$ _ POST
 
[Email] ', 'customer',' $ _ POST [BillingAddress] ',' $ _ POST [ShippingAddress] ',' $ _ POST [Notes] ') ";
 

 
38 QueryMysql ($ query );
 
39 $ _ GET [action] = "";
 

 

 
By adding strip_tags to the strings in the php code allows the user input to be sanitized.
 

 
A couple of other vulnerabilities that exist in this application:
 

 
Usernames and passwords sent in clear text at log in.
 

 
The users cookie gets set as username and MD5 password of the user. With this if
 
Attacker inject javascript that steals cookies, the attacker will obtain the users username
 
And MD5 hashed password.
 

 
These two vulnerabilities are not fix, vendor was notified and is aware.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.