what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

KeyPass Password Safe 1.22 Cross Site Scripting

KeyPass Password Safe 1.22 Cross Site Scripting
Posted Jul 17, 2012
Authored by Benjamin Kunz Mejri, Vulnerability Laboratory | Site vulnerability-lab.com

KeyPass Password Safe version 1.22 suffers from a filter bypass that allows for malicious script code insertion.

tags | exploit
SHA-256 | fc0a3a882993015dc7a091e373423dcc5d79e487f44fafbaf9d5dd68199ebf13

KeyPass Password Safe 1.22 Cross Site Scripting

Change Mirror Download
Title:
======
KeyPass Password Safe v1.22 - Software Filter Vulnerability


Date:
=====
2012-06-26


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


VL-ID:
=====
615


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


Introduction:
=============
KeePass is a very famous & free open source password manager, which helps you to manage your passwords in a secure way.
You can put all your passwords in one database, which is locked with one master key or a key file. So you
only have to remember one single master password or select the key file to unlock the whole database.
The databases are encrypted using the best and most secure encryption algorithms currently known (AES and Twofish).

(Copy of the Vendor Homepage: http://keepass.info )


Abstract:
=========
The Vulnerability Laboratory Research Team discovered a software filter & validation vulnerability in the KeyPass Password Manager v1.22 & older versions.


Report-Timeline:
================
2012-06-13: Researcher Notification & Coordination
2012-06-14: Vendor Notification
2012-06-20: Vendor Response/Feedback
2012-06-26: Public or Non-Public Disclosure
2012-07-01: Vendor Fix/Patch


Status:
========
Published


Affected Products:
==================
Domenic Reichl
Product: Keypass Password Safe v1.22 & older versions


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


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


Details:
========
A software filter & validation vulnerability is detected in the KeyPass Password Manager v1.22 & older versions.
The bug allows an attacker (local) to implement/inject malicious script code when processing to export a manipulated
KeyPass Password Manager database. The vulnerability is located in the validation of the html/xml export
function/module & the bound vulnerable domain/url (listing) parameter. 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) & an keypass v1.22 user. The bug will be injected on the local way, affects the local validation (html/xml)
and change the technic back when remote transfering the password lists. The injection of the malicious url/domain context can be
done via import (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 KeyPass Password Manager exports the html backup with a secure clean template like ...

<th>URL</th><th>Password</th><th>Notes</th><th>UUID</th><th>Icon</th><th>Creation Time</th><th>Last Access</th>
<th>Last Modification</th><th>Expires</th><th>Attachment Description</th><th>Attachment</th></tr>
<tr><td>mypass category</td><td>my keypass test</td><td>asdfas</td><td>asd</td>


The local attacker manipulate the database with malicious strings (script code) in the category item profile name input fields.
KeyPass Password Manager generates the clean html template but after the persistent script code inject in the database
profile domain/url item, the persistent code is getting executed direct out the clean exported html template file.

<tr class=``MyAccountNameRow``>
<td align=``right`` width=``150px``>Name des Benutzerkontos: </td>
<td><b>``><[PERSISTENT SCRIPT CODE]`) <<=`` b=``></td>
</tr>



Vulnerable Section(s):
[+] Export

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

Vulnerable Parameter(s):
[+] URL (Domain)


Proof of Concept:
=================
The persistent script code inject & execution can only be exploited by local attackers. For demonstration or reproduce ...


Exploitation Scenario:
Attacker is sending the victim a manipulated login page 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. The victim with keypass save the url or imports it via module (backup, xml & co). After some time the
victim is exporting the file as html plain file with the keypass template. The script code of the url gets executed and
transfers the context of the listed plain file directly to the attackers listening website script.


PoC: HTML

<tbody><tr><th>Password Groups</th><th>Group Tree</th><th>Title</th><th>User Name</th><th>URL</th>
<th>Password</th><th>Notes</th><th>UUID</th><th>Icon</th><th>Creation Time</th><th>Last Access</th>
<th>Last Modification</th><th>Expires</th><th>Attachment Description</th><th>Attachment</th></tr>
<tr><td>mypass category</td><td>my keypass test</td><td>asdfas</td><td>asd</td><td><a href=""><[PERSISTENT SCRIPT CODE]")' <"="">
"><iframe src=http://vuln-lab.com onload=alert("VL")

<</a></td><td>GhNWVzPhBD4dG4HfSI4L</td><td>asdaasf</td><
td>bdd4c872495537e65493cd08d1a2489b</td><td>0</td><td>2012-06-13 22:17:28</td
><td>2012-06-13 22:22:12</td><td>2012-06-13 22:17:28</td><td>2999-12-28

23:59:59</td><td> </td><td> </td></tr>
</table></body></html>
</iframe></a></td></tr></tbody>


PoC: XML for imports ...

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<pwlist>
<pwentry>
<group tree="my keypass test">mypass category</group>
<title>asdfas</title>
<username>asd</username>
<url>[PERSISTENT SCRIPT CODE]"><[PERSISTENT SCRIPT CODE]<</url>
<password>GhNWVzPhBD4dG4HfSI4L</password>
<notes>asdaasf</notes>
<uuid>bdd4c872495537e65493cd08d1a2489b</uuid>
<image>0</image>
<creationtime>2012-06-13T22:17:28</creationtime>
<lastmodtime>2012-06-13T22:17:28</lastmodtime>
<lastaccesstime>2012-06-13T22:22:12</lastaccesstime>
<expiretime expires="false">2999-12-28T23:59:59</expiretime>
</pwentry>


Solution:
=========
XML special characters in URLs (domain) need to be encoded when processing to export as HTML file.

2012-07-01: Vendor Fix/Patch - Keypass v1.23

Development Version (fixed!): http://keepass.info/filepool/KeePass_120625.zip


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 LABORATORY - RESEARCH TEAM
COMPANY: www.vulnerability-lab.com or www.vuln-lab.com
RESEARCH MAIL: research@vulnerability-lab.com

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close