CVE-2021-21646 Remote code execution vulnerability in Jenkins Templating Engine Plugin
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.
| Package | Affected | Fixed in |
|---|---|---|
org.jenkins-ci.plugins:templating-engine Maven | All versions | 2.2 |
org.jenkins-ci.plugins:templating-engine Maven | All versions | 2.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.
Other vulnerabilities in Jenkins Templating Engine Plugin
Sources
Also known as GHSA-p6qc-37hq-wqr6.