No description, website, or topics provided.
Branch: master
Clone or download
Pull request Compare This branch is even with stigtsp:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

CVE-2019-6690: Improper Input Validation in python-gnupg 0.4.3

We discovered a way to inject data trough the passphrase property of the gnupg.GPG.encrypt() and gnupg.GPG.decrypt() methods when symmetric encryption is used.

The supplied passphrase is not validated for newlines, and the library passes --passphrase-fd=0 to the gpg executable, which expects the passphrase on the first line of stdin, and the ciphertext to be decrypted or plaintext to be encrypted on sebsequent lines.

By supplying a passphrase containing a newline an attacker can control/modify the ciphertext/plaintext being decrypted/encrypted.


python-gnupg 0.4.3, and maybe earlier versions


Users should upgrade to 0.4.4


  • 2019-01-19: Vulnerability discovered during Insomni'hack teaser 2019
  • 2019-01-20: PoC created
  • 2019-01-22: Applied for CVE, Vendor notified
  • 2019-01-23: CVE-2019-6690 assigned
  • 2019-01-23: Vendor responded, fix committed
  • 2019-01-24: Vendor released 0.4.4


Proof of Concept

Hypothetical application using sucessful decryption of data to authenticate a user, and a way to exploit it is available here:


Debian: apt install libmojolicious-perl python3-gnupg python3-flask

Nix: nix-shell

Run the server


Run the exploit



Vulnerability discovered by Alexander Kjäll and Stig Palmquist.

Thanks to remmer.