[UNIX] NOCC Contains Cross Site Scripting Vulnerabilities

From: support@securiteam.com
Date: 10/21/02


From: support@securiteam.com
To: list@securiteam.com
Date: 21 Oct 2002 18:22:24 +0200

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  NOCC Contains Cross Site Scripting Vulnerabilities
------------------------------------------------------------------------

SUMMARY

 <http://nocc.sourceforge.net/> NOCC is a webmail client written in PHP.
It provides webmail access to IMAP and POP3 accounts. A security
vulnerability in the product allows remote attackers to cause it to return
aribtrary HTML and JavaScript to end users.

DETAILS

Vulnerable systems:
 * NOCC version 0.9.5 and prior

NOCC has got several cross-site scripting holes when displaying e-mail
messages. They allow an attacker to take over a victim's e-mail account
and/or perform actions against the victim's will, by simply sending a
malicious e-mail message to the victim.

Technical details:
1) If the e-mail message's MIME type is text/plain, the program doesn't
remove any HTML code from the mail body. It is shown "live".

2) When the victim selects "View header", no HTML codes are removed from
mail headers like Subject and Date (yes, you can write whatever you like
in the Date header).

Vendor status:
The vendor was contacted on the 9th and the 10th of July. They haven't
released any official fixed version yet.

Unoffical patch:
Ulf wrote a patch for these security holes, and it is included in this
mail as an attachment. Ulf has patched it against version 0.9.5.

--- nocc-0.9.5/functions.php.old Sun Oct 20 00:12:34 2002
+++ nocc-0.9.5/functions.php Sun Oct 20 00:27:12 2002
@@ -213,7 +213,7 @@
     'body' => $glob_body,
     'body_mime' => $tmp['mime'],
     'body_transfer' => $tmp['transfer'],
- 'header' => $header,
+ 'header' => htmlspecialchars($header),
     'verbose' => $verbose,
     'prev' => $prev_msg,
     'next' => $next_msg
@@ -444,6 +444,7 @@
   }
   elseif (eregi('plain', $mime))
   {
+ $body = htmlspecialchars($body);
     $body =
eregi_replace("(http|https|ftp)://([a-zA-Z0-9+-=%&:_.~?]+[#a-zA-Z0-9+]*)","<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>", $body);
     $body =
eregi_replace("([#a-zA-Z0-9+-._]*)@([#a-zA-Z0-9+-_]*)\.([a-zA-Z0-9+-_.]+[#a-zA-Z0-9+]*)","<a href=\"$PHP_SELF?action=write&mail_to=\\1@\\2.\\3&lang=$lang\">\\1@\\2.\\3</a>", $body);
     $body = nl2br($body);

ADDITIONAL INFORMATION

The information has been provided by <mailto:ulfh@update.uu.se> Ulf
Harnhammar.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.



Relevant Pages

  • RE: [Full-Disclosure] Sidewinder G2
    ... If you not current with security software to the last two years your screwed ... A search at Cert for "Secure Computing" and "Sidewinder: ... exploit contains characters outside of the set defined by RFC822 (aka binary ... (do you really need a HTTP host: header length greater than 50 characters?). ...
    (Full-Disclosure)
  • Re: Calling macro function from within a header/footer?
    ... out for security classification levels seems to work just fine for page by ... When you put a field in a header, the header shows the same field ... > Jay Freedman ... So is there anyway possible to access a field via VBA code in the ...
    (microsoft.public.word.vba.general)
  • Re: A tool for crafting ESP packets
    ... A tool for crafting ESP packets ... AH (Authentication Header), ESP ... As all of these headers make up the IP Security ...
    (Pen-Test)
  • Re: Calling macro function from within a header/footer?
    ... We've asked Microsoft about the ability to run VBA code from a field ... code from a field would be a security risk (in the antivirus security ... Basically I have a bunch of code within the header ...
    (microsoft.public.word.vba.general)
  • Re: Please Help me- Creating Custom tokens
    ... you are free to do implement your own security elements in the header ... > But i guess that deals with the client sending a custom token obtained> from a token issuer and using that to encrypt and sign the requests.. ... > But the problem i want to solve is slightly different since I want to> send an encrypted token in the header of the response message. ... The> token created by the server has some user info such as his first name> last name, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)