CVE-2026-55156: Token Optimizer MCP Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-76pc-mqxp-3rq5
CVSS 5.3
CWE-22
Published
Advisory Summary

CVE-2026-55156 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Token Optimizer MCP libraries in the npm ecosystem. The issue involves unauthenticated path traversal in dashboard session log api endpoints. Remediation is available by upgrading affected packages to version 5.1.0.

CVE-2026-55156 at a Glance

CVE Identifier CVE-2026-55156
GHSA Identifier GHSA-76pc-mqxp-3rq5
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Token Optimizer MCP
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2026-55156

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

@ooples/token-optimizer-mcp fixed: 5.1.0
npm install @ooples/token-optimizer-mcp@5.1.0
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 @ooples/token-optimizer-mcp

How to Check if You Are Affected

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

npm ls @ooples/token-optimizer-mcp

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

Note: The npm ls @ooples/token-optimizer-mcp 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 Token Optimizer MCP, 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

# Unauthenticated Path Traversal in Dashboard Session Log API Endpoints | Field | Value | | ---------------- | ----- | | Repository | ooples/token-optimizer-mcp | | Affected version | 5.0.1 (commit 8137147) | | Vulnerability | CWE-22 — Improper Limitation of a Pathname to a Restricted Directory | | Severity | Medium | | CVSS 3.1 | 5.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N) | ## Summary The dashboard HTTP server in `token-optimizer-mcp` exposes `/api/session-summary` and `/api/session-events` with no authentication middleware — any network-accessible client can reach them without credentials. Both handlers concatenate the caller-supplied `sessionId` query parameter directly into a filesystem path via `path.join`, and Node.js normalizes `..` segments at resolution time, allowing an unauthenticated attacker to read any `.jsonl` file reachable from the server's filesystem. Successful reproduction confirmed exfiltration of a `.jsonl` file located outside the intended `hooksDataPath` directory with a single unauthenticated HTTP GET request. ## Affected Code `src/server/web-server.ts:73–88` — `/api/session-summary`: unsanitized `sessionId` interpolated into `path.join` then passed to `fs.readFileSync` ```typescript const hooksDataPath = getHooksDataPath(); const jsonlFilePath = path.join( hooksDataPath, `session-log-${sessionId}.jsonl` ); if (!fs.existsSync(jsonlFilePath)) { return res.status(404).json({ success: false, error: `JSONL log not found for session ${sessionId}`, sessionId, }); } // Parse JSONL file const jsonlContent = fs.readFileSync(jsonlFilePath, 'utf-8'); ``` `src/server/web-server.ts:297–311` — `/api/session-events`: identical unsanitized `path.join` + `fs.readFileSync` pattern ```typescript const hooksDataPath = getHooksDataPath(); const jsonlFilePath = path.join( hooksDataPath, `session-log-${sessionId}.jsonl` ); if (!fs.existsSync(jsonlFilePath)) { return res.status(404).json({ success: false, error: `JSONL log not found for session ${sessionId}`, }); } // Parse JSONL file const jsonlContent = fs.readFileSync(jsonlFilePath, 'utf-8'); ``` `req.query.sessionId` flows unsanitized into `path.join(hooksDataPath, \`session-log-${sessionId}.jsonl\`)`, which Node.js resolves by normalizing `..` traversal sequences before the `fs.readFileSync` call. ## Proof of Concept Step 1 — Send traversal payload to `/api/session-events` with no credentials: server returns HTTP 200 with contents of a `.jsonl` file outside `hooksDataPath` — proves unauthenticated out-of-bounds file read. ```bash curl -s "http://127.0.0.1:3100/api/session-events?sessionId=abc%2F..%2F..%2F..%2F..%2Ftraversal-target" ``` ```http GET /api/session-events?sessionId=abc%2F..%2F..%2F..%2F..%2Ftraversal-target HTTP/1.1 Host: 127.0.0.1:3100 User-Agent: python-requests/2.x Accept: */* ``` ```http HTTP/1.1 200 OK X-Powered-By: Express Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 Content-Length: 186 {"success":true,"sessionId":"abc/../../../../traversal-target","total":1,"offset":0,"limit":100,"events":[{"type":"PATH_TRAVERSAL_EVIDENCE","secret":"sensitive-data-outside-hooks-dir"}]} ``` ## Impact An unauthenticated remote attacker can read the contents of any `.jsonl` file accessible to the process running the dashboard server. In a typical deployment this includes all session log files (which contain tool invocations, hook outputs, and token usage data) as well as any other `.jsonl` file reachable via `..` traversal from `hooksDataPath`. The constraint that the resolved path must end in `.jsonl` limits the attack surface to that file extension, but session logs can contain sensitive operational data. The same path traversal is present in both `/api/session-summary` and `/api/session-events`, and neither endpoint requires authentication. ## Remediation 1. **Validate `sessionId` format** before use: reject any value that does not match a strict allowlist such as `/^[a-zA-Z0-9_-]{1,64}$/`. This prevents `/` and `.` characters from entering the path construction entirely. ```typescript const SESSION_ID_RE = /^[a-zA-Z0-9_-]{1,64}$/; if (!SESSION_ID_RE.test(sessionId)) { return res.status(400).json({ success: false, error: 'Invalid sessionId' }); } ``` 2. **Alternatively, apply `path.basename`** to strip all directory components: `path.basename(sessionId)` reduces any traversal sequence to a bare filename before `path.join`. 3. **Add authentication middleware** to all `/api/*` routes so that even if a bypass is found the endpoints are not reachable without a valid session token.

