Skip to main content
Vulnerability Database/CVE-2026-104126

CVE-2026-104126: JumpServer Ansible Template RCE Vulnerability

CVE-2026-104126 is a remote code execution flaw in JumpServer that allows authenticated attackers to exploit Ansible template expressions for file disclosure and command execution. This post covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-104126 Overview

CVE-2026-104126 is a code injection vulnerability [CWE-94] affecting JumpServer, an open source bastion host and operation-and-maintenance security audit system. The flaw exists in the Ansible-based automation rendering pipeline prior to version 4.10.17-lts. Authenticated users with permission to create or execute automation tasks can supply attacker-controlled Jinja2 template expressions. These expressions trigger sensitive Ansible lookup plugins including file, pipe, env, and password within the Ansible execution context. Successful exploitation discloses local files or environment values and may permit limited command execution under the privileges of the automation process.

Critical Impact

Authenticated privileged users can inject Ansible template expressions to read files, read environment variables, and execute limited commands under the automation process privileges.

Affected Products

  • JumpServer versions prior to 4.10.17-lts
  • JumpServer Ansible-based automation task module
  • JumpServer account automation (OSM) components

Discovery Timeline

  • 2026-10-13 - CVE-2026-104126 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-104126

Vulnerability Analysis

The vulnerability resides in JumpServer's Ansible-based automation rendering engine. JumpServer uses Ansible to orchestrate account automation operations such as password changes, account creation, and account verification against managed assets. During task preparation, user-supplied fields are passed through Ansible's Jinja2 template engine without adequate sanitization. An authenticated user with task creation or execution privileges can embed template expressions in those fields.

When rendered, these expressions invoke Ansible lookup plugins. The file lookup reads arbitrary files accessible to the automation worker. The env lookup discloses environment variables, which frequently contain secrets and tokens. The pipe lookup executes shell commands and returns output. The password lookup can read or write password files on the controller host. The attack is bounded by the privileges of the automation process and does not grant access to unrelated JumpServer assets or unauthenticated access paths.

Root Cause

The root cause is improper neutralization of special elements used in a template engine. User input flowing into Ansible task variables was treated as trusted template content rather than literal data. The fix introduces a validate_account_username helper and additional validation in the account automation API to reject or sanitize template syntax before it reaches the Ansible renderer.

Attack Vector

Exploitation requires an authenticated session with high privileges, specifically the ability to create or trigger an affected automation task. The attacker submits a crafted account name, username, or related field containing a Jinja2 expression that references an Ansible lookup. When the automation runs, the controller renders the expression and returns or acts on the result.

python
# Patch excerpt: apps/accounts/models/virtual.py
# Introduces validate_account_username to sanitize user-supplied
# usernames before they reach the Ansible template context.
def get_manual_account(cls, input_username='', input_secret='', from_permed=True):
    """ @INPUT 手动登录的账号(any) """
    from .account import Account
    from accounts.utils import validate_account_username
    if from_permed:
        username = AliasAccount.INPUT.value
        secret = ''
    else:
        username = validate_account_username(input_username)
        secret = input_secret
    return Account(name=AliasAccount.INPUT.label, username=username, secret=secret)

# Patch excerpt: apps/accounts/api/account/account.py
# Centralized error formatting for the bulk automation result modal.
@staticmethod
def format_validation_error(detail):
    if isinstance(detail, dict):
        errors = []
        for messages in detail.values():
            if isinstance(messages, (list, tuple)):
                messages = ', '.join([str(m) for m in messages])
            errors.append(str(messages))
        return '; '.join(errors)
    if isinstance(detail, (list, tuple)):
        return '; '.join([str(item) for item in detail])
    return str(detail)

Source: JumpServer commit cc57ba0

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-104126

Indicators of Compromise

  • Automation task payloads or account fields containing Jinja2 markers such as {{, }}, lookup(, file, pipe, env, or password.
  • Unexpected outbound process execution spawned by the Ansible worker (for example, sh, bash, or cat reading sensitive paths).
  • Automation job logs showing reads of files like /etc/passwd, /proc/self/environ, or JumpServer configuration files.
  • Account automation tasks created or edited by non-administrative users immediately before anomalous worker activity.

Detection Strategies

  • Inspect JumpServer audit logs for automation tasks whose fields contain template delimiters or lookup plugin names.
  • Correlate Ansible controller process telemetry with automation task identifiers to spot unexpected child processes.
  • Alert on JumpServer worker containers accessing files outside their normal working directory.

Monitoring Recommendations

  • Enable verbose logging on the JumpServer celery and Ansible workers and forward logs to a central analytics platform.
  • Monitor for new or modified account automation templates created through the /api/v1/accounts/ endpoints.
  • Track outbound network connections from automation workers to detect data exfiltration following a lookup abuse.

How to Mitigate CVE-2026-104126

Immediate Actions Required

  • Upgrade JumpServer to version 4.10.17-lts or later, which contains the sanitization patch.
  • Audit existing account automation tasks and templates for Jinja2 syntax in username, name, or related fields.
  • Restrict the set of users permitted to create or execute automation tasks to a minimum trusted group.
  • Rotate any credentials, tokens, or secrets exposed to the automation worker environment.

Patch Information

The vendor fix is tracked in GitHub Pull Request #16886 and shipped in JumpServer Release v4.10.17. The commit cc57ba0de5f6015746fae11cfc62402b11618e59 adds a validate_account_username helper and consolidated validation error handling across the account automation API. Full details are documented in GitHub Security Advisory GHSA-gr5x-5c4h-867g.

Workarounds

  • Revoke accounts.add_account and automation execution permissions from all users who do not strictly require them until the patch is applied.
  • Add a reverse proxy or WAF rule that rejects JumpServer API request bodies containing Jinja2 delimiters in account fields.
  • Run the Ansible automation worker in a hardened, isolated container with minimal filesystem access and no sensitive environment variables.
bash
# Verify installed JumpServer version and upgrade
docker exec jms_core bash -c 'cat /opt/jumpserver/apps/jumpserver/const.py | grep VERSION'

# Pull and deploy the patched release
docker compose pull
docker compose up -d

# Confirm upgrade to 4.10.17-lts or later
curl -s https://jumpserver.example.com/api/health/ | jq '.version'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.