CVE-2022-25937: jarofghosts glance path traversal in static file server

CVE-2022-25937 · Severity: low · CVSS 3.1 · Published 2023-02-13

glance is a lightweight HTTP server used for serving static files. A security flaw allows an attacker to bypass directory restrictions and access files on the host system that should be private. This could lead to the exposure of sensitive configuration files, source code, or other data stored outside the intended public folder.

Technologies: glance (npm). Vendors: npm.

Quick answers

Is CVE-2022-25937 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-25937 being exploited in the wild.
How severe is CVE-2022-25937?
Low severity, with a CVSS score of 3.1, published 13 February 2023.
Which products and versions are affected?
glance (npm) SEMVER:introduced=0,fixed=3.0.9.
Is there a fix for CVE-2022-25937?
Yes. glance (npm): upgrade to 3.0.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2022-25937 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2022-25937?
Check whether you run glance (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • glance (npm): upgrade to 3.0.9 or later
    npm install glance@3.0.9

Technical details

A path traversal vulnerability (CWE-22) exists in glance versions prior to 3.0.9. The issue stems from an incomplete fix for a previous traversal bug (CVE-2018-3715), where the application fails to properly validate that requested paths remain within the boundaries of the configured public directory. An attacker can use '..' sequences in a URL to access sibling directories that share a partial name or similar path structure with the public root. Exploitation requires network access to the running glance server and can result in unauthorized disclosure of local files. The vulnerability is resolved in version 3.0.9.

Affected products

  • jarofghosts glance < 3.0.9

Identifiers

  • CVE-2022-25937
  • GHSA-3hjh-5hgx-f5wh

Timeline

  • 2022-09-26: disclosed: Initial discovery and PoC shared via GitHub Gist
  • 2023-02-12: advisory: Snyk published advisory SNYK-JS-GLANCE-3318395
  • 2023-02-13: patched: Version 3.0.9 released with fix

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.