CVE-2026-49988: repomix Attach_packed_output Can Bypass File-read Secret Vulnerability
MODERATECVE-2026-49988 is a MODERATE attach_packed_output can bypass file-read secret vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting repomix libraries in the npm ecosystem. The issue involves attach_packed_output can bypass file-read secret scanning for supported local files. Remediation is available by upgrading affected packages to version 1.14.1.
CVE-2026-49988 at a Glance
How to Fix CVE-2026-49988
To remediate this vulnerability, upgrade all affected repomix dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install repomix@1.14.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls repomix
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-49988, inspect your project dependencies using npm:
npm ls repomix
Analyze the terminal output to locate any version of repomix in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.14.1), your application is affected.
Note: The npm ls repomix 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In repomix, 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
CVE-2026-49988 Affected repomix Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
repomix
|
npm |
< 1.14.1
|
1.14.1
|
References
Frequently Asked Questions
What is CVE-2026-49988?
Which repomix versions are affected?
What version fixes CVE-2026-49988?
Is repomix affected?
What CWE is associated with CVE-2026-49988?
How can I check npm dependencies for CVE-2026-49988?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hwpp-h97w-2h3j",
"modified" : "2026-07-01T19:01:41Z",
"published" : "2026-07-01T19:01:41Z",
"aliases" : [ "CVE-2026-49988" ],
"summary" : "repomix: attach_packed_output can bypass file-read secret scanning for supported local files",
"details" : "# `attach_packed_output` can register arbitrary `.json/.txt/.md/.xml` files and bypass the MCP file-read safety check\n\n## Summary\n\nRepomix'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.\n\nThis 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.\n\n## Affected target\n\n- Repository: `yamadashy/repomix`\n- Commit reviewed: `adf5a12f2211a7fabf24ee11a21734adccee5143`\n- Component: MCP server tools\n- Package version reviewed: `repomix@1.14.0`\n\n## Root cause\n\nThe 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.\n\n## Vulnerability chain\n\n1. `attach_packed_output` accepts a direct file path, not only a directory.\n2. `resolveOutputFilePath()` allows any file whose extension matches `.xml`, `.md`, `.txt`, or `.json`.\n3. The tool reads that file with `fs.readFile(outputFilePath, 'utf8')`.\n4. It extracts metrics, but malformed or non-Repomix JSON simply produces empty metrics rather than rejection.\n5. `formatPackToolResponse()` registers the original file path under a generated `outputId`.\n6. `read_repomix_output` resolves the `outputId` and returns the full file content.\n\n## Auth boundary violated\n\nThe respected boundary is the explicit local file-read guard: `file_system_read_file` blocks files that fail the secret scan.\n\nThe 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.\n\n## Source trace\n\n- `src/mcp/tools/fileSystemReadFileTool.ts:72-83`: direct file reads run `runSecretLint()` and return an error if the scan finds sensitive content.\n- `src/mcp/tools/attachPackedOutputTool.ts:76-87`: direct file input is accepted based only on extension.\n- `src/mcp/tools/attachPackedOutputTool.ts:111-120`: `.json`, `.txt`, `.md`, and `.xml` are supported formats.\n- `src/mcp/tools/attachPackedOutputTool.ts:228-240`: JSON parse errors return empty metrics rather than rejecting the file as non-Repomix output.\n- `src/mcp/tools/attachPackedOutputTool.ts:272-308`: the file is read and passed to `formatPackToolResponse()` without a secret check.\n- `src/mcp/tools/mcpToolRuntime.ts:77-82`: `formatPackToolResponse()` registers the provided `outputFilePath` and reads it.\n- `src/mcp/tools/readRepomixOutputTool.ts:56-74`: `read_repomix_output` reads the registered file path and returns its content.\n- `README.md:984-991`: the tool is documented as providing secure access to existing packed outputs.\n\n## Reproduction\n\n`run.sh`:\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\nset +e\nnode run.js 2>&1 | tee transcript.txt\nrc=${PIPESTATUS[0]}\nset -e\nprintf '%s\\n' \"$rc\" > exit-code.txt\nexit \"$rc\"\n```\n\nThe 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.\n\nObserved transcript:\n\n```text\nATTACH_TOOL_SOURCE_READS_FILE=true\nATTACH_TOOL_HAS_SECRETLINT_CHECK=false\nREAD_FILE_TOOL_HAS_SECRETLINT_CHECK=true\nRUNTIME_REGISTERS_OUTPUT_PATH=true\nATTACH_ACCEPTS_JSON_EXTENSION=true\nATTACHED_NON_REPOMIX_JSON_PATH=true\nSENTINEL_READ_BACK=true\nREPOMIX_ATTACH_PACKED_OUTPUT_ARBITRARY_JSON_READ_REPRODUCED=true\n```\n\n## Impact\n\nIn 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.\n\nThis does not require shell execution or writing files. It requires MCP tool-call capability against a Repomix server running with local filesystem access.\n\n## Suggested fix\n\nApply the same safety boundary to all local-file read paths:\n\n- Require `attach_packed_output` to validate that the target file is a genuine Repomix output before registration.\n- Reject malformed/non-Repomix JSON/XML/Markdown/plain files instead of registering them with empty metrics.\n- Run the same secret check used by `file_system_read_file` before registering or returning content.\n- Consider storing a content snapshot in the registry rather than registering arbitrary local paths for later reads.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "repomix"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.14.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.14.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/yamadashy/repomix/security/advisories/GHSA-hwpp-h97w-2h3j"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/yamadashy/repomix"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-01T19:01:41Z",
"nvd_published_at" : null
}
}