Stored Cross Site Scripting on Mdaemon Webmail (20.0.0)
Two stored cross-site scripting flaws existed in MDaemon Webmail: a malicious filename in an email attachment executed script when the attachment was uploaded and again when a recipient forwarded the message, and a distribution list contact name executed script whenever the distribution list section was viewed. An attacker could run script in a victim's browser session.
Published on kailashbohara.com.np
Security engineer with 9 years of experience in penetration testing, security architecture, cloud security, zero trust implementation, and threat hunting.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the webmail failed to sanitise or encode user-supplied file names and contact names before rendering them in HTML.
Impact
An attacker could execute script in a victim's webmail session, potentially stealing session data or performing actions as the victim, though the attachment case required the victim to click forward.
What the attacker needed
Access to MDaemon Webmail below 20.0.1; victim opens the forwarded mail; victim visits the distribution list section
The fix
The vendor addressed both issues in version 20.0.1, released on 18 August 2020.
How it was found
- Rename a file so its name contains script code and give it a .jpg extension.
- Compose a new mail, choose a recipient, and attach the file; the script runs immediately after upload.
- Send the mail and have the recipient open it; opening alone does not run the script.
- Have the recipient click the forward button, which triggers the script pop-up.
- Go to the contacts section and the distribution list menu, then create a new distribution list.
- Put script code in the contact name field and save; the script runs each time the distribution list section is visited.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Cross-site scripting (XSS) is when a website lets an attacker sneak JavaScript code into a page that other people view, so the code runs in their browser. Here the webmail program did not clean up file names or contact names before showing them, so a crafted name became active code. The attacker only needed to send a message or get a victim to open a list, and the script would run as that victim.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.