Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 1999 15:02:00 +0200 (MET DST)
From:      Nick Hibma <nick.hibma@jrc.it>
To:        FreeBSD current mailing list <freebsd-current@freebsd.org>
Subject:   PR with patch, any takers?
Message-ID:  <Pine.GSO.3.95q.990713145456.6764I-100000@elect8>

next in thread | raw e-mail | index | archive | help

[PATCH] tempnam.c security problems


[Includes a patch, patch applies to tempnam.c from current]


Description

    The tempnam function has the security problem of trusting an
    environment variable, even when running setuid. While it might seem
    that using this function in a setuid/setgid program is insecure in
    and of itself due to the potential race condition between finding a
    file name and creating the file, open with the CREAT _and_ EXCL
    flags set solves this problem, at least for local filesystems. (Yes,
    the mkstemp function should be used instead, but software ported in
    from other OSes may not use this function.)

    The difficulty with trusting a user-set directory when this method
    (setting CREAT and EXCL) is used is that the directory in question
    could have permissions allowing the user to replace the file - a
    problem if the program closes the file then reopens it at a later
    point (perhaps to conserve file descriptors). It also poses the
    confidentiality hazard that the directory may be set to be in a
    msdos filesystem, so that the user can then examine the contents of
    the file.


Any takers? The PR has already been marked suspended by phk, but never
worked on.


   http://www.freebsd.org/cgi/query-pr.cgi?pr=6773

Nick

-- 
ISIS/STA, T.P.270, Joint Research Centre, 21020 Ispra, Italy




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.95q.990713145456.6764I-100000>