Cross-site Scripting (XSS) - Reflected in dmpop/mejiro

Valid

Reported on

Sep 14th 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/dmpop/mejiro is vulnerable to XSS as shown below:

Proof of Concept

Variable: d
Method: GET
Snippet:

echo '<a color: #e3e3e3;" href="?page=' . ($current_page + 1) . '&d=' . $sub_photo_dir . '"><img style="margin-right:1em;" src="svg/arrow-right-o.svg"/></a>';

Visit the following url in a browser:

http://localhost/mejiro-main/index.php?page=2test&d=1%22%3E%3Cscript%3Ealert`xssD`%3C/script%3E

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.

We have contacted a member of the dmpop/mejiro team and are waiting to hear back 2 months ago
Dmitri Popov validated this vulnerability 2 months ago
hitisec has been awarded the disclosure bounty
The fix bounty is now up for grabs
Dmitri Popov confirmed that a fix has been merged on 23429b 2 months ago
Dmitri Popov has been awarded the fix bounty