CVE-2025-31722 Jenkins Templating Engine Plugin Vulnerable to Arbitrary Code Execution
Attackers with Item/Configure permission can execute arbitrary code on the Jenkins controller due to missing sandbox protection for folder libraries.
- 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-2025-31722?
CVE-2025-31722 is a high-severity code injection vulnerability in Jenkins Templating Engine Plugin, published on 2 Apr 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
In Jenkins Templating Engine Plugin 2.5.3 and earlier, libraries defined in folders are not subject to sandbox protection, allowing attackers with Item/Configure permission to execute arbitrary code in the context of the Jenkins controller JVM.
Weakness: CWE-94
Which versions are affected by CVE-2025-31722?
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.5.4 |
org.jenkins-ci.plugins:templating-engine Maven | All versions | 2.5.4 |
Products include Jenkins Templating Engine.
How do I fix CVE-2025-31722?
Upgrade org.jenkins-ci.plugins:templating-engine to 2.5.4 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2025-31722 being exploited?
There is no known exploitation of CVE-2025-31722 in the wild and no public exploit code.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in Jenkins Templating Engine Plugin
Sources
Also known as GHSA-4vjp-327p-w4qv.