Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-19327

CVE-2026-19327: claude-sesh Path Traversal Vulnerability

CVE-2026-19327 is a path traversal flaw in claude-sesh 1.0.0 affecting the enricher service. Attackers can manipulate sessionId parameters to access unauthorized files. This article covers technical details, impact, and patches.

Published:

CVE-2026-19327 Overview

CVE-2026-19327 is a path traversal vulnerability [CWE-22] in abracadabra50 claude-sesh version 1.0.0. The flaw resides in the getEnrichedData and enrichSession functions within src/services/enricher.ts. An attacker with local access can manipulate the sessionId argument to escape the intended enrichment directory and access files outside its boundaries. The maintainer released commit 786c9d74800e6d0858b65778f31beb71b3983a50 to reject session identifiers that contain path separators or traversal sequences.

Critical Impact

A locally authenticated user can supply crafted sessionId values to read or write files outside the intended ENRICHED_DIR, breaking directory containment for session enrichment data.

Affected Products

  • abracadabra50/claude-sesh version 1.0.0
  • The SessionEnricher class exported from src/services/enricher.ts
  • Deployments consuming the unpatched getEnrichedData / enrichSession code paths

Discovery Timeline

  • 2026-08-09 - CVE-2026-19327 published to NVD
  • 2026-08-12 - Last updated in NVD database

Technical Details for CVE-2026-19327

Vulnerability Analysis

The vulnerability lives in the session enrichment logic of claude-sesh. Both getEnrichedData and enrichSession accept a sessionId string and join it with ENRICHED_DIR to derive an on-disk JSON path. Because the pre-patch code performed no validation on sessionId, values containing .., path separators, or absolute path prefixes traversed outside of ENRICHED_DIR.

The attack requires local access and low privileges, and it does not need user interaction. The impact is bounded to files reachable by the process account, but it undermines the containment guarantee that session identifiers map one-to-one to files inside ENRICHED_DIR. The EPSS estimate for in-the-wild exploitation activity is low.

Root Cause

The root cause is missing input validation on user-controlled path components, a canonical instance of CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). The code trusted sessionId as a safe filename fragment and passed it directly into a path.join / path.resolve operation without asserting that the resolved path remained inside ENRICHED_DIR.

Attack Vector

An attacker with local, authenticated access invokes the enricher with a sessionId such as ../../etc/passwd or an absolute path. The resulting file operation reads or writes a location outside ENRICHED_DIR, depending on the caller. Because the vector is local, remote exploitation over a network is not applicable.

typescript
// Security patch in src/services/enricher.ts
// fix(security): reject path-traversal session IDs in enricher (#2)
   fs.mkdirSync(ENRICHED_DIR, { recursive: true });
 }
 
+// Session IDs are UUID-shaped filenames. Anything else (path separators,
+// "..", absolute paths) could escape ENRICHED_DIR when joined below.
+const SAFE_SESSION_ID = /^[A-Za-z0-9_-]+$/;
+
+function enrichedPathFor(sessionId: string): string {
+  if (!SAFE_SESSION_ID.test(sessionId)) {
+    throw new Error(`Invalid session ID: ${sessionId}`);
+  }
+  const resolved = path.resolve(ENRICHED_DIR, `${sessionId}.json`);
+  if (path.dirname(resolved) !== path.resolve(ENRICHED_DIR)) {
+    throw new Error(`Invalid session ID: ${sessionId}`);
+  }
+  return resolved;
+}
+
 export class SessionEnricher {
   private client: Anthropic | null = null;

Source: GitHub Commit 786c9d7. This patch introduces an allow-list regex (SAFE_SESSION_ID) and verifies that the resolved path's parent equals ENRICHED_DIR before any file I/O.

Detection Methods for CVE-2026-19327

Indicators of Compromise

  • Session identifiers logged by claude-sesh that contain .., /, \, or start with an absolute path prefix.
  • Files created or read outside of the configured ENRICHED_DIR by the claude-sesh process.
  • Application errors or stack traces referencing getEnrichedData or enrichSession with unexpected file paths.

Detection Strategies

  • Grep application logs for sessionId values that do not match the UUID-like pattern ^[A-Za-z0-9_-]+$.
  • Use file integrity monitoring on directories adjacent to ENRICHED_DIR to catch unintended writes.
  • Instrument the SessionEnricher class to emit a warning whenever a resolved path escapes ENRICHED_DIR.

Monitoring Recommendations

  • Audit local user activity on hosts running claude-sesh, focusing on processes that invoke the enrichment API.
  • Alert on filesystem access by the claude-sesh process to paths outside its expected working directory.
  • Track deployed versions of claude-sesh in software inventory to identify unpatched 1.0.0 installs.

How to Mitigate CVE-2026-19327

Immediate Actions Required

  • Update claude-sesh to a build that includes commit 786c9d74800e6d0858b65778f31beb71b3983a50.
  • Restrict local access to systems running claude-sesh to trusted, authenticated users.
  • Review historical ENRICHED_DIR contents and neighboring directories for unexpected files created via the enricher.

Patch Information

The fix is available in commit 786c9d7 of the claude-sesh repository. It adds the SAFE_SESSION_ID allow-list and an enrichedPathFor helper that rejects any sessionId that would resolve outside ENRICHED_DIR. Additional context is available in issue #2 and the VulDB entry.

Workarounds

  • If patching is not immediately possible, wrap calls to getEnrichedData and enrichSession with a validator that enforces ^[A-Za-z0-9_-]+$ on sessionId.
  • Run claude-sesh under a low-privilege service account with filesystem permissions scoped to ENRICHED_DIR only.
  • Mount ENRICHED_DIR on a dedicated filesystem or use OS-level sandboxing to contain traversal attempts.
bash
# Example: enforce UUID-shaped session IDs before invoking claude-sesh
SESSION_ID="$1"
if ! [[ "$SESSION_ID" =~ ^[A-Za-z0-9_-]+$ ]]; then
  echo "Invalid session ID: $SESSION_ID" >&2
  exit 1
fi
node ./dist/cli.js enrich --session "$SESSION_ID"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.