Cross-site Scripting (XSS) - Reflected in mariotti94/webrisc-v

Valid

Reported on

Oct 13th 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/Mariotti94/WebRISC-V/ is vulnerable to XSS as shown below:

Proof of concept

Vuln variable: GET and POST variables, for example
Snippet:

            $PC=$_GET["newPC"];
            $PCpiu4=$_GET["PCpiu4"];  

Payload

Visit an affected resource and inject javascript code in a variable:

http://localhost/WebRISC-V-master/src/elements.php?el=if_som&newPC=%3Cscript%3Ealert`xss`%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 created a GitHub Issue asking the maintainers to create a SECURITY.md a year ago
We have contacted a member of the mariotti94/webrisc-v team and are waiting to hear back a year ago
Gianfranco Mariotti validated this vulnerability a year ago
hitisec has been awarded the disclosure bounty
The fix bounty is now up for grabs
Gianfranco Mariotti confirmed that a fix has been merged on 88828e a year ago
Gianfranco Mariotti has been awarded the fix bounty
elements.php#L52-L54 has been validated
to join this conversation