KeePass Triggers Are Dead, Long Live KeePass Triggers!
KeePass triggers, stored in the unencrypted configuration file, can be abused with placeholders and recursive field references to export database entries in cleartext. An attacker with write access to the configuration file could recover passwords from many entries without the masterkey prompt added in 2.53.1.
Published on d3lb3.github.io
7 years ago, Will Schroeder (a.k.a @harmj0y) showed how attackers could abuse KeePass trigger system in order to extract cleartext passwords. As it only required the addition of some parameters in a configuration file, this technique was at the same time straightforward and quiet.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the trigger system executes actions and resolves placeholders and field references from an unencrypted configuration file, so anyone who can edit that file can make KeePass export secrets.
Impact
An attacker with write access to the configuration file could export database entries in cleartext, though the 2.53.1 masterkey prompt blocks the simple export action and the recursive technique is limited to 12 entries by a recursion depth limit.
What the attacker needed
Write access to KeePass.config.xml; often administrator rights on the machine; KeePass restart and database unlock
The fix
KeePass should treat the trigger configuration as untrusted or require the masterkey for any action that exposes secrets, as version 2.53.1 did for database export.
How it was found
- Create a malicious trigger from the KeePass graphical interface and copy the resulting XML from your own configuration file.
- Insert the trigger XML into the target's KeePass.config.xml under the trigger system section.
- Restart KeePass so the trigger is loaded on the upcoming startup.
- Unlock the database so the trigger fires and exports entries to a file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
KeePass is a password manager that keeps your passwords in an encrypted file. It also has a separate settings file that is not encrypted, and it can run automatic actions called triggers. If someone can edit that settings file, they can make KeePass copy passwords out into a plain text file, which is what this article shows.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.