From proff@profane.iq.org  Sat Jan 25 08:46:31 1997
Received: from profane.iq.org (profane.iq.org [203.4.184.217])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA07845;
          Sat, 25 Jan 1997 08:46:19 -0800 (PST)
Received: (from proff@localhost)
          by profane.iq.org (8.8.4/8.8.2) id DAA13323;
          Sun, 26 Jan 1997 03:46:45 +1100 (EST)
Message-Id: <199701251646.DAA13323@profane.iq.org>
Date: Sun, 26 Jan 1997 03:46:45 +1100 (EST)
From: Julian Assange <proff@iq.org>
Reply-To: proff@iq.org
To: FreeBSD-gnats-submit@freebsd.org, dyson@freebsd.org
Subject: security hole in lib/libc/nls/msgcat.c
X-Send-Pr-Version: 3.2

>Number:         2582
>Category:       bin
>Synopsis:       security hole in lib/libc/nls/msgcat.c
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    imp
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 25 08:50:01 PST 1997
>Closed-Date:    Sun Mar 23 23:15:18 MST 1997
>Last-Modified:  Sun Mar 23 23:15:43 MST 1997
>Originator:     Julian Assange
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	

>Description:

	exploitable stack over-run in catopen(3)

	

>How-To-Repeat:

	

>Fix:
	
	

	ignore env if [gu]id!=e[gu]id

--- src/lib/libc/nls/msgcat.c.orig	Sun Jan 26 03:15:25 1997
+++ src/lib/libc/nls/msgcat.c	Sun Jan 26 03:19:52 1997
@@ -99,8 +99,8 @@
 	catpath = name;
 	if (stat(catpath, &sbuf)) return(0);
     } else {
-	if ((lang = (char *) getenv("LANG")) == NULL) lang = "C";
-	if ((nlspath = (char *) getenv("NLSPATH")) == NULL) {
+	if ((lang = (char *) getenv("LANG")) == NULL || getuid() != geteuid() || getgid() != getegid()) lang = "C";
+	if ((nlspath = (char *) getenv("NLSPATH")) == NULL || getuid() != geteuid() || getgid() != getegid()) {
 	    nlspath = "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L";
 	}
 
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Sat Jan 25 23:11:50 PST 1997 
Responsible-Changed-Why:  
Misfiled PR. 
Responsible-Changed-From-To: freebsd-bugs->freebsd-bugs 
Responsible-Changed-By: fenner 
Responsible-Changed-When: Mon Jan 27 10:31:52 PST 1997 
Responsible-Changed-Why:  
It didn't. 
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: imp 
Responsible-Changed-When: Sat Feb 8 23:41:53 MST 1997 
Responsible-Changed-Why:  
I'm going to fix this 
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Sun Mar 23 23:15:18 MST 1997 
State-Changed-Why:  

fixed in msgcat.c 1.8 
>Unformatted:
