Subject: Re: privacy hole in pine

From: David J N Begley <[email-masked]>
Date: Fri, 29 Nov 1996 20:13:05 +1100

On 28 Nov 1996, Tilmann Boess wrote:

> is not possible for `~/.pinerc'.  As a workaround, I created the following
> simple shell script and aliased pine to pine-secure:

Why not just do what we do, and run with a "077" umask for all users by
default?  PINE is just doing what it's supposed to do in relation to the
umask, IMHO.

Cheers..

dave

---

From: [email-masked] (Logan Shaw)
Date: Thu, 28 Nov 1996 14:52:05 GMT

In article <[email-masked]>,
Tilmann Boess <[email-masked]> wrote:
>The versions 3.94 (tested on IBM AIX 3.2) and 3.95 (tested on Linux 2.0)
>(I don't know about earlier versions.) of pine include a privacy hole:
>
>If you write a new message, pine creates a backup file (named
>`#pico<pine-PID>#') of the mail text in your home directory.  The access
>mode of this file is determined by your standard umask.  For most users
>this is set to `022', thus setting the access mode for the backup file to
>644, so that the text you just write is world-readable.  Also the files
>`~/.pinerc' and `.addressbook' are created using the default umask.  IMHO
>these files should be readable by no one except its owner.  Ok, you can
>choose a more private location for `.addressbook' in `~/.pinerc', but that
>--------------------------------
>#!/usr/local/bin/tcsh
># /usr/local/bin/pine-secure
>set default_umask=`umask`
>umask 077
>/usr/local/bin/pine $*
>umask $default_umask
>unset default_umask
>--------------------------------

Just a bit of shell-script nit-picking:

You don't need to use some non-standard shell to do something this
sipmle.  You don't need to reset the mask and unset variables in a
shell that's going to go away anyway.  You don't even need the shell to
hang around while pine is running.  I'd suggest the following instead:

	#! /bin/sh
	# pine-secure -- run pine with a secure umask.

	umask 077
	exec pine "$@"
	exit 5	# if exec fails, return an error

  - Logan
-- 
Logan Shaw, Unix Systems Administrator
"everybody / loves to see / justice done / on somebody else" (Bruce Cockburn)