Cross-site Scripting (XSS) - Reflected in sbrl/pepperminty-wiki

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/sbrl/Pepperminty-Wiki/ is vulnerable to XSS as shown below:

Proof of Concept

Release index.php:7132
Variable: $_GET["format"]
Snippet

            $format = $_GET["format"] ?? "html";
            
            if(!in_array($format, $allowed_formats)) {
                http_response_code(400);
                exit(page_renderer::render_main("Format error - $settings->sitename", "<p>Error: The format '$format' is not currently supported by this action on $settings->sitename. Supported formats: " . implode(", ", $allowed_formats) . "."));

Payload:
Open in a browser the following link:

localhost/Pepperminty-Wiki/index.php?action=stats&format=<script>alert`xss`</script>

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.

Z-Old
2 years ago

Admin


Hey hitisec, I've emailed the maintainers for you.

We have contacted a member of the sbrl/pepperminty-wiki team and are waiting to hear back 2 years ago
Starbeamrainbowlabs marked this as fixed with commit 4be6a1 2 years ago
The fix bounty has been dropped
This vulnerability will not receive a CVE
Starbeamrainbowlabs
2 years ago

Maintainer


Yep, I must have missed this one - it was bound to happen in my comprehensive review due to issue #222. Thanks for reporting!

to join this conversation