Skip to main content

Repomix CVE-2026-49988

| EUVDEUVD-2026-44757 MEDIUM
Information Exposure (CWE-200)
2026-07-01 https://github.com/yamadashy/repomix GHSA-hwpp-h97w-2h3j
6.8
CVSS 4.0 · Vendor: https://github.com/yamadashy/repomix
Share

Severity by source

Vendor (https://github.com/yamadashy/repomix) PRIMARY
6.8 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
6.2 MEDIUM

Local stdio MCP server; any connected MCP client can invoke tools without authentication; no integrity or availability impact.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/yamadashy/repomix).

CVSS VectorVendor: https://github.com/yamadashy/repomix

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
X

Lifecycle Timeline

2
CVSS changed
Jul 15, 2026 - 19:22 NVD
6.8 (MEDIUM)
Analysis Generated
Jul 01, 2026 - 19:36 vuln.today

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 3 npm packages depend on repomix (3 direct, 0 indirect)

Ecosystem-wide dependent count for version 1.14.1.

DescriptionCVE.org

attach_packed_output can register arbitrary .json/.txt/.md/.xml files and bypass the MCP file-read safety check

Summary

Repomix's MCP server exposes a normal file_system_read_file tool that reads absolute paths only after running the project's secret check. However, the attach_packed_output plus read_repomix_output flow can read arbitrary local .json, .txt, .md, or .xml files without the same safety check and without verifying that the file is actually a Repomix packed output.

This is a medium-severity local MCP file-read boundary issue. The affected deployment is the documented repomix --mcp stdio server used by AI assistants. A prompt or lower-trust model action that can invoke MCP tools can use attach_packed_output on a local JSON/text file, receive an outputId, then call read_repomix_output to retrieve the full file content.

Affected target

  • Repository: yamadashy/repomix
  • Commit reviewed: adf5a12f2211a7fabf24ee11a21734adccee5143
  • Component: MCP server tools
  • Package version reviewed: repomix@1.14.0

Root cause

The file-read safety boundary is implemented per tool rather than per local-file capability. file_system_read_file reads the file and runs runSecretLint() before returning content. attach_packed_output reads and registers local files through a separate path, but only checks file extension and parsing format. It does not verify a Repomix output header/schema and does not run the secret check before registering the path.

Vulnerability chain

  1. attach_packed_output accepts a direct file path, not only a directory.
  2. resolveOutputFilePath() allows any file whose extension matches .xml, .md, .txt, or .json.
  3. The tool reads that file with fs.readFile(outputFilePath, 'utf8').
  4. It extracts metrics, but malformed or non-Repomix JSON simply produces empty metrics rather than rejection.
  5. formatPackToolResponse() registers the original file path under a generated outputId.
  6. read_repomix_output resolves the outputId and returns the full file content.

Auth boundary violated

The respected boundary is the explicit local file-read guard: file_system_read_file blocks files that fail the secret scan.

The ignored boundary is the alternate packed-output path. A caller can register a supported-extension file as an output and read it through read_repomix_output without passing through runSecretLint() or a packed-output validation step.

Source trace

  • src/mcp/tools/fileSystemReadFileTool.ts:72-83: direct file reads run runSecretLint() and return an error if the scan finds sensitive content.
  • src/mcp/tools/attachPackedOutputTool.ts:76-87: direct file input is accepted based only on extension.
  • src/mcp/tools/attachPackedOutputTool.ts:111-120: .json, .txt, .md, and .xml are supported formats.
  • src/mcp/tools/attachPackedOutputTool.ts:228-240: JSON parse errors return empty metrics rather than rejecting the file as non-Repomix output.
  • src/mcp/tools/attachPackedOutputTool.ts:272-308: the file is read and passed to formatPackToolResponse() without a secret check.
  • src/mcp/tools/mcpToolRuntime.ts:77-82: formatPackToolResponse() registers the provided outputFilePath and reads it.
  • src/mcp/tools/readRepomixOutputTool.ts:56-74: read_repomix_output reads the registered file path and returns its content.
  • README.md:984-991: the tool is documented as providing secure access to existing packed outputs.

Reproduction

run.sh:

bash
#!/usr/bin/env bash
set -euo pipefail
set +e
node run.js 2>&1 | tee transcript.txt
rc=${PIPESTATUS[0]}
set -e
printf '%s\n' "$rc" > exit-code.txt
exit "$rc"

