KeyPass Password Safe 1.22 Cross Site Scripting

Type packetstorm
Reporter Benjamin Kunz Mejri
Modified 2012-07-17T00:00:00


KeyPass Password Safe v1.22 - Software Filter Vulnerability  
Common Vulnerability Scoring System:  
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: )  
The Vulnerability Laboratory Research Team discovered a software filter & validation vulnerability in the KeyPass Password Manager v1.22 & older versions.  
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  
Affected Products:  
Domenic Reichl  
Product: Keypass Password Safe v1.22 & older versions  
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>  
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.  
<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= onload=alert("VL")   
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>  
PoC: XML for imports ...  
<?xml version="1.0" encoding="utf-8" standalone="yes"?>  
<group tree="my keypass test">mypass category</group>  
<expiretime expires="false">2999-12-28T23:59:59</expiretime>  
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!):  
The security risk of the persistent software vulnerability is estimated as low(+)|medium(-).  
Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri (  
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: - -  
Contact: - -  
Section: - -  
Social:!/vuln_lab - -  
Feeds: - -  
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 ( or to get a permission.  
Copyright © 2012 | Vulnerability Laboratory