Secunia Research: SqWebMail Attached File Script Insertion Vulnerability
======================================================================
Secunia Research 24/08/2005
- SqWebMail Attached File Script Insertion Vulnerability -
======================================================================
Table of Contents
Affected Software....................................................1
Severity.............................................................2
Description of Vulnerability.........................................3
Solution.............................................................4
Time Table...........................................................5
Credits..............................................................6
References...........................................................7
About Secunia........................................................8
Verification.........................................................9
======================================================================
1) Affected Software
SqWebMail 5.0.4
Other versions may also be affected.
======================================================================
2) Severity
Rating: Moderately Critical
Impact: Script Insertion
Where: From Remote
======================================================================
3) Description of Vulnerability
Secunia Research has discovered a vulnerability in SqWebMail, which
can be exploited by malicious people to conduct script insertion
attacks.
The vulnerability is caused due to SqWebMail allowing attached files
to be viewed in context of the SqWebMail server. This can be
exploited to execute arbitrary script code in a user's browser session
in context of the SqWebMail server when a user clicks "Display" on an
attached file.
Example Attack Scenario:
1) The user receives an email with an attachment called e.g.
"image.jpg".
2) The user uses the SqWebMail "Display" feature to view the attached
file.
3) This causes SqWebMail to output the contents of the attachment in
context of the SqWebMail server.
However, when SqWebMail outputs the file, the user-controlled
"Content-Type" from the email is used, which causes the browser to
e.g. treat the content as "text/html" thereby executing any included
script code in context of the SqWebMail server.
Successful exploitation allows a malicious person to perform the same
actions as the user of the web mail account (e.g. sending or viewing
emails).
Example Email Attachment:
--_----------=_1123228313217851
Content-Disposition: attachment; filename="image.jpg"
Content-Transfer-Encoding: binary
Content-Type: text/html
<html>
<body>
<script>alert(document.domain);</script>
</body>
</html>
--_----------=_1123228313217851--
======================================================================
4) Solution
Don't "Display" or "Download" attached files.
NOTE: The vendor does not acknowledge this as a vulnerability.
However, the vendor has changed some functionality for all upcoming
versions based on this report.
SqWebMail version 5.0.4, snapshot builds from 23/08/2005 and later
will include the user-controlled "Content-Type" field when showing
attached files in emails. However, this does not prevent exploitation
of the vulnerability.
======================================================================
5) Time Table
23/08/2005 - Initial vendor notification.
24/08/2005 - Vendor responds that he doesn't consider this a
vulnerability.
24/08/2005 - Public disclosure.
======================================================================
6) Credits
Discovered by Jakob Balle, Secunia Research.
======================================================================
7) References
Vendor Response:
http://marc.theaimsgroup.com/?l=courier-users&m=112488135424849&w=2
======================================================================
8) About Secunia
Secunia collects, validates, assesses, and writes advisories regarding
all the latest software vulnerabilities disclosed to the public. These
advisories are gathered in a publicly available database at the
Secunia website:
http://secunia.com/
Secunia offers services to our customers enabling them to receive all
relevant vulnerability information to their specific system
configuration.
Secunia offers a FREE mailing list called Secunia Security Advisories:
http://secunia.com/secunia_security_advisories/
======================================================================
9) Verification
Please verify this advisory by visiting the Secunia website:
http://secunia.com/secunia_research/2005-35/advisory/
Complete list of vulnerability reports published by Secunia Research:
http://secunia.com/secunia_research/
======================================================================