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

High 8.2 Published Updated

Attackers can execute arbitrary code by placing a malicious JSON config file in the project folder, affecting VSCode Bazel extension users.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2021-22539?

CVE-2021-22539 is a high-severity code injection vulnerability in Google LLC VSCode-Bazel, published on 16 Apr 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

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

Weakness: CWE-668, CWE-73

Which versions are affected by CVE-2021-22539?

It affects 1 product.

Products include Google Bazel.

How do I fix CVE-2021-22539?

No fix has been published for CVE-2021-22539 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2021-22539 being exploited?

There is no known exploitation of CVE-2021-22539 in the wild and no public exploit code.

Sources

Also known as GHSA-2rcw-j8x4-hgcv.

Is CVE-2021-22539 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free