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

Published Jun 9, 2025
·
Updated

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 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:getall) to extract sensitive system data, including database credentials, SMTP passwords, and admin credentials due to some dangerous function being allowed.

Proof of Concept

- Create a user and give him campaigns:get and campaigns:getall privileges

!image

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

- Now in the text field you can input the following and press Preview: {{ env "AWSKEY" }} {{ env "LISTMONKdbuser" }} {{ env "LISTMONKdbpassword" }}

!image

Preview:

!image

I had the AWSKEY variable set like that to confirm the vulnerability:

!image

Impact

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

Suggested Fix

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

Other sources

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.

— MITRE

Affected Software

2 affected componentsFixes available
go/github.com/knadh/listmonk>=4.0.0<5.0.2
5.0.2
nadh listmonk>=4.0.0<5.0.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/knadh/listmonk to a version that resolves this vulnerability.

    Fixed in 5.0.2
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in v5.0.2
  3. Configuration

    Blacklist the env, expandEnv, and fail template functions so they cannot be used to leak environment variables or execute dangerous template behavior.

    Listmonk Sprig templates allowed template functions = Blacklist env, expandEnv, and fail

Event History

Jun 9, 2025
Advisory Published
via GitHub·01:09 PM
Data Sourced
via GitHub·01:09 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·04:21 PM
Data Sourced
via MITRE·04:21 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-49136?

The severity of CVE-2025-49136 is considered high due to potential exposure of sensitive environment variables in multi-user installations.

2

How do I fix CVE-2025-49136?

To fix CVE-2025-49136, you should upgrade to version 5.0.2 or later of the Listmonk application.

3

What vulnerabilities does CVE-2025-49136 introduce?

CVE-2025-49136 can lead to information disclosure by allowing unauthorized access to environment variables.

4

Who is affected by CVE-2025-49136?

Users of Listmonk versions between 4.0.0 and 5.0.1 in multi-user environments may be affected by CVE-2025-49136.

5

What are the implications of CVE-2025-49136 in a multi-user environment?

In a multi-user environment, CVE-2025-49136 can compromise the security of user data by leaking environment variables.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203