Document Title: =============== KeePass Password Safe 1.22 - Encoding Filter Vulnerability References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=615 Release Date: ============= 2012-06-23 Vulnerability Laboratory ID (VL-ID): ==================================== 615 Common Vulnerability Scoring System: ==================================== 3 Product & Service 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 Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered a software filter & validation vulnerability in the KeePass Password Manager v1.22 & older versions. Vulnerability Disclosure Timeline: ================================== 2012-06-13: Researcher Notification & Coordination (Benjamin Kunz Mejri - Vulnerability Labs) 2012-06-14: Vendor Notification (Keepass Developer Team) 2012-06-20: Vendor Response/Feedback (Keepass Developer Team) 2012-06-26: Public Disclosure (Vulnerability Laboratory) 2012-07-01: Vendor Fix/Patch (Keepass Developer Team) Discovery Status: ================= Published Affected Product(s): ==================== Domenic Reichl Product: Keypass Password Safe 1.22 & older versions Exploitation Technique: ======================= Remote Severity Level: =============== Low Technical Details & Description: ================================ A software filter encoding validation vulnerability has been discovered in the KeePass Password Manager v1.22 & older versions. The bug allows an attacker (local) to implement/inject malicious script code when processing to export a manipulated database file. The vulnerability is located in the validation of the html/xml export function/module & the connected vulnerable domain/url parameter. URLs of entries are embedded in the exported HTML file without secure parse of the XML against special chars. Attackers can inject a url by add to the dabase. The execution occurs when the URL (domain) field of an entry contains a malicious script code, this will be executed when the exported as HTML file via browser. Exploitation of the vulnerabilitiy requires a manipulated url with malicious script code, a logging server with chmod 777, a listing file (random) & a keypass v1.22 + user. The payload will be injected locally and affects the local validation (html/xml) on exports. The injection of the malicious url/domain context can be done via import (victim browser add) or manually (reproduce) by including. Successful exploitation of the vulnerability lead to stable (persistent) context manipulation of the database file, persistent phishing, execution of malware or stealing plain password lists. Medium user inter action is required to exploit the vulnerability. Vulnerable Section(s): [+] Export Vulnerable Module(s): [+] HTML [+] XML Vulnerable Parameter(s): [+] URL (Domain) Proof of Concept (PoC): ======================= The persistent script code inject & execution can only be exploited by local attackers with medium user interaction. For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue. Normally KeePass Password Manager exports the html backup with a secure clean template like ...