Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 06 Oct 2014 18:58:12 +0200
From: Florian Weimer <fweimer@...hat.com>
To: oss-security@...ts.openwall.com
Subject: Re: Healing the bash fork

On 09/30/2014 05:02 PM, Mark R Bannister wrote:
> Glad my over-simplified example has raised a few smirks.  Now for a slightly less simplified version:
>
> putenv("PATH=/bin:/usr/bin");
> setreuid(0, 0);
> system("date");
>
> But the point is I've tried to boil down a relatively complex program by studying endless strace outputs to attempt to demonstrate a real world exploit.  It wasn't actually "date" that was being called, but you get the point.
>
> In the past, i.e. pre-Shellshock, the above code may have raised eyebrows, but as PATH was sanitised it would have passed numerous security audits.

I doubt that (or more realistically, I hope it's not true).  Even the 
1996 edition of “Practical UNIX and Internet Security” mentions that you 
have to reset IFS as well (a significant omission if “at” does something 
even if it hasn't received any parameters).  The authors also point out 
that putenv and setenv may only replace the first occurrence of an 
environment variable in the environ array, while the system shell could 
well pick up the last occurrence.

-- 
Florian Weimer / Red Hat Product Security

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.