CVE-2025-49136: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in knadh listmonk
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 Analysis
Technical Summary
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.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Italy, Spain, Poland
CVE-2025-49136: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in knadh 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
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.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
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
Related Threats
CVE-2025-9000: Uncontrolled Search Path in Mechrevo Control Center GX V2
HighCVE-2025-8993: SQL Injection in itsourcecode Online Tour and Travel Management System
MediumCVE-2025-8992: Cross-Site Request Forgery in mtons mblog
MediumCVE-2025-8991: Business Logic Errors in linlinjava litemall
MediumCVE-2025-8990: SQL Injection in code-projects Online Medicine Guide
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.