Cross-site Scripting (XSS) - Reflected in shannah/xataface
Reported on
Oct 1st 2021
Description
Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into websites. An attacker can use XSS to send a malicious script to an unsuspecting user. The end user’s browser has no way to know that the script should not be trusted, and will execute the script.
https://github.com/shannah/xataface
is vulnerable to XSS as shown below:
Proof of concept
Vuln variable: POST variables , for example: -dbuser
Snippet:
$res = $this->test_db_access($_REQUEST['-dbname'], $_REQUEST['-dbuser'], $_REQUEST['-dbpass']);
if ( PEAR::isError($res) ){
$msg = array(
'success' => false,
'message' => $res->getMessage()
);
Go to http://localhost/xataface-master/installer.php
Insert db credentials
Select Create application for existing database
Select any database
Under step2, insert into -dbuser the following:
user'</div><img src="x" onerror=alert`xss`>
Observe the XSS
Impact
Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page.
SECURITY.md
2 years ago
This report neglects to mention the fact that this file is disabled by default. I.e. if you follow the steps described, you just see the message "The installer is currently disabled. To enable it, please rename the 'installer.disabled' file to 'installer.enabled'. You can find this file inside the root xataface directory."
Fixed https://github.com/shannah/xataface/commit/94143a4299e386f33bf582139cd4702571d93bde https://github.com/shannah/xataface/commit/d486a014570f7f4e01c0e5618e3826bed87ad5bb
While this XSS vulnerability is valid, it is unlikely this affects anyone because:
- The installer is disabled by default, and must be explicitly enabled to even access this file.
- The user requires a root/admin password for the mysql database in order to access this file, which would limit access to trusted users only.
Thanks, can you validate the report on this platform if you agree with it? Regards