CVE-2018-3715: Path Traversal in glance

glance Updated 02 Oct 2025

Summary

26/07/2018
Yes i
Moderate
6.5

CVE-2018-3715: Path Traversal in glance. Affects glance versions < 3.0.4. Fixed in 3.0.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The glance package is an npm package used for image recognition and processing. It provides various functionalities for manipulating and analyzing images. However, versions of glance before 3.0.4 are vulnerable to a Path Traversal vulnerability. This vulnerability arises due to the lack of validation of the path passed to the package. As a result, a malicious user can exploit this vulnerability to read the content of any file with a known path.

Vulnerability Detail

The Path Traversal vulnerability in glance allows an attacker to access sensitive files on the system by manipulating the path parameter. By providing a crafted path containing directory traversal sequences (e.g., '../'), an attacker can bypass the intended restrictions and access files outside of the intended directory. This can lead to unauthorized disclosure of sensitive information, such as configuration files, credentials, or other sensitive data stored on the server. The impact of this vulnerability can be severe, depending on the files that can be accessed.

How To Fix

Minimum fixed version

3.0.4

This is the first release that contains the fix.

npm install glance@3.0.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating to the latest version is not immediately feasible, a temporary workaround can be implemented by manually validating the path parameter before passing it to the glance package. This can be done by checking if the requested file path is within the expected directory structure and denying access if it contains any directory traversal sequences. Here is an example of how to implement this workaround in Node.js:

const path = require('path');

function validatePath(filePath) {
  const basePath = '/path/to/expected/directory';
  const resolvedPath = path.resolve(basePath, filePath);

  if (!resolvedPath.startsWith(basePath)) {
    throw new Error('Invalid file path');
  }

  return resolvedPath;
}

// Usage:
const filePath = validatePath(req.query.file);
// Pass the validated filePath to the glance package

Conclusion

The Path Traversal vulnerability in the glance package can allow an attacker to read sensitive files on the system. It is crucial to update to version 3.0.4 or later to mitigate this vulnerability. If immediate updating is not possible, implementing the provided workaround can help protect against potential attacks. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for glance →

Share this vulnerability

FAQ

The impact of this vulnerability can be severe as it allows an attacker to read sensitive files on the system. This can lead to unauthorized disclosure of sensitive information and potentially compromise the security of the application and the server.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. The playground allows you to analyze your package-lock.json file and provides real-time alerts for open-source vulnerabilities.

Yes, a fix is available for this vulnerability. It is recommended to update to version 3.0.4 or later of the glance package to patch the vulnerability.

Yes, if updating to the latest version is not feasible at the moment, you can implement a temporary workaround by manually validating the path parameter before passing it to the glance package. Please refer to the 'workaround' section for more details.

You can find more information about this vulnerability in the GitHub Security Advisory database. The advisory for this vulnerability can be accessed at https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/07/GHSA-2x4q-6jfv-8h9h/GHSA-2x4q-6jfv-8h9h.json.

Related vulnerabilities

Recent vulnerabilities recorded for glance.

How To Fix

Minimum fixed version

3.0.4

This is the first release that contains the fix.

npm install glance@3.0.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback