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

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

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H`)
- **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:** Yes
- **Published:** 9 Jun 2025
- **Updated:** 10 Jun 2025
- **Also known as:** GHSA-jc7g-x28f-3v3h, GO-2025-3745

## 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 (Improper Neutralization of Special Elements Used in a Template Engine)

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/knadh/listmonk` | Go | All versions | None |
| `github.com/knadh/listmonk` | Go | From 4.0.0 | 5.0.2 |
| `github.com/knadh/listmonk` | Go | From 4.0.0 | 5.0.2 |

Products: Nadh Listmonk.

## How do I fix CVE-2025-49136?

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

## 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:

- Listmonk Insecure Sprig Template Functions Environment Disclosure (metasploit)

## Other vulnerabilities in knadh listmonk

- [CVE-2025-58430](https://insights.sbomify.com/CVE-2025-58430/): listmonk Vulnerable to CSRF to XSS Chain That Can Lead to Admin Account Takeover (high 8.6)
- [CVE-2026-34828](https://insights.sbomify.com/CVE-2026-34828/): listmonk: Active sessions remain valid after password reset and password change (high 7.1)
- [CVE-2025-46011](https://insights.sbomify.com/CVE-2025-46011/): SQL injection in n/a (medium 6.5)
- [CVE-2026-34584](https://insights.sbomify.com/CVE-2026-34584/): listmonk: Broken Access Control in CSV Import (Unauthorized List Assignment) (medium 5.4)
- [CVE-2026-21483](https://insights.sbomify.com/CVE-2026-21483/): listmonk Vulnerable to Stored XSS Leading to Admin Account Takeover (medium 5.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-49136 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-49136 exists.

Affected packages and fixed versions:
- github.com/knadh/listmonk (Go): affected all versions; no fix listed
- github.com/knadh/listmonk (Go): affected from 4.0.0; fixed in 5.0.2
- github.com/knadh/listmonk (Go): affected from 4.0.0; fixed in 5.0.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-49136/ (Markdown: https://insights.sbomify.com/CVE-2025-49136/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-49136
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-49136
- OSV: https://osv.dev/vulnerability/CVE-2025-49136

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-49136/
Summaries are generated and may contain mistakes; the official description above is the record.
