Skip to content
RCE Advisory Intermediate CVE-2021-29263

GHSL-2020-337_338: Arbitrary code execution when cloning/checking out a Gradle project - CVE-2021-29263

When cloning or checking out a Gradle project from an external repository, IntelliJ IDEA and Android Studio automatically run the Gradle build task without user confirmation. An attacker who tricks a developer into cloning a malicious repository can execute arbitrary code on the developer's machine.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

Upon cloning or checking out a Gradle project from an external repository (Get from VCS), both IntelliJ IDEA and Android Studio, run the gradle build task.

pwntester, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The IDE automatically executes the Gradle build task upon cloning or checking out a repository without prompting the user for confirmation.

Impact

An attacker could execute arbitrary code on the developer's machine during the clone or checkout operation.

What the attacker needed

Victim uses IntelliJ IDEA or Android Studio; victim clones or checks out a malicious repository

The fix

The issue was fixed in IntelliJ IDEA 2020.3.3, released on March 16, 2021.

How it was found

  1. An attacker creates a malicious Gradle project repository.
  2. The attacker tricks a developer into cloning or checking out that repository using IntelliJ IDEA or Android Studio.
  3. The IDE automatically runs the Gradle build task, executing the attacker's code.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you open a project in some development tools, the tool may automatically run setup scripts. Here, the tool ran a build script from an untrusted repository without asking, so a bad repository could run harmful commands on your computer.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Alvaro Muñoz

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.