github.com/knadh/listmonk
Affected
- introduced
4.0.0, fixed5.0.2(semver)
Fixed versions
5.0.2
Fix
- Fixed version
5.0.2go get github.com/knadh/[email protected]
Advisory
Also known as: CVE-2025-49136, GO-2025-3745
listmonk's Sprig template Injection vulnerability leads to reading of Environment Variable for low privilege user
Summary
The env and expandenv template functions which is enabled by default in 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.
Upgrade to [v5.0.2](https://github.com/knadh/listmonk/releases/tag/v5.0.2) to mitigate.
---------
Demonstration
Description
A 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.
Proof of Concept
campaigns:get and campaigns:get_all privileges{{ env "AWS_KEY" }}
{{ env "LISTMONK_db__user" }}
{{ env "LISTMONK_db__password" }}
Preview:
I had the AWS_KEY variable set like that to confirm the vulnerability:
Impact
Suggested Fix
Critical Basis: The source's own band: CRITICAL
4.0.0, fixed 5.0.2 (semver)5.0.2
5.0.2go get github.com/knadh/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0