CVE-2026-55156 Affected Token Optimizer MCP Versions

1 component(s)
Fixed Versions:
5.1.0
Product / Package Ecosystem Affected Versions Fixed Version
@ooples/token-optimizer-mcp
npm
< 5.1.0
5.1.0

References

Frequently Asked Questions

What is CVE-2026-55156?
CVE-2026-55156 is a security vulnerability in Token Optimizer MCP involving Unauthenticated Path Traversal in Dashboard Session Log API Endpoints under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Token Optimizer MCP versions are affected?
Affected versions include releases prior to 5.1.0 across affected packages: @ooples/token-optimizer-mcp.
What version fixes CVE-2026-55156?
Upgrading to 5.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @ooples/token-optimizer-mcp affected?
Yes, @ooples/token-optimizer-mcp is affected in releases prior to 5.1.0. Upgrade your dependency to 5.1.0 or later.
What is the CVSS score of CVE-2026-55156?
CVE-2026-55156 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-55156?
CVE-2026-55156 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-55156?
Run the dependency tree command: 'npm ls @ooples/token-optimizer-mcp'. 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-76pc-mqxp-3rq5",
  "modified" : "2026-08-14T21:43:55Z",
  "published" : "2026-08-14T21:43:54Z",
  "aliases" : [ "CVE-2026-55156" ],
  "summary" : "Token Optimizer MCP: Unauthenticated Path Traversal in Dashboard Session Log API Endpoints",
  "details" : "# Unauthenticated Path Traversal in Dashboard Session Log API Endpoints\n\n| Field            | Value |\n| ---------------- | ----- |\n| Repository       | ooples/token-optimizer-mcp |\n| Affected version | 5.0.1 (commit 8137147) |\n| Vulnerability    | CWE-22 — Improper Limitation of a Pathname to a Restricted Directory |\n| Severity         | Medium |\n| CVSS 3.1         | 5.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N) |\n\n\n## Summary\n\nThe dashboard HTTP server in `token-optimizer-mcp` exposes `/api/session-summary` and `/api/session-events` with no authentication middleware — any network-accessible client can reach them without credentials. Both handlers concatenate the caller-supplied `sessionId` query parameter directly into a filesystem path via `path.join`, and Node.js normalizes `..` segments at resolution time, allowing an unauthenticated attacker to read any `.jsonl` file reachable from the server's filesystem. Successful reproduction confirmed exfiltration of a `.jsonl` file located outside the intended `hooksDataPath` directory with a single unauthenticated HTTP GET request.\n\n## Affected Code\n\n`src/server/web-server.ts:73–88` — `/api/session-summary`: unsanitized `sessionId` interpolated into `path.join` then passed to `fs.readFileSync`\n\n```typescript\n    const hooksDataPath = getHooksDataPath();\n    const jsonlFilePath = path.join(\n      hooksDataPath,\n      `session-log-${sessionId}.jsonl`\n    );\n\n    if (!fs.existsSync(jsonlFilePath)) {\n      return res.status(404).json({\n        success: false,\n        error: `JSONL log not found for session ${sessionId}`,\n        sessionId,\n      });\n    }\n\n    // Parse JSONL file\n    const jsonlContent = fs.readFileSync(jsonlFilePath, 'utf-8');\n```\n\n`src/server/web-server.ts:297–311` — `/api/session-events`: identical unsanitized `path.join` + `fs.readFileSync` pattern\n\n```typescript\n    const hooksDataPath = getHooksDataPath();\n    const jsonlFilePath = path.join(\n      hooksDataPath,\n      `session-log-${sessionId}.jsonl`\n    );\n\n    if (!fs.existsSync(jsonlFilePath)) {\n      return res.status(404).json({\n        success: false,\n        error: `JSONL log not found for session ${sessionId}`,\n      });\n    }\n\n    // Parse JSONL file\n    const jsonlContent = fs.readFileSync(jsonlFilePath, 'utf-8');\n```\n\n`req.query.sessionId` flows unsanitized into `path.join(hooksDataPath, \\`session-log-${sessionId}.jsonl\\`)`, which Node.js resolves by normalizing `..` traversal sequences before the `fs.readFileSync` call.\n\n## Proof of Concept\n\nStep 1 — Send traversal payload to `/api/session-events` with no credentials: server returns HTTP 200 with contents of a `.jsonl` file outside `hooksDataPath` — proves unauthenticated out-of-bounds file read.\n\n```bash\ncurl -s \"http://127.0.0.1:3100/api/session-events?sessionId=abc%2F..%2F..%2F..%2F..%2Ftraversal-target\"\n```\n\n```http\nGET /api/session-events?sessionId=abc%2F..%2F..%2F..%2F..%2Ftraversal-target HTTP/1.1\nHost: 127.0.0.1:3100\nUser-Agent: python-requests/2.x\nAccept: */*\n```\n\n```http\nHTTP/1.1 200 OK\nX-Powered-By: Express\nAccess-Control-Allow-Origin: *\nContent-Type: application/json; charset=utf-8\nContent-Length: 186\n\n{\"success\":true,\"sessionId\":\"abc/../../../../traversal-target\",\"total\":1,\"offset\":0,\"limit\":100,\"events\":[{\"type\":\"PATH_TRAVERSAL_EVIDENCE\",\"secret\":\"sensitive-data-outside-hooks-dir\"}]}\n```\n\n## Impact\n\nAn unauthenticated remote attacker can read the contents of any `.jsonl` file accessible to the process running the dashboard server. In a typical deployment this includes all session log files (which contain tool invocations, hook outputs, and token usage data) as well as any other `.jsonl` file reachable via `..` traversal from `hooksDataPath`. The constraint that the resolved path must end in `.jsonl` limits the attack surface to that file extension, but session logs can contain sensitive operational data. The same path traversal is present in both `/api/session-summary` and `/api/session-events`, and neither endpoint requires authentication.\n\n## Remediation\n\n1. **Validate `sessionId` format** before use: reject any value that does not match a strict allowlist such as `/^[a-zA-Z0-9_-]{1,64}$/`. This prevents `/` and `.` characters from entering the path construction entirely.\n\n   ```typescript\n   const SESSION_ID_RE = /^[a-zA-Z0-9_-]{1,64}$/;\n   if (!SESSION_ID_RE.test(sessionId)) {\n     return res.status(400).json({ success: false, error: 'Invalid sessionId' });\n   }\n   ```\n\n2. **Alternatively, apply `path.basename`** to strip all directory components: `path.basename(sessionId)` reduces any traversal sequence to a bare filename before `path.join`.\n\n3. **Add authentication middleware** to all `/api/*` routes so that even if a bypass is found the endpoints are not reachable without a valid session token.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@ooples/token-optimizer-mcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ooples/token-optimizer-mcp/security/advisories/GHSA-76pc-mqxp-3rq5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ooples/token-optimizer-mcp/commit/b4ee96dac799cbfba0a9f9c17844ce9d613cbcc7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ooples/token-optimizer-mcp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ooples/token-optimizer-mcp/releases/tag/v5.1.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-14T21:43:54Z",
    "nvd_published_at" : null
  }
}