CVE-2026-55156
JavaScript Análise e mitigação de vulnerabilidades

Visão geral

CVE-2026-55156 is an unauthenticated path traversal vulnerability in the token-optimizer-mcp npm package (by ooples) affecting version 5.0.1 (commit 8137147). The dashboard HTTP server exposes /api/session-summary and /api/session-events endpoints with no authentication, and both handlers unsafely concatenate a caller-supplied sessionId query parameter into a filesystem path, enabling arbitrary .jsonl file reads outside the intended directory. The vulnerability was first published on June 10, 2026, and added to the GitHub Advisory Database on August 14, 2026. It carries a CVSS v3.1 base score of 5.3 (Medium) (GitHub Advisory, Security Advisory).

Detalhes técnicos

The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). In src/server/web-server.ts (lines 73–88 and 297–311), the sessionId query parameter is passed directly to path.join(hooksDataPath, \session-log-${sessionId}.jsonl`)without sanitization, and Node.js normalizes..segments at resolution time before the resulting path is passed tofs.readFileSync. Because neither endpoint has authentication middleware, any network-accessible client can send a crafted HTTP GET request with URL-encoded traversal sequences (e.g., abc%2F..%2F..%2F..%2F..%2Ftarget) to read any .jsonl` file reachable by the server process. The attack requires no privileges, no user interaction, and low complexity — only network access to the dashboard server (default port 3100) (GitHub Advisory, Security Advisory).

Impacto

An unauthenticated remote attacker can read the contents of any .jsonl file accessible to the process running the dashboard server. In typical deployments, this includes all session log files containing tool invocations, hook outputs, and token usage data, as well as any other .jsonl file reachable via .. traversal from hooksDataPath. The attack surface is constrained to files with the .jsonl extension, limiting but not eliminating the risk — session logs may contain sensitive operational data such as AI tool inputs, outputs, and configuration details. There is no integrity or availability impact (GitHub Advisory).

Exploração

A public proof-of-concept is included in the official advisory, demonstrating exploitation with a single unauthenticated curl command. No privileges or user interaction are required, and the attack complexity is low. There is no current evidence of in-the-wild exploitation, threat actor attribution, or CISA KEV catalog listing. The CVE status is listed as Reserved, and no EPSS score is currently published (GitHub Advisory, Security Advisory).

Etapas de exploração

  1. Reconnaissance: Identify hosts running token-optimizer-mcp version 5.0.1 with the dashboard HTTP server exposed on port 3100 (default). Scan for open port 3100 using tools like nmap or masscan.
  2. Confirm target: Send a benign request to /api/session-summary or /api/session-events without credentials to confirm the endpoint responds (HTTP 200 or 404), verifying no authentication is enforced.
  3. Craft traversal payload: Construct a sessionId value containing URL-encoded path traversal sequences pointing to a target .jsonl file outside hooksDataPath, e.g., abc%2F..%2F..%2F..%2F..%2Ftarget-file.
  4. Send exploit request: Issue an unauthenticated HTTP GET request: curl -s "http://<target>:3100/api/session-events?sessionId=abc%2F..%2F..%2F..%2F..%2Ftarget-file". Node.js normalizes the traversal sequences and fs.readFileSync reads the resolved path.
  5. Exfiltrate data: If the target .jsonl file exists, the server returns HTTP 200 with its contents in the JSON response body, confirming successful out-of-bounds file read (GitHub Advisory, Security Advisory).

Indicadores de compromisso

  • Network: Inbound HTTP GET requests to port 3100 targeting /api/session-summary or /api/session-events with sessionId parameters containing URL-encoded path separators (%2F) or dot sequences (%2E%2E, ..).
  • Logs: Express/Node.js access logs showing requests such as GET /api/session-events?sessionId=abc%2F..%2F..%2F..%2F..%2F<filename> returning HTTP 200 with unexpected content lengths.
  • Process: Unexpected file reads by the Node.js dashboard server process to .jsonl files outside the ~/.claude-global/hooks/data/ directory, observable via filesystem audit tools (e.g., auditd, inotifywait) or process monitoring.

Mitigação e soluções alternativas

Upgrade to @ooples/token-optimizer-mcp version 5.1.0 (released July 20, 2026), which validates sessionId against the strict regex /^[A-Za-z0-9_-]{1,64}$/ on both affected endpoints, adds a secondary path.resolve + containment check to ensure the resolved path stays within hooksDataPath, and applies an express-rate-limit middleware (300 req/min) to all routes (v5.1.0 Release, Fix Commit). As a workaround prior to upgrading, restrict network access to port 3100 to trusted hosts only using firewall rules, and add authentication middleware to all /api/* routes (GitHub Advisory).

Recursos adicionais


OrigemEste relatório foi gerado usando IA

Relacionado JavaScript Vulnerabilidades:

CVE ID

Gravidade

Pontuação

Tecnologias

Nome do componente

Exploração do CISA KEV

Tem correção

Data de publicação

CVE-2026-77415CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NãoSimAug 21, 2026
CVE-2026-77414CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NãoSimAug 21, 2026
CVE-2026-77413CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NãoSimAug 21, 2026
CVE-2026-63421HIGH7.5
  • JavaScript logoJavaScript
  • @keystone-6/core
NãoSimAug 21, 2026
CVE-2026-53509MEDIUM5.7
  • JavaScript logoJavaScript
  • @aborruso/ckan-mcp-server
NãoSimAug 21, 2026

Avaliação de vulnerabilidade gratuita

Compare sua postura de segurança na nuvem

Avalie suas práticas de segurança na nuvem em 9 domínios de segurança para comparar seu nível de risco e identificar lacunas em suas defesas.

Solicitar avaliação

Marque uma demonstração personalizada

Pronto para ver a Wiz em ação?

"A melhor experiência do usuário que eu já vi, fornece visibilidade total para cargas de trabalho na nuvem."
David EstlickCISO
"A Wiz fornece um único painel de vidro para ver o que está acontecendo em nossos ambientes de nuvem."
Adam FletcherDiretor de Segurança
"Sabemos que se a Wiz identifica algo como crítico, na verdade é."
Greg PoniatowskiChefe de Gerenciamento de Ameaças e Vulnerabilidades