The harness creates a temporary credentials.json containing a sentinel value, follows the attach_packed_output path for supported-extension files, registers the file path under an output ID, and then reads it back through the read_repomix_output path. It also checks the source-code contrast between the guarded direct file-read tool and the unguarded attach path.

Observed transcript:

text
ATTACH_TOOL_SOURCE_READS_FILE=true
ATTACH_TOOL_HAS_SECRETLINT_CHECK=false
READ_FILE_TOOL_HAS_SECRETLINT_CHECK=true
RUNTIME_REGISTERS_OUTPUT_PATH=true
ATTACH_ACCEPTS_JSON_EXTENSION=true
ATTACHED_NON_REPOMIX_JSON_PATH=true
SENTINEL_READ_BACK=true
REPOMIX_ATTACH_PACKED_OUTPUT_ARBITRARY_JSON_READ_REPRODUCED=true

Impact

In the MCP threat model, an assistant/tool caller can read local JSON/text/Markdown/XML files through a path that bypasses the file-read tool's secret scanning. Examples include project configuration JSON, exported tokens, local tool settings, or other plaintext files with supported extensions.

This does not require shell execution or writing files. It requires MCP tool-call capability against a Repomix server running with local filesystem access.

Suggested fix

Apply the same safety boundary to all local-file read paths:

  • Require attach_packed_output to validate that the target file is a genuine Repomix output before registration.
  • Reject malformed/non-Repomix JSON/XML/Markdown/plain files instead of registering them with empty metrics.
  • Run the same secret check used by file_system_read_file before registering or returning content.
  • Consider storing a content snapshot in the registry rather than registering arbitrary local paths for later reads.

AnalysisAI

Repomix 1.14.0's MCP server exposes a file-read safety bypass allowing any MCP-connected client to retrieve arbitrary local .json, .txt, .md, or .xml files without triggering the project's runSecretLint() secret-scanning guard. The attach_packed_output tool accepts arbitrary local paths, validates only by file extension, reads the file without invoking the secret check, and registers the path under an outputId; read_repomix_output then returns the full file contents-entirely circumventing the boundary enforced by the dedicated file_system_read_file tool. No CISA KEV listing or EPSS data is available, but the advisory includes a reproduction harness that confirmed the bypass end-to-end against repomix@1.14.0.

Technical ContextAI

Repomix (pkg:npm/repomix) is a developer tool that packs repository contents for AI consumption and optionally exposes a Model Context Protocol stdio server via repomix --mcp. The MCP server provides discrete tools-file_system_read_file, attach_packed_output, and read_repomix_output-with the intended security boundary being a per-tool runSecretLint() call that blocks sensitive content from leaving via file_system_read_file. The root cause (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) is that the safety boundary is enforced at the tool level rather than at the underlying local-file-read capability level. attachPackedOutputTool.ts:76-87 accepts direct file paths; lines 111-120 filter only by extension (.xml, .md, .txt, .json); lines 228-240 treat JSON parse failures as empty metrics rather than rejections; and lines 272-308 read the file and pass it to formatPackToolResponse() without invoking runSecretLint(). mcpToolRuntime.ts:77-82 registers the raw file path in an output registry, which readRepomixOutputTool.ts:56-74 resolves and returns in full-bypassing every guard that would have fired through the direct-read tool.

RemediationAI

No vendor-released patched version is identified in the advisory data at time of analysis; an exact fix version has not been independently confirmed. The advisory recommends applying the same runSecretLint() boundary to all local-file read paths: attach_packed_output should validate that the target file is a genuine Repomix packed output by checking a header or schema before registration, reject malformed or non-Repomix files with an explicit error rather than silently registering them with empty metrics, and invoke runSecretLint() before registering or returning any file content. A structurally safer fix is to store a content snapshot in the registry at attach time rather than registering raw local paths for deferred reads via read_repomix_output. As compensating controls pending a patch, operators should restrict repomix --mcp to fully trusted AI clients with no exposure to untrusted content, audit MCP tool-call logs for attach_packed_output invocations on paths outside expected Repomix output directories, and avoid running the MCP server in working directories containing sensitive .json, .txt, .md, or .xml files. The upstream advisory with fix guidance is at https://github.com/yamadashy/repomix/security/advisories/GHSA-hwpp-h97w-2h3j.

Share

CVE-2026-49988 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy