Skip to content

XSS vulnerability when creating external links with the fileurl parameter

High
netniV published GHSA-wh9c-v56x-v77c Oct 7, 2024

Package

No package listed

Affected versions

1.2.27

Patched versions

1.2.28

Description

Summary

fileurl parameter is not properly sanitized when saving external links in links.php . Morever, the said fileurl is placed in some html code which is passed to the print function in link.php and index.php, finally leading to stored XSS.

Details

Users with the privilege to create external links can manipulate the fileurl parameter in the http post request while creating external links to perform stored XSS attacks. The vulnerability known as XSS (Cross-Site Scripting) occurs when an application allows untrusted user input to be displayed on a web page without proper validation or escaping.

The screenshot below shows that the tester entered the payload below to prove the existence of the XSS vulnerability by leaking the cookies of the victim user.

Payload: http://127.0.0.1/cla" onmouseover="alert('XSS:'+document.cookie)"

1

The screenshot below shows the http post request that was sent. As seen, the payload resides in the fileurl parameter.

2

The screenshot below shows that after creating the external link, simply going to the main page triggers the vulnerability. As seen, an alert box is popped up showing the cookies thereby proving the existence of the stored XSS vulnerability.

3

The following screenshots show the vulnerable codes in the afforementioned php files.

  • In links.php (during save)

4

  • In link.php (during viewing via the link.php)

5

  • In index.php (during viewing via the index.php)

6

PoC

Payload: http://127.0.0.1/cla" onmouseover="alert('XSS:'+document.cookie)"

  • Go to External Links under Utilities menu.
  • Click on + sign to add a new external link.
  • Choose Top of Console Page as style.
  • Give a Tab/Menu Name.
  • Add the payload to Web URL Location (the text field is fileurl parameter) field.
  • Click on save.
  • Finally, either click on Main Console (index.php) to trigger the XSS or click on View Page button on the External Links (link.php) page.

Impact

Performing actions on the web application on behalf of other users such as admin user.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:H

CVE ID

CVE-2024-43362

Weaknesses

No CWEs

Credits