all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* temp file hole?
@ 2007-10-03 23:38 Stefan Monnier
  2007-10-04 13:56 ` Michael Albinus
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2007-10-03 23:38 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

I'm afraid that the recent change to tramp-make-temp-file to use
makw-temp-name instead of make-temp-file introduced a security hole (the
very hole plugged by the introduction of make-temp-file in the first place).

I.e. if you want to keep using make-temp-name, please justify with comments
why your code is not vulnerable to the usual temp-file race condition
which goes something like:
1- Tramp decides to use /tmp/foo1234 as temp file.
2- some attacker creates a symlink from /tmp/foo1234 to some interesting place.
3- Tramp writes to /tmp/foo1234 without realizing that it's actually writing
   to the interesting place through that symlink.

The make-temp-name docstring also says:

   There is a race condition between calling `make-temp-name' and creating the
   file which opens all kinds of security holes.  For that reason, you should
   probably use `make-temp-file' instead, except in three circumstances:
   
   * If you are creating the file in the user's home directory.
   * If you are creating a directory rather than an ordinary file.
   * If you are taking special precautions as `make-temp-file' does.


-- Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-10-12  8:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-03 23:38 temp file hole? Stefan Monnier
2007-10-04 13:56 ` Michael Albinus
2007-10-04 14:37   ` Johan Bockgård
2007-10-04 14:49   ` Michael Albinus
2007-10-05  7:14   ` Ulrich Mueller
2007-10-05  8:29     ` Michael Albinus
2007-10-06 12:06     ` Michael Albinus
2007-10-12  8:12       ` Ulrich Mueller
2007-10-12  8:32         ` Michael Albinus
2007-10-05 13:15   ` Stefan Monnier
2007-10-06 10:12     ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.