From nick@milla.ask33.net  Fri Jul 12 03:29:38 2002
Return-Path: <nick@milla.ask33.net>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A2A6437B400
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Jul 2002 03:29:38 -0700 (PDT)
Received: from milla.ask33.net (milla.ask33.net [217.197.166.60])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A4C4C43E58
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Jul 2002 03:29:37 -0700 (PDT)
	(envelope-from nick@milla.ask33.net)
Received: by milla.ask33.net (Postfix, from userid 1001)
	id E13603ABB4D; Fri, 12 Jul 2002 12:30:12 +0200 (CEST)
Message-Id: <20020712103012.E13603ABB4D@milla.ask33.net>
Date: Fri, 12 Jul 2002 12:30:12 +0200 (CEST)
From: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
Reply-To: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
To: FreeBSD-gnats-submit@freebsd.org
Cc: nick@garage.freebsd.pl, zaks@prioris.mini.pw.edu.pl
Subject: Buffer overflow in /usr/src/usr.sbin/vipw/pw_util.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         40478
>Category:       bin
>Synopsis:       Buffer overflow in /usr/src/usr.sbin/vipw/pw_util.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 12 03:30:05 PDT 2002
>Closed-Date:    Sat Jul 13 14:45:43 PDT 2002
>Last-Modified:  Sat Jul 13 14:46:30 PDT 2002
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
	There is a buffer overflow in /usr/src/usr.sbin/vipw/pw_util.c in
	function pw_tmp(), but it can't be sploitable as long as
	_PATH_MASTERPASSWD (defined in /usr/src/include/pwd.h) is no longer
	that MAXPATHLEN (defined in /usr/src/sys/sys/param.h). This bug have
	all aplications from this list:
	/usr/bin/passwd
	/usr/bin/chsh
	/usr/bin/chpass
	/usr/bin/chfn
	/usr/sbin/vipw
	(4 of those 5 are set-uid-root by default)
>How-To-Repeat:
>Fix:
	Here You got a little patch:


12 Lip 12:07 2002 diff -lu pw_util.c.orig pw_util.c Page 1


--- pw_util.c.orig	Fri Jul 12 12:06:45 2002
+++ pw_util.c	Fri Jul 12 12:07:25 2002
@@ -149,7 +149,7 @@
 	char *p;
 
 	strncpy(path, masterpasswd, MAXPATHLEN - 1);
-	path[MAXPATHLEN] = '\0';
+	path[MAXPATHLEN - 1] = '\0';
 
 	if ((p = strrchr(path, '/')))
 		++p;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: keramida 
State-Changed-When: Sat Jul 13 14:45:28 PDT 2002 
State-Changed-Why:  
Superseded by bin/40492. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40478 
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Sat Jul 13 14:45:53 PDT 2002 
Responsible-Changed-Why:  
This belongs to freebsd-bugs under bin/* even though it's closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40478 
>Unformatted:
