[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oss-security
Subject:    Re: [oss-security] pam_timestamp internals
From:       Sebastian Krahmer <krahmer () suse ! de>
Date:       2014-03-31 11:53:07
Message-ID: 20140331115307.GC8904 () suse ! de
[Download RAW message or body]

Hi

On Mon, Mar 31, 2014 at 03:37:02PM +0400, Dmitry V. Levin wrote:
> On Mon, Mar 31, 2014 at 12:57:11PM +0200, Sebastian Krahmer wrote:
> > On Mon, Mar 31, 2014 at 02:32:09PM +0400, Dmitry V. Levin wrote:
> > > On Mon, Mar 24, 2014 at 01:46:43PM +0100, Sebastian Krahmer wrote:
> > > > When playing with some PAM modules for my own projects, I came
> > > > across some implications of pam_timestamp (which is part of
> > > > upstream linux-pam) that should probably be addressed.
> > > > 
> > > > Most importantly, there seems to be a path traversal issue:
> > > 
> > > Thanks, Sebastian!  The issue has been fixed in upstream linux-pam by commit
> > > https://git.fedorahosted.org/cgit/linux-pam.git/commit/?id=Linux-PAM-1_1_8-32-g9dcead8
> > 
> > Thanks for taking care. I was about to write a patch on my own, but seems
> > not necessary anymore.
> > 
> > However, I think that
> > 
> > +	if (!strlen(tty) || !strcmp(tty, ".") || !strcmp(tty, "..")) {
> > 
> > could be insufficient.
> 
> There is a code in check_tty() that handles '/':
> 	if (strchr(tty, '/') != NULL) {
> 		...
> 		tty = strrchr(tty, '/') + 1;
> 	}

Ok, I was missing this; so it makes sense to just use strcmp().

> 
> > Any occurence of "." inside tty name should be evil.
> 
> Strange - yes, but why evil?

Any strange input in authentication code considered evil. :)

thx,
Sebastian


-- 

~ perl self.pl
~ $_='print"\$_=\47$_\47;eval"';eval
~ krahmer@suse.de - SuSE Security Team

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic