Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 16 Sep 2016 14:49:11 -0400
From: Chet Ramey <chet.ramey@...e.edu>
To: Jan Schaumann <jschauma@...meister.org>, oss-security@...ts.openwall.com
Cc: chet.ramey@...e.edu
Subject: Re: CVE-2016-0634 -- bash prompt expanding $HOSTNAME

On 9/16/16 1:38 PM, Jan Schaumann wrote:
> John Haxby <john.haxby@...cle.com> wrote:

(I didn't get this message.)

>> A little while ago, one of our users discovered that by setting the
>> hostname to $(something unpleasant), bash would run "something
>> unpleasant" when it expanded \h in the prompt string.

This issue has been public since October, 2015 in Ubuntu's bug tracking
system.


> To clarify: this is only triggered if the hostname has been set, not the
> $HOSTNAME variable, right?

Bash doesn't use $HOSTNAME; it sets it if it's not already set.  The
shell's idea of the current hostname is set using gethostname().  If
gethostname() fails, the hostname gets set to "??host??".  The \h
prompt expansion uses the shell's idea of the current hostname.

If your privileged application (either a user with privilege or a hostname-
setting agent) allows the hostname to be set to any arbitrary string of
characters, you're going to have problems regardless.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@...e.edu    http://cnswww.cns.cwru.edu/~chet/

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.