Skip to main content

CVE-2025-49136: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in knadh listmonk

Critical
VulnerabilityCVE-2025-49136cvecve-2025-49136cwe-1336
Published: Mon Jun 09 2025 (06/09/2025, 16:21:48 UTC)
Source: CVE Database V5
Vendor/Project: knadh
Product: listmonk

Description

listmonk is a standalone, self-hosted, newsletter and mailing list manager. Starting in version 4.0.0 and prior to version 5.0.2, the `env` and `expandenv` template functions which is enabled by default in Sprig enables capturing of env variables on host. While this may not be a problem on single-user (super admin) installations, on multi-user installations, this allows non-super-admin users with campaign or template permissions to use the `{{ env }}` template expression to capture sensitive environment variables. Users should upgrade to v5.0.2 to mitigate the issue.

AI-Powered Analysis

AILast updated: 07/11/2025, 01:49:09 UTC

Technical Analysis

CVE-2025-49136 is a critical vulnerability affecting the listmonk software, a standalone, self-hosted newsletter and mailing list manager. The vulnerability arises from improper neutralization of special elements used in the template engine, specifically involving the 'env' and 'expandenv' template functions provided by the Sprig template library. These functions, enabled by default in listmonk versions from 4.0.0 up to but not including 5.0.2, allow template expressions to access environment variables on the host system. While this behavior may be acceptable in single-user deployments where the user is a super administrator, it becomes a significant security risk in multi-user environments. In such setups, non-super-admin users who have permissions to create or modify campaigns or templates can exploit the '{{ env }}' template expression to extract sensitive environment variables. This can lead to unauthorized disclosure of secrets such as API keys, database credentials, or other configuration data stored in environment variables. The vulnerability is classified under CWE-1336, which relates to improper neutralization of special elements in template engines, enabling injection or information disclosure attacks. The CVSS v3.1 score is 9.1 (critical), reflecting the high impact on confidentiality, integrity, and availability, combined with low attack complexity and the requirement of only low privileges and user interaction. No known exploits have been reported in the wild yet. The recommended mitigation is to upgrade listmonk to version 5.0.2 or later, where this issue has been addressed by disabling or properly securing the 'env' and 'expandenv' functions. Until the upgrade, administrators should restrict template and campaign editing permissions to trusted users only and consider isolating the deployment environment to minimize exposure of sensitive environment variables.

Potential Impact

For European organizations using listmonk in multi-user configurations, this vulnerability poses a severe risk. Attackers with limited privileges can extract sensitive environment variables, potentially exposing credentials for databases, cloud services, or internal APIs. This can lead to further compromise of internal systems, data breaches involving personal or customer data, and disruption of email campaigns. Given the criticality of the CVSS score and the potential for privilege escalation or lateral movement, the impact on confidentiality, integrity, and availability is substantial. Organizations subject to GDPR and other data protection regulations face increased compliance risks and potential fines if sensitive personal data is exposed due to exploitation of this vulnerability. Additionally, the disruption of communication channels via compromised mailing lists can affect business operations and reputation. The multi-user nature of many European enterprises’ deployments makes this vulnerability particularly relevant, especially in sectors like finance, healthcare, and government where secure communications are paramount.

Mitigation Recommendations

1. Immediate upgrade to listmonk version 5.0.2 or later, where the vulnerability is fixed. 2. Until upgrade is possible, restrict campaign and template editing permissions strictly to super-admin or highly trusted users to prevent exploitation by lower-privileged users. 3. Review and minimize environment variables exposed to the listmonk process, removing any unnecessary sensitive data. 4. Implement network segmentation and access controls to isolate listmonk servers from critical infrastructure and sensitive data stores. 5. Monitor logs and template changes for suspicious use of '{{ env }}' or similar expressions indicative of exploitation attempts. 6. Conduct internal audits of user roles and permissions regularly to ensure least privilege principles are enforced. 7. Consider deploying runtime application self-protection (RASP) or web application firewalls (WAF) with custom rules to detect and block malicious template expressions if feasible. 8. Educate administrators and developers about secure template usage and the risks of exposing environment variables in multi-user environments.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-06-02T10:39:41.634Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68487f591b0bd07c3938a9bd

Added to database: 6/10/2025, 6:54:17 PM

Last enriched: 7/11/2025, 1:49:09 AM

Last updated: 8/10/2025, 6:16:11 AM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats