GNU bug report logs -
#27986
26.0.50; `rename-file' can rename files without confirmation
Previous Next
Reported by: Philipp <p.stephani2 <at> gmail.com>
Date: Sun, 6 Aug 2017 15:41:02 UTC
Severity: important
Tags: security
Found in version 26.0.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #88 received at 27986 <at> debbugs.gnu.org (full text, mbox):
> Cc: p.stephani2 <at> gmail.com, 27986 <at> debbugs.gnu.org
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Tue, 15 Aug 2017 12:27:52 -0700
>
> Eli Zaretskii wrote:
>
> > How would they know to create B before Emacs issues any system call
> > that uses B?
>
> Because the attackers know how Emacs work and are attempting to exploit its
> security hole.
Knowing how Emacs works is not enough: they need to actually know the
name of the directory to create, and I don't see how they can do that
without seeing some system call which names that directory.
> > And how is this case different from the case that Emacs calls
> > (rename-file A B) thinking B doesn't exist (e.g., because some prior
> > code tested that)?
>
> The case in question trashes a directory that the attacker lacks permission to.
> The case you're talking about does not: it merely causes rename-file to fail.
No, it's the same use case. In both of them the attacker creates a
directory ahead of Emacs using it in some system call.
> Another possibility is to implement new functions (say: file-copy, file-rename,
> file-link, file-symlink, and directory-copy) that behave like the existing
> functions except without the security hole, modify callers to use these new
> functions, and then mark the existing functions as deprecated due to security
> concerns.
If no other solution is possible, maybe this is what we should do. If
we decide to go that way, we should also decide what to do with the
interactive use of those functions: whether to call the old or the new
variant, because we need to keep backward compatibility there as well.
If we decide to use the old variants, deprecation might not be the
right mechanism for promoting the new variants.
> I suspect that this would be more disruptive overall than the proposed
> change, though (albeit disruptive in a different way).
How so?
This bug report was last modified 7 years and 257 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.