CVE-2026-129168 in PMail
Summary
by MITRE • 11/13/2026
PMail 2.9.1 through 2.9.8 contains a stored cross-site scripting vulnerability because the /attachments/{id}/{cid} endpoint returns email attachments verbatim with the sender-supplied Content-Type after cid: references are rewritten into attachment links. Unauthenticated SMTP senders can email a text/html attachment and a page-covering cid link, so a recipient who clicks the message runs script in their webmail session to change passwords, including the administrator's.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/13/2026
The vulnerability identified in PMail versions 2.9.1 through 2.9.8 represents a critical stored cross-site scripting flaw rooted in improper input validation and content type handling within the email attachment processing subsystem. Specifically, the endpoint responsible for serving attachments via the /attachments/{id}/{cid} route fails to sanitize or validate the Content-Type header supplied by the sender when rewriting cid references into inline attachment links. This architectural oversight allows an attacker to inject malicious HTML content that is stored on the server and subsequently served to victims with a trusted context, effectively bypassing standard browser security policies such as the same-origin policy. The core technical failure lies in the application's assumption that email attachments are safe or its inability to distinguish between legitimate MIME types and those capable of executing client-side scripts when rendered by modern web browsers.
From an operational perspective, this vulnerability enables unauthenticated SMTP senders to craft malicious emails containing text/html attachments with embedded cid links pointing to attacker-controlled resources or injected script payloads. When a recipient opens the email within their PMail webmail interface, the browser interprets the content as part of the trusted application domain rather than external data. This context confusion allows the executed JavaScript to interact directly with the victim's active session cookies and local storage. The impact is severe because it grants an unauthenticated attacker full control over the user's interaction with the mail client without requiring any prior authentication or social engineering beyond simple email delivery.
The consequences of this exploitation are particularly acute for administrative accounts, as demonstrated in reports where clicking a malicious message allowed script execution that could alter account credentials. By manipulating session tokens and form submissions within the webmail interface, an attacker can change passwords, escalate privileges to administrator level, and potentially exfiltrate sensitive email data or install persistent backdoors through further phishing campaigns initiated from the compromised account. This transforms a simple mail client into a vector for complete system compromise if administrative credentials are targeted successfully.
To mitigate this risk, immediate remediation should involve upgrading PMail to a version where the attachment serving logic strictly validates and normalizes Content-Type headers against an allowlist of safe MIME types such as text/plain or image/png, rejecting any content type that permits script execution like text/html unless explicitly sanitized by a robust HTML purifier. Additionally, implementing strict Content Security Policy headers on the webmail interface can restrict inline script execution even if injection occurs. Developers must also ensure that cid references are resolved using safe data URIs rather than allowing arbitrary URL schemes or relative paths that could be exploited for cross-domain attacks. Regular security audits focusing on MIME type handling and output encoding in email clients are essential to prevent similar stored XSS vulnerabilities in the future, aligning with CWE-79 standards for improper neutralization of input during web page generation.