Skip to content

Path Traversal and Endpoint Bypass in Glances Widget Handler

Moderate
shamoon published GHSA-rg3r-jprv-xq38 Apr 1, 2026

Package

homepage

Affected versions

< 1.12.2

Patched versions

1.12.3

Description

Summary

The Glances widget handler (src/pages/api/widgets/glances.js) interpolates the user-controlled version query parameter directly into outbound HTTP request URLs without sanitization. This enables path traversal on the Glances backend server, with stored Basic Auth credentials forwarded to the traversed path.

Additionally, the allowedEndpoints regex in src/widgets/glances/widget.js has broken alternation precedence, but the custom Glances handler bypasses this regex entirely.

Details

Path Traversal via version parameter

src/pages/api/widgets/glances.js:

  • Line 45: version comes from req.query.version (user-controlled)
  • Line 48: Assigned to privateWidgetOptions.version with only nullish fallback to 3
  • Line 16: Interpolated into URL: `${url}/api/${privateWidgetOptions.version}/${endpoint}`

An attacker supplying version=3/../../anything gets path traversal in the outbound HTTP request to the Glances backend.

Broken regex (secondary issue)

src/widgets/glances/widget.js line 6:

allowedEndpoints: /\d\/quicklook|diskio|cpu|fs|gpu|system|mem|network|processlist|sensors|containers/

Due to regex alternation precedence, this matches ANY string containing cpu, fs, mem, etc. Missing grouping parens: should be /\d\/(quicklook|diskio|cpu|...)$/.

Impact

  • Path traversal on Glances backend with forwarded credentials
  • Access to unintended Glances API endpoints or other services behind the same host
  • Credential leakage if the traversed path reaches a different service

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
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
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:L/UI:N/S:U/C:L/I:N/A:N

CVE ID

No known CVE

Weaknesses

No CWEs

Credits