python-gnupg Improper Input Validation

2019-03-15 / 2019-03-14
Risk: Medium
Local: Yes
Remote: No
CWE: CWE-20


CVSS Base Score: 5/10
Impact Subscore: 2.9/10
Exploitability Subscore: 10/10
Exploit range: Remote
Attack complexity: Low
Authentication: No required
Confidentiality impact: None
Integrity impact: Partial
Availability impact: None

CVE-2019-6690: Improper Input Validation in python-gnupg ======================================================== We discovered a way to inject data through 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 subsequent lines. By supplying a passphrase containing a newline an attacker can control/modify the ciphertext/plaintext being decrypted/encrypted. Vulnerable - ---------- python-gnupg 0.4.3, and maybe earlier versions. Mitigation - ---------- Users should upgrade to 0.4.4. Timeline - -------- 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 References - ---------- https://pypi.org/project/python-gnupg/ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6690 https://blog.hackeriet.no/cve-2019-6690-python-gnupg-vulnerability/ https://github.com/hackeriet/CVE-2019-6690-python-gnupg-vulnerability https://ctftime.org/task/7458 Proof of Concept - ---------------- Hypothetical application using successful decryption of data to authenticate a user, and a way to exploit it is available here: https://blog.hackeriet.no/assets/CVE-2019-6690-python-gnupg-vulnerability.tgz https://blog.hackeriet.no/assets/CVE-2019-6690-python-gnupg-vulnerability.tgz.sig Credits - ------- Vulnerability discovered by Alexander Kjäll and Stig Palmquist. Thanks to @dewaelethom who wrote the CTF challenge.

References:

https://blog.hackeriet.no/assets/CVE-2019-6690-python-gnupg-vulnerability.tgz
https://blog.hackeriet.no/assets/CVE-2019-6690-python-gnupg-vulnerability.tgz.sig


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top