CVE-2026-8766
Description
A flaw has been found in Kilo-Org kilocode up to 7.0.47. This issue affects the function Load of the file packages/opencode/src/config/config.ts of the component Environment Variable Handler. Executing a manipulation of the argument KILO_CONFIG_CONTENT can lead to information disclosure. It is possible to launch the attack remotely. The exploit has been published and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Arbitrary file read in Kilo-Org kilocode ≤7.0.47 via unsafe token substitution in the KILO_CONFIG_CONTENT environment variable, leaking file contents in error tracebacks.
Vulnerability
Description
CVE-2026-8766 is an arbitrary file read vulnerability in the Kilo-Org kilocode CLI, affecting versions up to 7.0.47 [1]. The flaw resides in the load() function within packages/opencode/src/config/config.ts when handling the KILO_CONFIG_CONTENT environment variable. During parsing, the ConfigPaths.parseText method processes {file:path} token substitutions before validating the JSON schema, allowing an attacker-controlled environment variable to force the CLI to read arbitrary local files [1].
Exploitation
Method
An attacker who can control or inject the KILO_CONFIG_CONTENT environment variable can craft a payload containing an unrecognized JSON key that includes a {file:/target} token [1]. The token substitution reads the target file and inserts its content into the key's value. When the configuration is validated against the Zod schema, the unrecognized key causes a validation error that dumps the fully expanded key text—including the file content—to stderr in the crash log [1]. The attack can be launched remotely by providing a crafted environment variable to the CLI, requiring no authentication if the attacker already has control over the process environment.
Impact
Successful exploitation leads to information disclosure, as an attacker can read arbitrary files on the system where the kilocode CLI is executed [1]. The leaked content is exposed in the application's error output, potentially revealing sensitive data such as configuration files, credentials, or other proprietary information.
Mitigation
The vendor was contacted but did not respond, and no official patch or workaround is documented at the time of publication [1]. This vulnerability represents an incomplete remediation of a previously patched issue in the legacy OPENCODE_CONFIG_CONTENT variable, where the patch logic was not carried over during the namespace migration to KILO_ [1]. Users should restrict control over environment variables passed to the CLI until a patch is available.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- gist.github.com/YLChen-007/32b444e49ced1a46bde5a68933ccd09fnvdExploitThird Party Advisory
- vuldb.com/submit/811400nvdExploitThird Party AdvisoryVDB Entry
- vuldb.com/vuln/364391nvdThird Party AdvisoryVDB Entry
- vuldb.com/vuln/364391/ctinvdPermissions RequiredVDB Entry
News mentions
0No linked articles in our index yet.