Vulnerabilities in pkg:npm/coursevault-preview

PACKAGE
Advisory Identifier: GHSA-9h9m-rr67-9jpg
Advisory Summary

CVE-2026-35613 is a MODERATE (CVSS 5.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Coursevault preview libraries in the npm ecosystem. The issue involves coursevault-preview has a path traversal due to improper base-directory boundary validation. Remediation is available by upgrading affected packages to version 0.1.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/coursevault-preview

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/coursevault-preview. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9h9m-rr67-9jpg CVE-2026-35613 MODERATE coursevault-preview has a path traversal due to improper base-directory boundary validation

CVE-2026-35613 at a Glance

CVE Identifier CVE-2026-35613
GHSA Identifier GHSA-9h9m-rr67-9jpg
Severity MODERATE
CVSS v3.1 Base Score 5.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Coursevault preview
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-35613

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

coursevault-preview fixed: 0.1.1
npm install coursevault-preview@0.1.1
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 coursevault-preview

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-35613, inspect your project dependencies using npm:

npm ls coursevault-preview

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

Note: The npm ls coursevault-preview 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 Coursevault preview, 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

## Summary `coursevault-preview` versions prior to `0.1.1` contain a path traversal vulnerability in the `resolveSafe` utility. The boundary check used `String.prototype.startsWith(baseDir)` on a normalized path, which does not enforce a directory boundary. An attacker who controls the `relativePath` argument to affected `CoursevaultPreview` methods may be able to read files outside the configured `baseDir` when a sibling directory exists whose name shares the same string prefix. ## Details The vulnerable code in `src/utils/errors.ts`: ```ts if (!full.startsWith(base)) { // ← insufficient throw new Error("Path escapes the base directory"); } ``` Because the check is a raw string prefix test rather than a path-boundary test, the following bypass is possible: ``` baseDir = "/srv/courses" payload = "../courses-admin/config.json" resolved = "/srv/courses-admin/config.json" "/srv/courses-admin/config.json".startsWith("/srv/courses") // → true ✗ ``` Any file whose absolute path begins with the `baseDir` string — including files in sibling directories that share a name prefix — passes the guard and can be accessed by the caller through affected file-access methods. The fix replaces the check with a separator-aware comparison: ```ts if (full !== base && !full.startsWith(base + sep)) { throw new Error("Path escapes the base directory"); } ``` ## Impact An application that passes untrusted input as the `relativePath` argument to affected file-access methods may expose file contents outside the intended directory. 1. Attacker control over the `relativePath` parameter. 2. A sibling directory on the filesystem whose name shares a string prefix with `baseDir`. There is no network exposure in the package itself; impact is limited to local file disclosure within the host process's file system permissions.

CVE-2026-35613 Affected Coursevault preview Versions

1 component(s)
Fixed Versions:
0.1.1
Product / Package Ecosystem Affected Versions Fixed Version
coursevault-preview
npm
< 0.1.1
0.1.1

References

Frequently Asked Questions

What is CVE-2026-35613?
CVE-2026-35613 is a security vulnerability in Coursevault preview involving coursevault-preview has a path traversal due to improper base-directory boundary validation under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Coursevault preview versions are affected?
Affected versions include releases prior to 0.1.1 across affected packages: coursevault-preview.
What version fixes CVE-2026-35613?
Upgrading to 0.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is coursevault-preview affected?
Yes, coursevault-preview is affected in releases prior to 0.1.1. Upgrade your dependency to 0.1.1 or later.
What is the CVSS score of CVE-2026-35613?
CVE-2026-35613 has a CVSS v3.1 base score of 5.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-35613?
CVE-2026-35613 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 CVE-2026-35613?
Run the dependency tree command: 'npm ls coursevault-preview'. 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-9h9m-rr67-9jpg",
  "modified" : "2026-04-08T00:06:03Z",
  "published" : "2026-04-08T00:06:03Z",
  "aliases" : [ "CVE-2026-35613" ],
  "summary" : "coursevault-preview has a path traversal due to improper base-directory boundary validation",
  "details" : "## Summary\n\n`coursevault-preview` versions prior to `0.1.1` contain a path traversal vulnerability in the `resolveSafe` utility. The boundary check used `String.prototype.startsWith(baseDir)` on a normalized path, which does not enforce a directory boundary. An attacker who controls the `relativePath` argument to affected `CoursevaultPreview` methods may be able to read files outside the configured `baseDir` when a sibling directory exists whose name shares the same string prefix.\n\n## Details\n\nThe vulnerable code in `src/utils/errors.ts`:\n\n```ts\nif (!full.startsWith(base)) {   // ← insufficient\n  throw new Error(\"Path escapes the base directory\");\n}\n```\n\nBecause the check is a raw string prefix test rather than a path-boundary test, the following bypass is possible:\n\n```\nbaseDir  = \"/srv/courses\"\npayload  = \"../courses-admin/config.json\"\nresolved = \"/srv/courses-admin/config.json\"\n\n\"/srv/courses-admin/config.json\".startsWith(\"/srv/courses\") // → true ✗\n```\n\nAny file whose absolute path begins with the `baseDir` string — including files in sibling directories that share a name prefix — passes the guard and can be accessed by the caller through affected file-access methods.\n\nThe fix replaces the check with a separator-aware comparison:\n\n```ts\nif (full !== base && !full.startsWith(base + sep)) {\n  throw new Error(\"Path escapes the base directory\");\n}\n```\n\n## Impact\n\nAn application that passes untrusted input as the `relativePath` argument to affected file-access methods may expose file contents outside the intended directory.\n\n1. Attacker control over the `relativePath` parameter.\n2. A sibling directory on the filesystem whose name shares a string prefix with `baseDir`.\n\nThere is no network exposure in the package itself; impact is limited to local file disclosure within the host process's file system permissions.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "coursevault-preview"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/moritzmyrz/coursevault-preview/security/advisories/GHSA-9h9m-rr67-9jpg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35613"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/moritzmyrz/coursevault-preview"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-08T00:06:03Z",
    "nvd_published_at" : "2026-04-07T17:16:35Z"
  }
}