Skip to content

Reflected XSS in /admin.php?page=plugins&tab=new&installstatus=ok&plugin_id=[here]

Critical
plegall published GHSA-qg85-957m-7vgg Oct 6, 2023

Package

No package listed

Affected versions

<13.8.0

Patched versions

14.0.0beta4

Description

Summary

A reflected cross-site scripting (XSS) vulnerability has been discovered in the /admin.php?page=plugins&tab=new&installstatus=ok&plugin_id=[here] page. This vulnerability can be exploited by an attacker to inject malicious HTML and JS code into the HTML page, which could then be executed by admin users when they visit the URL with the payload.

Details

The vulnerability is caused by the insecure injection of the plugin_id value from the URL into the HTML page. An attacker can exploit this vulnerability by crafting a malicious URL that contains a specially crafted plugin_id value. When a victim who is logged in as an administrator visits this URL, the malicious code will be injected into the HTML page and executed.

Vulnerable code

Using the &installstatus=ok parameter I was able to trigger the function that insecurely injects the plugin_id value of the url into the HTML to render, so we can execute JS

//--------------------------------------------------------------install result
if (isset($_GET['installstatus']))
{
switch ($_GET['installstatus'])
{
case 'ok':
$activate_url = get_root_url().'admin.php?page=plugins'
. '&amp;plugin=' . $_GET['plugin_id']
. '&amp;pwg_token=' . get_pwg_token()
. '&amp;action=activate'
. '&amp;filter=deactivated';
$page['infos'][] = l10n('Plugin has been successfully copied');
$page['infos'][] = '<a href="'. $activate_url . '">' . l10n('Activate it now') . '</a>';

PoC

Logged in as administrator, use the following code as the path to your hosted piwigo application
/admin.php?page=plugins&tab=new&installstatus=ok&plugin_id=nfez2%22%3E%3Cscript%3Eprompt(/SEQODE/)%3C%2fscript%3Ehkugi
image

Impact

This is a reflected cross-site scripting (XSS) vulnerability. XSS is a type of web application vulnerability that allows an attacker to inject malicious code into the web page that is displayed to the victim. The malicious code can then be executed by the victim's browser, which can give the attacker control over the victim's account or even their entire computer.

This vulnerability can be exploited by any attacker who has access to a malicious URL. However, only users who are logged in as administrators are affected. This is because the vulnerability is only present on the /admin.php?page=plugins&tab=new&installstatus=ok&plugin_id=[here] page, which is only accessible to administrators.

Severity

Critical
9.3
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

CVE ID

CVE-2023-44393

Weaknesses

Credits