CVE-2021-21646 Remote code execution vulnerability in Jenkins Templating Engine Plugin

High 8.8 Published Updated

Attackers with Job/Configure permission can execute arbitrary code on the Jenkins controller due to missing script security protections in the Templating Engine Plugin.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-21646?

CVE-2021-21646 is a high-severity code injection vulnerability in Jenkins Templating Engine Plugin, published on 21 Apr 2021. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Jenkins Templating Engine Plugin 2.1 and earlier does not protect its pipeline configurations using Script Security Plugin, allowing attackers with Job/Configure permission to execute arbitrary code in the context of the Jenkins controller JVM.

Which versions are affected by CVE-2021-21646?

2 open source packages ship an affected version, including org.jenkins-ci.plugins:templating-engine. It affects 1 product.

PackageAffectedFixed in
org.jenkins-ci.plugins:templating-engine MavenAll versions2.2
org.jenkins-ci.plugins:templating-engine MavenAll versions2.2

Products include Jenkins Templating Engine.

How do I fix CVE-2021-21646?

Upgrade org.jenkins-ci.plugins:templating-engine to 2.2 or later.

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

Is CVE-2021-21646 being exploited?

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

Sources

Also known as GHSA-p6qc-37hq-wqr6.

Is CVE-2021-21646 in your software?

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

Check your SBOMs for free