CVE-2026-31864 Overview
CVE-2026-31864 is a Server-Side Template Injection (SSTI) vulnerability affecting JumpServer, an open source bastion host and operation and maintenance security audit system. The vulnerability exists in JumpServer's Applet and VirtualApp upload functionality, allowing attackers with administrative privileges to execute arbitrary code within the JumpServer Core container.
Critical Impact
Authenticated administrators with Application Applet Management or Virtual Application Management permissions can exploit this SSTI vulnerability to achieve arbitrary code execution within the JumpServer Core container, potentially compromising the entire bastion host infrastructure.
Affected Products
- Fit2cloud JumpServer (vulnerable versions)
Discovery Timeline
- 2026-03-13 - CVE CVE-2026-31864 published to NVD
- 2026-03-18 - Last updated in NVD database
Technical Details for CVE-2026-31864
Vulnerability Analysis
This vulnerability stems from unsafe handling of user-supplied content during Jinja2 template rendering. When administrators upload Applet or VirtualApp ZIP packages, the application processes the included manifest.yml configuration file through the Jinja2 template engine without implementing proper sandbox restrictions.
Jinja2, when used without sandboxing, allows access to Python's object introspection capabilities. An attacker can craft malicious template expressions within the YAML manifest that traverse Python's object hierarchy to reach dangerous functions like os.popen() or subprocess.call(). This enables arbitrary command execution within the context of the JumpServer Core container.
While the vulnerability requires administrative privileges to exploit, it represents a significant security concern for organizations relying on JumpServer as their bastion host. A compromised administrator account or a malicious insider could leverage this vulnerability to gain shell access to the container, potentially pivoting to other systems accessible through the bastion host.
Root Cause
The root cause of CVE-2026-31864 is the improper neutralization of special elements used in a template engine (CWE-1336). The application renders user-controlled YAML content through Jinja2's default template environment, which lacks sandboxing protections. This allows template expressions to access Python's built-in objects and methods, enabling arbitrary code execution. The absence of input validation on the manifest.yml file contents compounds the issue, as malicious template syntax is processed without restrictions.
Attack Vector
The attack requires network access and administrative authentication. An attacker must possess either Application Applet Management or Virtual Application Management permissions within JumpServer. The exploitation flow involves:
- Creating a malicious Applet or VirtualApp ZIP package containing a crafted manifest.yml file
- Embedding SSTI payloads within the YAML configuration that leverage Jinja2 template syntax
- Uploading the package through the administrative interface
- When JumpServer processes the manifest, the Jinja2 engine renders the malicious template expressions
- Template injection payloads execute arbitrary Python code within the JumpServer Core container
The vulnerability requires user interaction from an administrator to trigger the upload functionality. Successful exploitation grants code execution within the container context, potentially allowing lateral movement or data exfiltration through the bastion host.
Detection Methods for CVE-2026-31864
Indicators of Compromise
- Unusual Applet or VirtualApp package uploads containing suspicious YAML content with Jinja2 template expressions
- Unexpected process execution within the JumpServer Core container
- Anomalous outbound network connections originating from the JumpServer container
- Administrative audit logs showing repeated or unusual package upload activities
Detection Strategies
- Monitor JumpServer administrative audit logs for Applet and VirtualApp upload activities, particularly from unexpected sources or at unusual times
- Implement file integrity monitoring on uploaded package contents to detect YAML files containing template injection patterns
- Deploy behavioral analysis to identify anomalous process execution within the JumpServer Core container
- Configure alerts for any command shell spawning or network connections initiated by the JumpServer application process
Monitoring Recommendations
- Enable comprehensive logging for all administrative actions within JumpServer, particularly those related to Applet and VirtualApp management
- Implement network segmentation monitoring to detect lateral movement attempts from the JumpServer container
- Review uploaded YAML configuration files for template injection patterns such as {{, {%, or references to Python object attributes
- Establish baseline behavior for the JumpServer Core container and alert on deviations
How to Mitigate CVE-2026-31864
Immediate Actions Required
- Apply the official security patch from JumpServer as referenced in pull request #16608
- Review administrative access permissions and restrict Application Applet Management and Virtual Application Management privileges to essential personnel only
- Audit recent Applet and VirtualApp uploads for any suspicious content or unexpected package submissions
- Implement network segmentation to limit the blast radius if the JumpServer container is compromised
Patch Information
JumpServer has released a security fix addressing this vulnerability. The patch implements proper sandboxing for Jinja2 template rendering when processing uploaded YAML configuration files. Organizations should review the GitHub Security Advisory for specific version information and upgrade guidance. The technical fix is available in GitHub Pull Request #16608.
Workarounds
- Restrict administrative privileges by removing Application Applet Management and Virtual Application Management permissions from non-essential users until patching is complete
- Implement additional access controls or approval workflows for Applet and VirtualApp package uploads
- Consider temporarily disabling the Applet and VirtualApp upload functionality if not operationally required
- Deploy web application firewall rules to inspect uploaded content for template injection patterns
# Configuration example
# Restrict administrative access by auditing current permissions
# Review JumpServer user permissions via the administrative console
# Remove unnecessary Applet/VirtualApp management rights
# Network segmentation: Limit JumpServer container egress
iptables -A OUTPUT -m owner --uid-owner jumpserver -j LOG --log-prefix "JumpServer Egress: "
iptables -A OUTPUT -m owner --uid-owner jumpserver -d trusted_network -j ACCEPT
iptables -A OUTPUT -m owner --uid-owner jumpserver -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


