Red Hat Bugzilla – Bug 464510
gjots2 uses un-escaped gpg pass-phrase in shell command(s)
Last modified: 2009-01-14 22:06:55 EST
Description of problem:
When trying to open a gpg encrypted file with gjots2, the program asks for a passphrase and subsequently uses the (unescaped) answer in a popen() command line:
f = os.popen("echo " + self.gui.password + " | gpg ...");
(lines 310 and 313 of lib/file.py)
This can cause errors from the shell if the actual pass-phrase contains shell meta-characters and can lead to unintentional side-effects.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Use gjots2 to open a gpg encrypted file.
2. In the password dialog, enter: ;touch /tmp/U-R-HACKED;echo
There is now a file U-R-HACKED in /tmp.
No side effects.
This is in lib/file.py in the source distribution around lines 310 and 313. I don't know enough Python to suggest a good fix for this.
It's probably not so much a security issue as a possibly nasty bug. If my password contains a single quote, or a "$", or any other shell meta-character, I will not be able to decrypt my file.
No idea if this has been fixed in 2.3.7 (which is the latest version).
fixed in 2.3.8
gjots2-2.3.8-1.fc10 has been submitted as an update for Fedora 10.
gjots2-2.3.8-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.