VYPR
Unrated severityNVD Advisory· Published Apr 16, 2021· Updated Sep 17, 2024

Code execution in VSCode-bazel via malicious Bazel config files

CVE-2021-22539

Description

An attacker can place a crafted JSON config file into the project folder pointing to a custom executable. VScode-bazel allows the workspace path to lint *.bzl files to be set via this config file. As such the attacker is able to execute any executable on the system through vscode-bazel. We recommend upgrading to version 0.4.1 or above.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

vscode-bazel ≤0.4.0 executes a user-specified binary for linting; a malicious project folder can trigger arbitrary code execution.

Vulnerability

The vscode-bazel extension allows the workspace path to the executable used for linting *.bzl files to be set via the bazel.buildifierExecutable configuration key. This setting can be modified by placing a crafted JSON config file in the project folder. Versions 0.4.0 and earlier accept the configuration from the workspace without restrictions, enabling an attacker to specify any arbitrary executable on the system [1].

Exploitation

An attacker creates a malicious project folder containing a .vscode/settings.json file that sets bazel.buildifierExecutable to an attacker-controlled executable. When the victim opens the folder in Visual Studio Code and the extension lints a *.bzl file, the extension invokes the specified executable. No additional authentication, network access, or user interaction beyond opening the folder and triggering linting is required [1].

Impact

Successful exploitation results in arbitrary code execution on the victim's machine with the privileges of the user running Visual Studio Code. The attacker gains full control over the execution environment, potentially leading to data exfiltration, malware installation, or further system compromise [1].

Mitigation

The issue is patched in vscode-bazel version 0.4.1, released on or before 2021-04-16. Users should upgrade to version 0.4.1 or above. No workaround is documented; the fix disallows workspace-level configuration of the linting executable path [1].

AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

2

News mentions

0

No linked articles in our index yet.