zsh-workers
 help / color / mirror / code / Atom feed
From: Simon Ruderich <simon@ruderich.org>
To: zsh-workers@zsh.org
Subject: Re: BUG: crafting SHELLOPTS and PS4 allows to run arbitrary programs in setuid binaries using system
Date: Wed, 28 Sep 2016 12:37:32 +0200	[thread overview]
Message-ID: <20160928103706.elmurtrr4pc5e2kw@ruderich.org> (raw)
In-Reply-To: <20160927100221.7d4f744f@pwslap01u.europe.root.pri>

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

On Tue, Sep 27, 2016 at 10:02:21AM +0100, Peter Stephenson wrote:
> I've attempted to tidy up the logic to the point where I think I
> understand it.  Does the test "(!getuid() || !geteuid())" make sense or
> should that be something else?

I don't see a reason why zsh running as root shouldn't import
these variables. Only when running in a setuid context possible
security issues arise (ignoring the fact that any setuid program
calling a shell is broken anyway because we will always miss some
env-variable which can be abused).

I think the test should be changed to getuid() != geteuid() or
similar to trigger only in setuid cases.

Regards
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  parent reply	other threads:[~2016-09-28 10:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27  6:59 Mateusz Lenik
2016-09-27  7:53 ` Daniel Shahaf
2016-09-27  8:43   ` Mateusz Lenik
2016-09-27  9:02   ` Peter Stephenson
2016-09-27 19:26     ` Bart Schaefer
2016-09-28 10:37     ` Simon Ruderich [this message]
2016-09-28 19:04       ` Bart Schaefer
2016-09-29 13:20       ` Peter Stephenson
2016-09-27  8:56 ` Oliver Kiddle
2016-09-27  9:28   ` Peter Stephenson

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=20160928103706.elmurtrr4pc5e2kw@ruderich.org \
    --to=simon@ruderich.org \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).