GHSA-f3vw-587g-r29g: Sapper Path Traversal Vulnerability

CRITICAL
CWE-22
Published
Advisory Summary

GHSA-f3vw-587g-r29g is a CRITICAL path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Sapper libraries in the npm ecosystem. The issue involves path traversal in sapper. Remediation is available by upgrading affected packages to version 0.27.11.

GHSA-f3vw-587g-r29g at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f3vw-587g-r29g
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Sapper
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-f3vw-587g-r29g

To remediate this vulnerability, upgrade all affected Sapper dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sapper fixed: 0.27.11
npm install sapper@0.27.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls sapper

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-f3vw-587g-r29g, inspect your project dependencies using npm:

npm ls sapper

Analyze the terminal output to locate any version of Sapper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.27.11), your application is affected.

Note: The npm ls sapper command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Sapper, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Versions of `sapper` prior to 0.27.11 are vulnerable to Path Traversal. It is possible to access sensitive files on the server through HTTP requests containing URL-encoded `../`. You may test a `sapper` application running in prod mode with `curl -vvv http://localhost:3000/client/750af05c3a69ddc6073a/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/etc/passwd`. ## Recommendation Upgrade to version 0.27.11 or later.

GHSA-f3vw-587g-r29g Affected Sapper Versions

1 component(s)
Fixed Versions:
0.27.11
Product / Package Ecosystem Affected Versions Fixed Version
sapper
npm
< 0.27.11
0.27.11

References

Frequently Asked Questions

What is GHSA-f3vw-587g-r29g?
GHSA-f3vw-587g-r29g is a security vulnerability in Sapper involving Path Traversal in sapper under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Sapper versions are affected?
Affected versions include releases prior to 0.27.11 across affected packages: sapper.
What version fixes GHSA-f3vw-587g-r29g?
Upgrading to 0.27.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sapper affected?
Yes, sapper is affected in releases prior to 0.27.11. Upgrade your dependency to 0.27.11 or later.
What CWE is associated with GHSA-f3vw-587g-r29g?
GHSA-f3vw-587g-r29g is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for GHSA-f3vw-587g-r29g?
Run the dependency tree command: 'npm ls sapper'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f3vw-587g-r29g",
  "modified" : "2020-08-31T19:01:20Z",
  "published" : "2020-09-03T15:50:38Z",
  "aliases" : [ ],
  "summary" : "Path Traversal in sapper",
  "details" : "Versions of `sapper` prior to 0.27.11 are vulnerable to Path Traversal. It is possible to access sensitive files on the server through HTTP requests containing URL-encoded `../`.  \n\nYou may test a `sapper` application running in prod mode with `curl -vvv http://localhost:3000/client/750af05c3a69ddc6073a/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/etc/passwd`.\n\n\n## Recommendation\n\nUpgrade to version 0.27.11 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sapper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.27.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1494"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T19:01:20Z",
    "nvd_published_at" : null
  }
}