CVE-2025-31722 Jenkins Templating Engine Plugin Vulnerable to Arbitrary Code Execution

High 8.8 Published Updated

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.

PackageAffectedFixed in
org.jenkins-ci.plugins:templating-engine MavenAll versions2.5.4
org.jenkins-ci.plugins:templating-engine MavenAll versions2.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.

Sources

Also known as GHSA-4vjp-327p-w4qv.

Is CVE-2025-31722 in your software?

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

Check your SBOMs for free