LiveActive security incident?Get immediate response
CVE Record

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

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.

HighCVSS 8.2Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A malicious project can make the VSCode-Bazel extension run an attacker-chosen program on a developer workstation. This is mainly a developer-workstation risk: it depends on someone opening or using a crafted workspace, but successful exploitation could compromise source code, credentials, or the machine.

Executive priority

Prioritize this as a high developer-endpoint risk, not an internet-facing server emergency. Remediation should focus on extension inventory, rapid upgrade, and controls around untrusted repositories because compromise could expose source code and credentials.

Technical view

VSCode-Bazel allowed a project JSON configuration file to control the workspace path used for linting *.bzl files. A crafted config could point that path to a custom executable, leading to code execution. The issue is classified as CWE-73 and has CVSS 3.1 score 8.2.

Likely exposure

Exposure is most likely in engineering environments using Google VSCode-Bazel, especially where developers open third-party, forked, or attacker-modified Bazel workspaces. The source bundle does not specify exact affected versions, but recommends upgrading to 0.4.1 or later.

Exploitation context

The CVSS vector indicates local access, low complexity, low privileges, and required user interaction. The CVE source bundle and KEV flag do not show active exploitation. Treat unknown or outdated extension installations as a workstation supply-chain risk.

Researcher notes

Evidence is limited to the CVE description, CVSS data, GitHub advisory, and linked pull request. The bundle does not provide exploit-in-the-wild evidence or precise affected version ranges beyond the recommendation to use 0.4.1 or above.

Mitigation direction

  • Upgrade VSCode-Bazel to version 0.4.1 or later.
  • Verify developer workstations are not running older or unknown extension versions.
  • Avoid opening untrusted Bazel workspaces until extension status is confirmed.
  • Review project configuration changes in repositories before opening them in VS Code.
  • Consult the GitHub advisory for vendor-specific remediation details.

Validation and detection

  • Inventory VSCode-Bazel installations across developer workstations.
  • Confirm each installed extension version is 0.4.1 or later.
  • Check repositories for unexpected VSCode-Bazel JSON configuration files.
  • Review recent workstation alerts around VS Code or Bazel-related process execution.
  • Prioritize validation for developers handling sensitive code or production credentials.
Prepared
Confidence
medium
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-73: File access and web shell behavior lookup

File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-22539 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.2 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.2CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H1.56Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

8.2High
CVSS 3.1 vector shape for CVE-2021-22539Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
Google LLCVSCode-BazelunspecifiedListed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-73 · source CWE mapping

External Control of File Name or Path

External Control of File Name or Path represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.