CVE-2025-49136: Github.com/knadh/listmonk Listmonk's Sprig Template Injection Vulnerability Vulnerability
CRITICALCVE-2025-49136 is a CRITICAL (CVSS 9.0) listmonk's sprig template injection vulnerability vulnerability (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) affecting Github.com/knadh/listmonk libraries in the Go ecosystem. The issue involves listmonk's sprig template injection vulnerability leads to reading of environment variable for low privilege user. Remediation is available by upgrading affected packages to version 5.0.2.
CVE-2025-49136 at a Glance
Security Impact
CVSS: 9.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H).
How to Fix CVE-2025-49136
To remediate this vulnerability, upgrade all affected Github.com/knadh/listmonk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/knadh/listmonk to 5.0.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/knadh/listmonk
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-49136, inspect your project dependencies for Github.com/knadh/listmonk:
inspect dependencies for github.com/knadh/listmonk
Analyze the terminal output to locate any version of Github.com/knadh/listmonk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, where the product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine. In Github.com/knadh/listmonk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-49136 Affected Github.com/knadh/listmonk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/knadh/listmonk
|
Go |
≥ 4.0.0
< 5.0.2
|
5.0.2
|
References
Frequently Asked Questions
What is CVE-2025-49136?
Which Github.com/knadh/listmonk versions are affected?
What version fixes CVE-2025-49136?
Is github.com/knadh/listmonk affected?
What is the CVSS score of CVE-2025-49136?
What CWE is associated with CVE-2025-49136?
How can I check Go dependencies for CVE-2025-49136?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jc7g-x28f-3v3h",
"modified" : "2025-06-10T19:59:04Z",
"published" : "2025-06-09T13:09:24Z",
"aliases" : [ "CVE-2025-49136" ],
"summary" : "listmonk's Sprig template Injection vulnerability leads to reading of Environment Variable for low privilege user",
"details" : "### Summary\nThe `env` and `expandenv` template functions which is enabled by default in [Sprig](https://masterminds.github.io/sprig/) enables capturing of env variables on the 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.\n\n**Upgrade to [v5.0.2](https://github.com/knadh/listmonk/releases/tag/v5.0.2)** to mitigate.\n\n---------\n\n# Demonstration\n\n### Description\nA critical template injection vulnerability exists in Listmonk's campaign preview functionality that allows authenticated users with minimal privileges (campaigns:get & campaigns:get_all) to extract sensitive system data, including database credentials, SMTP passwords, and admin credentials due to some dangerous function being allowed.\n\n### Proof of Concept\n\n- Create a user and give him `campaigns:get` and `campaigns:get_all` privileges\n\n\n\n- Now login with that user, go to any campaign, go the Content section and here lies the vulnerability, we're able to execute template content which allows us to get environment variables, execute Sprig functions...\n\n- Now in the text field you can input the following and press Preview:\n```\n{{ env \"AWS_KEY\" }}\n{{ env \"LISTMONK_db__user\" }}\n{{ env \"LISTMONK_db__password\" }}\n````\n\n\n\n# Preview:\n\n\n\nI had the AWS_KEY variable set like that to confirm the vulnerability:\n\n\n\n### Impact\n\n- Through these environment variables the attacker can access, they can fully compromise the database, cloud accounts, admin credentials, and more depending on what was setup leading to total system takeover and data breach.\n\n### Suggested Fix\n\n- Blacklist some function for templates like env, expandEnv and fail as they can be used to leak environment variables which leads to a full takeover.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/knadh/listmonk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "5.0.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/knadh/listmonk/security/advisories/GHSA-jc7g-x28f-3v3h"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-49136"
}, {
"type" : "WEB",
"url" : "https://github.com/knadh/listmonk/commit/d27d2c32cf3af2d0b24e29ea5a686ba149b49b3e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/knadh/listmonk"
}, {
"type" : "WEB",
"url" : "https://github.com/knadh/listmonk/releases/tag/v5.0.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1336" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2025-06-09T13:09:24Z",
"nvd_published_at" : "2025-06-09T17:15:29Z"
}
}