9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Stéphane Aulery" <saulery@free.fr>
To: rsc@swtch.com, anselm@garbe.us, 9trouble@plan9.bell-labs.com,
	9fans@9fans.net
Subject: Debian bug 737206 - rc shell uses insecurely /tmp
Date: Thu,  4 Dec 2014 00:49:18 +0100	[thread overview]
Message-ID: <20141203234918.GA27533@free.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

Hello,

I make you pass an open bug report on the Debian bts about rc.
I do not know to whom I should speak. The code comes from 9base, who
just plan9port, etc. Here is the report [1]:

   Package: 9base
   Version: 1:6-6
   Severity: important
   Tags: security

   Murray McAllister from Red Hat Security Response Team discovered that rc
   creates temporary files in an insecure way:

   $ strace -o '| grep /tmp' ./test-heredoc
   open("/tmp/here217f.0000", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 5
   open("/tmp/here217f.0000", O_RDONLY|O_LARGEFILE) = 5
   moo
   unlink("/tmp/here217f.0000")            = 0

   As you can see, the filenames are easily predictable, and the O_EXCL
   flag is missing.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737206

Regards,

--
Stéphane Aulery

[-- Attachment #2: test-heredoc --]
[-- Type: text/plain, Size: 47 bytes --]

#!/usr/lib/plan9/bin/rc
cat << EOF
moo
EOF

             reply	other threads:[~2014-12-03 23:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 23:49 Stéphane Aulery [this message]
2014-12-05  2:33 ` [9fans] " Charles Forsyth
2014-12-05  3:08   ` Bruce Ellis
2014-12-05  3:20     ` Skip Tavakkolian
2014-12-05  4:14     ` Kurt H Maier
2014-12-06  1:58       ` Bruce Ellis
2014-12-07 17:35 ` anselm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141203234918.GA27533@free.fr \
    --to=saulery@free.fr \
    --cc=9fans@9fans.net \
    --cc=9trouble@plan9.bell-labs.com \
    --cc=anselm@garbe.us \
    --cc=rsc@swtch.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).