CVE-2025-31722: Jenkins Templating Engine Plugin Arbitrary Code Execution Vulnerability
Summary
CVE-2025-31722: Jenkins Templating Engine Plugin Vulnerable to Arbitrary Code Execution. Affects org.jenkins-ci.plugins:templating-engine versions < 2.5.4. Fixed in 2.5.4. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Jenkins Templating Engine Plugin is a powerful tool that allows users to define libraries for use in Jenkins pipelines. It supports both global configurations, which are trusted and managed by administrators, and folder-scoped configurations, which can be modified by users with specific permissions. This flexibility, while beneficial for development, introduces potential security risks if not properly managed.
Vulnerability Detail
The vulnerability arises from the fact that libraries defined in folders are not subject to sandbox protection in versions 2.5.3 and earlier of the Templating Engine Plugin. This oversight allows users with Item/Configure permissions to execute arbitrary code within the Jenkins controller JVM, posing a significant security risk. Attackers could exploit this vulnerability to gain unauthorized access or control over the Jenkins environment, leading to potential data breaches or service disruptions.
How To Fix
Minimum fixed version
2.5.4
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can restrict Item/Configure permissions to trusted users only, thereby minimizing the risk of arbitrary code execution until the plugin is updated.
Conclusion
The Jenkins Templating Engine Plugin has a critical vulnerability that allows for arbitrary code execution due to inadequate sandbox protection in earlier versions. It is crucial to update to version 2.5.4 or later to secure your Jenkins environment. Additionally, using tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for org.jenkins-ci.plugins:templating-engine →
FAQ
It is a plugin that allows users to define and manage libraries for Jenkins pipelines, enhancing the flexibility and reusability of code.
It allows attackers with specific permissions to execute arbitrary code on the Jenkins controller JVM, potentially compromising the entire Jenkins environment.
You can use the Vulert playground at Vulert Scanner to check for vulnerabilities in your application without needing to sign up.
The CVSS score for this vulnerability is 8.8, indicating a high severity level.
If an immediate update is not possible, restrict permissions for Item/Configure to trusted users to mitigate the risk.
Related vulnerabilities
Recent vulnerabilities recorded for org.jenkins-ci.plugins:templating-engine.