Skip Menu |

This queue is for tickets about the Mail-GnuPG CPAN distribution.

Report information
The Basics
Id: 2683
Status: resolved
Priority: 0/
Queue: Mail-GnuPG

People
Owner: Nobody in particular
Requestors: joern [...] zyn.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



To: bug-Mail-GnuPG [...] rt.cpan.org
From: Jörn Reder <joern [...] zyn.de>
Subject: Patch for Mail::GnuPG 0.04
Date: Thu, 29 May 2003 13:36:01 +0200
Hiho, first thanks for the module. It works great for me, I was able to add the GnuPG stuff to my MUA in less than 2 hours ;) But I found a portability and a security issue, attached you find a small patch fixing both: 1.) Passing DIR => "/tmp" to tempfile() isn't portable, tempfile() itself takes care about a proper temp directory. 2.) verify(): temporary files are deleted on program exit, but should be deleted as soon as possible after processing. In case of an encrypted and signed message, keeping the unencrypted body file on the harddisk longer than necessary is a serious security flaw. But even deleting the files immediately doesn't really fix the problem. It would be better to always pipe the signed message into gnupg, instead of using temp. files. Regards, Joern -- Joern Reder Development Head ZYN! Coding Division - http://www.zyn.de/
--- GnuPG.pm 2003-05-29 13:17:40.000000000 +0200 +++ GnuPG.pm.patched 2003-05-29 13:17:37.000000000 +0200 @@ -236,7 +236,6 @@ my ($sigfh, $sigfile) = File::Temp::tempfile('mgsXXXXXXXX', - DIR => "/tmp", UNLINK => 1, ); print $sigfh $sigtext; @@ -244,7 +243,6 @@ my ($datafh, $datafile) = File::Temp::tempfile('mgdXXXXXX', - DIR => "/tmp", UNLINK => 1, ); # Read the (unencoded) body data: @@ -264,6 +262,8 @@ close $error; close $input; + unlink $sigfile, $datafile; + waitpid $pid, 0; my $exit_value = $? >> 8;
Subject: tempfile security Patch for Mail::GnuPG 0.04
Show quoted text
> first thanks for the module. It works great for me, I was able to add > the GnuPG stuff to my MUA in less than 2 hours ;)
I'm very glad you like it and find it useful. Show quoted text
> But I found a portability and a security issue, attached you find a > small patch fixing both:
Thanks, I've applied your patch. It will be in the next release. Show quoted text
> of an encrypted and signed message, keeping the unencrypted body > file on the harddisk longer than necessary is a serious security > flaw. But even deleting the files immediately doesn't really fix > the problem. It would be better to always pipe the signed message > into gnupg, instead of using temp. files.
Agreed. I've added this to the TODO list. I'll need to figure out how to make it work right with detached signatures. -R