CVE-2025-49136 listmonk's Sprig template Injection vulnerability leads to reading of Environment Variable for low privilege user

Critical 9.1 Published Updated

Low-privilege users can inject template code to read sensitive environment variables from the host system.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-49136?

CVE-2025-49136 is a critical code injection vulnerability in knadh listmonk, published on 9 Jun 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-1336

Which versions are affected by CVE-2025-49136?

3 open source packages ship an affected version, including github.com/knadh/listmonk. It affects 1 product.

PackageAffectedFixed in
github.com/knadh/listmonk GoAll versionsNone
github.com/knadh/listmonk GoFrom 4.0.05.0.2
github.com/knadh/listmonk GoFrom 4.0.05.0.2

Products include Nadh Listmonk.

How do I fix CVE-2025-49136?

Upgrade github.com/knadh/listmonk to 5.0.2 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-49136 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-49136 exists.

Public exploit code: 1 Metasploit module.

Sources

Also known as GHSA-jc7g-x28f-3v3h, GO-2025-3745.

Is CVE-2025-49136 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free