Cross-site Scripting (XSS) - Reflected in yeswiki/yeswiki
Oct 5th 2021
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/YesWiki/yeswiki/ is vulnerable to XSS as shown below:
Proof of concept
$filter = $_GET['filter']
$filter = $_GET['filter'] ?? null; ... $search = ' AND body LIKE \'%"id_typeannonce":"' . $filter . '"%\''; ... $liste_pages = $this->Query('SELECT * FROM '.$table."pages WHERE latest='Y' ".($search ?? '')."ORDER BY " .$table.'pages.tag ASC');
XSS is posible via query error messages.
Login as admin in yeswiki
Got to http://localhost/yeswiki-doryphore/?GererDroits and insert xss in the filter var
Observe the XSS.
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.