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

CVE-2026-53964: Document Merge Service SSTI RCE Vulnerability

CVE-2026-53964 is a server-side template injection vulnerability in Document Merge Service that enables remote code execution through XLSX templates. This article covers the technical details, security impact, and mitigation strategies.

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-53964 Overview

CVE-2026-53964 is a server-side template injection (SSTI) vulnerability in Adfinis Document Merge Service, a document template merge API used to render templates with user-supplied data. Versions prior to 9.1.0 process XLSX templates through the xltpl library, which initializes a non-sandboxed Jinja environment. Attackers with template upload privileges can embed Jinja expressions that execute arbitrary Python code in the container. Code runs as the document-merge-server user with UID 901, giving attackers substantial control over the container runtime. The maintainers patched the issue in version 9.1.0.

Critical Impact

Authenticated attackers can achieve remote code execution inside the Document Merge Service container through malicious XLSX templates processed by a non-sandboxed Jinja environment.

Affected Products

  • Adfinis Document Merge Service versions prior to 9.1.0
  • Deployments using XLSX templates processed via the xltpl library
  • Container deployments running as the document-merge-server user (UID 901)

Discovery Timeline

  • 2026-10-01 - CVE-2026-53964 published to NVD
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-53964

Vulnerability Analysis

The Document Merge Service accepts XLSX templates that are rendered using the xltpl library. xltpl instantiates a standard Jinja environment without the SandboxedEnvironment restrictions, allowing template expressions to access Python attribute chains and built-in callables.

An attacker who can submit or upload an XLSX template can embed Jinja syntax that traverses Python object internals to reach os.system, subprocess.Popen, or equivalent primitives. When the service merges the template with provided data, the payload executes in-process. The resulting code runs with the privileges of the service account inside the container, enabling access to configuration, mounted secrets, and network reachability from the pod.

The weakness is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.

Root Cause

The root cause is the use of a non-sandboxed Jinja environment inside the xltpl XLSX rendering path. Jinja's default environment permits attribute access to Python object graphs, which is sufficient to escape the templating boundary and reach code execution primitives. DOCX template handling in the same service is not affected by this specific flaw.

Attack Vector

Exploitation requires network access to the Document Merge Service API and authenticated privileges to submit XLSX templates for merging. The attacker crafts an XLSX file containing a Jinja payload within a cell. When the service processes the template, the payload is evaluated and executes under the document-merge-server user. See the GitHub Security Advisory GHSA-w47q-945m-q9pc for additional technical context.

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-53964

Indicators of Compromise

  • Unexpected child processes spawned by the Document Merge Service process, particularly shells such as /bin/sh, /bin/bash, or interpreters like python invoked with inline commands
  • Outbound network connections from the document-merge-server process to unexpected destinations following template submission
  • XLSX templates stored in the service containing Jinja expressions referencing __class__, __mro__, __subclasses__, __builtins__, or os.popen
  • API requests submitting XLSX templates from accounts that do not normally perform template operations

Detection Strategies

  • Inspect uploaded XLSX files for Jinja control sequences {{, }}, {%, and %} combined with Python dunder attributes before processing
  • Monitor the container runtime for process creation events where the parent is the Django or Gunicorn worker serving Document Merge Service
  • Alert on file writes outside expected template and output directories by UID 901

Monitoring Recommendations

  • Enable audit logging on the Document Merge Service API, capturing template upload and merge endpoint calls with user identity
  • Forward container process and network telemetry to a central analytics platform to correlate template submissions with subsequent process execution
  • Review access logs for high-volume template submissions from a single account, which can indicate exploitation attempts

How to Mitigate CVE-2026-53964

Immediate Actions Required

  • Upgrade Document Merge Service to version 9.1.0 or later as published in the GitHub release notes
  • Restrict template upload and merge API endpoints to trusted authenticated users only
  • Audit existing stored XLSX templates for Jinja expressions that reference Python internals and remove suspicious entries
  • Rotate credentials, API tokens, and secrets accessible from the container if exploitation is suspected

Patch Information

Adfinis released the fix in Document Merge Service version 9.1.0. Operators should pull the updated container image and redeploy. Refer to the GitHub Security Advisory GHSA-w47q-945m-q9pc for the full fix description and upgrade guidance.

Workarounds

  • Disable XLSX template processing until the service is upgraded, where the application configuration supports it
  • Place the service behind a reverse proxy that enforces strict authentication and rate limiting on template endpoints
  • Run the container with a read-only root filesystem and drop Linux capabilities to limit the impact of code execution within the pod
  • Apply network egress policies that prevent the container from initiating outbound connections to non-essential destinations

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.