Skip to content

Stored XSS in results JSON API

Moderate
adolfintel published GHSA-3954-xrwh-fq4q Apr 30, 2024

Package

docker ghcr.io/librespeed/speedtest (Docker)

Affected versions

>= 5.2.5, <= 5.3.0

Patched versions

5.3.1
librespeed/speedtest
>= 5.2.5, <= 5.3.0
5.3.1

Description

Summary

Missing neutralization of the ISP information in a speedtest result and an incorrect Content-Type HTTP header in the JSON API leads to stored Cross-site scripting vulnerability.

Details

The processedString field in the ispinfo parameter is missing neutralization. It is stored when a user submits a speedtest result to the telemetry API (results/telemetry.php) and returned in the JSON API (results/json.php). The JSON API also doesn't set Content-Type: application/json HTTP header.
This vulnerability has been introduced in 3937b94.

PoC

  1. Start Librespeed with telemetry enabled: docker run -it -p 80:80 -e TELEMETRY=true ghcr.io/librespeed/speedtest
  2. Send an arbitrarily crafted speedtest result: curl "http://localhost/results/telemetry.php" --data 'ispinfo={"processedString":"foo - bar <body onpageshow=alert`XSS`>"}&dl=1&ul=1&ping=1&jitter=1&log=&extra='
  3. Open JSON endpoint with speedtest ID from above, e.g. http://localhost/results/json.php?id=1

Impact

This vulnerability affects LibreSpeed speedtest instances running version 5.2.5 or higher and have telemetry enabled.

Severity

Moderate

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
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

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:N/UI:R/S:C/C:L/I:L/A:N

CVE ID

CVE-2024-32890

Weaknesses

Credits