CVE-1999-1471
CVSS7.2
发布时间 :1989-01-01 00:00:00
修订时间 :2008-09-05 16:19:36
NMCOS    

[原文]Buffer overflow in passwd in BSD based operating systems 4.3 and earlier allows local users to gain root privileges by specifying a long shell or GECOS field.


[CNNVD]BSD passwd缓冲区溢出漏洞(CNNVD-198901-001)

        基于BSD操作系统4.3以及早期版本中的passwd存在缓冲区溢出漏洞。本地用户通过指定一个超长shell或者GECOS字段提升根特权。

- CVSS (基础分值)

CVSS分值: 7.2 [严重(HIGH)]
机密性影响: COMPLETE [完全的信息泄露导致所有系统文件暴露]
完整性影响: COMPLETE [系统完整性可被完全破坏]
可用性影响: COMPLETE [可能导致系统完全宕机]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: LOCAL [漏洞利用需要具有物理访问权限或本地帐户]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

cpe:/o:bsd:bsd:4.3
cpe:/o:bsd:bsd:4.2

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-1471
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-1999-1471
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-198901-001
(官方数据源) CNNVD

- 其它链接及资源

http://www.cert.org/advisories/CA-1989-01.html
(VENDOR_ADVISORY)  CERT  CA-1989-01
http://www.securityfocus.com/bid/4
(VENDOR_ADVISORY)  BID  4
http://www.iss.net/security_center/static/7152.php
(UNKNOWN)  XF  bsd-passwd-bo(7152)

- 漏洞信息

BSD passwd缓冲区溢出漏洞
高危 缓冲区溢出
1989-01-01 00:00:00 2005-10-20 00:00:00
本地  
        基于BSD操作系统4.3以及早期版本中的passwd存在缓冲区溢出漏洞。本地用户通过指定一个超长shell或者GECOS字段提升根特权。

- 公告与补丁

        Apply the following patch to the file src/bin/passwd.c and
         recompile/reinstall it.
        *** passwd.c.orig Wed Dec 21 08:57:41 1988
        - --- passwd.c Wed Dec 21 09:00:25 1988
        ***************
        *** 332,337 ****
        - --- 332,339 ----
         return (crypt(pwbuf, saltc));
         }
        + #define STRSIZE 100
        +
         char *
         getloginshell(pwd, u, arg)
         struct passwd *pwd;
        ***************
        *** 338,344 ****
         int u;
         char *arg;
         {
        ! static char newshell[BUFSIZ];
         char *cp, *valid, *getusershell();
         if (pwd->pw_shell == 0 || *pwd->pw_shell == '\0')
        - --- 340,346 ----
         int u;
         char *arg;
         {
        ! static char newshell[STRSIZE];
         char *cp, *valid, *getusershell();
         if (pwd->pw_shell == 0 || *pwd->pw_shell == '\0')
        ***************
        *** 415,423 ****
         getfingerinfo(pwd)
         struct passwd *pwd;
         {
        ! char in_str[BUFSIZ];
         struct default_values *defaults, *get_defaults();
        ! static char answer[4*BUFSIZ];
         answer[0] = '\0';
         defaults = get_defaults(pwd->pw_gecos);
        - --- 417,425 ----
         getfingerinfo(pwd)
         struct passwd *pwd;
         {
        ! char in_str[STRSIZE];
         struct default_values *defaults, *get_defaults();
        ! static char answer[4*STRSIZE];
         answer[0] = '\0';
         defaults = get_defaults(pwd->pw_gecos);
        ***************
        *** 429,435 ****
         */
         do {
         printf("\nName []: ", defaults->name);
        ! (void) fgets(in_str, BUFSIZ, stdin);
         if (special_case(in_str, defaults->name))
         break;
         } while (illegal_input(in_str));
        - --- 431,437 ----
         */
         do {
         printf("\nName []: ", defaults->name);
        ! (void) fgets(in_str, STRSIZE, stdin);
         if (special_case(in_str, defaults->name))
         break;
         } while (illegal_input(in_str));
        ***************
        *** 440,446 ****
         do {
         printf("Room number (Exs: 597E or 197C) []: ",
         defaults->office_num);
        ! (void) fgets(in_str, BUFSIZ, stdin);
         if (special_case(in_str, defaults->office_num))
         break;
         } while (illegal_input(in_str) || illegal_building(in_str));
        - --- 442,448 ----
         do {
         printf("Room number (Exs: 597E or 197C) []: ",
         defaults->office_num);
        ! (void) fgets(in_str, STRSIZE, stdin);
         if (special_case(in_str, defaults->office_num))
         break;
         } while (illegal_input(in_str) || illegal_building(in_str));
        ***************
        *** 452,458 ****
         do {
         printf("Office Phone (Ex: 6426000) []: ",
         defaults->office_phone);
        ! (void) fgets(in_str, BUFSIZ, stdin);
         if (special_case(in_str, defaults->office_phone))
         break;
         remove_hyphens(in_str);
        - --- 454,460 ----
         do {
         printf("Office Phone (Ex: 6426000) []: ",
         defaults->office_phone);
        ! (void) fgets(in_str, STRSIZE, stdin);
         if (special_case(in_str, defaults->office_phone))
         break;
         remove_hyphens(in_str);
        ***************
        *** 464,470 ****
         */
         do {
         printf("Home Phone (Ex: 9875432) []: ", defaults->home_phone);
        ! (void) fgets(in_str, BUFSIZ, stdin);
         if (special_case(in_str, defaults->home_phone))
         break;
         remove_hyphens(in_str);
        - --- 466,472 ----
         */
         do {
         printf("Home Phone (Ex: 9875432) []: ", defaults->home_phone);
        ! (void) fgets(in_str, STRSIZE, stdin);
         if (special_case(in_str, defaults->home_phone))
         break;
         remove_hyphens(in_str);
        ***************
        *** 501,507 ****
         if (input_str[length-1] != '\n') {
         /* the newline and the '\0' eat up two characters */
         printf("Maximum number of characters allowed is %d\n",
        ! BUFSIZ-2);
         /* flush the rest of the input line */
         while (getchar() != '\n')
         /* void */;
        - --- 503,509 ----
         if (input_str[length-1] != '\n') {
         /* the newline and the '\0' eat up two characters */
         printf("Maximum number of characters allowed is %d\n",
        ! STRSIZE-2);
         /* flush the rest of the input line */
         while (getchar() != '\n')
         /* void */;

- 漏洞信息

5849
BSD passwd Multiple Field Local Overflow
Local Access Required Input Manipulation
Loss of Integrity

- 漏洞描述

A local overflow exists in BSD. The passwd program fails to check bounds on a long shell or GECOS field causing a buffer overflow. With a specially crafted request, an attacker can change the flow of execution to gain root privileges, which will result in a loss of integrity.

- 时间线

1988-12-01 Unknow
Unknow Unknow

- 解决方案

Currently, there are no known workarounds or upgrades to correct this issue. However, Keith Bostic has released an unofficial patch to address this vulnerability.

- 相关参考

- 漏洞作者

- 漏洞信息

BSD passwd buffer overflow Vulnerability
Boundary Condition Error 4
No No
1988-12-21 12:00:00 2009-07-11 12:16:00

- 受影响的程序版本

BSD BSD 4.3
BSD BSD 4.2

- 漏洞讨论

The passwd program be used to change an users GECOS
field and shell. When used in this way the password program
will allow the new shell or GECOS field to be longer than
BUFSIZ. This will cause programs that read records of
the password file and stores them in BUFSIZ buffers to
overflow their buffers.

This problem also exists in some Berkeley derived systems.

- 漏洞利用

Currently the SecurityFocus staff are not aware of any exploits for this issue. If you feel we are in error or are aware of more recent information, please mail us at: vuldb@securityfocus.com.

- 解决方案

Apply the following patch to the file src/bin/passwd.c and
recompile/reinstall it.

*** passwd.c.orig Wed Dec 21 08:57:41 1988
- --- passwd.c Wed Dec 21 09:00:25 1988
***************
*** 332,337 ****
- --- 332,339 ----
return (crypt(pwbuf, saltc));
}

+ #define STRSIZE 100
+
char *
getloginshell(pwd, u, arg)
struct passwd *pwd;
***************
*** 338,344 ****
int u;
char *arg;
{
! static char newshell[BUFSIZ];
char *cp, *valid, *getusershell();

if (pwd->pw_shell == 0 || *pwd->pw_shell == '\0')
- --- 340,346 ----
int u;
char *arg;
{
! static char newshell[STRSIZE];
char *cp, *valid, *getusershell();

if (pwd->pw_shell == 0 || *pwd->pw_shell == '\0')
***************
*** 415,423 ****
getfingerinfo(pwd)
struct passwd *pwd;
{
! char in_str[BUFSIZ];
struct default_values *defaults, *get_defaults();
! static char answer[4*BUFSIZ];

answer[0] = '\0';
defaults = get_defaults(pwd->pw_gecos);
- --- 417,425 ----
getfingerinfo(pwd)
struct passwd *pwd;
{
! char in_str[STRSIZE];
struct default_values *defaults, *get_defaults();
! static char answer[4*STRSIZE];

answer[0] = '\0';
defaults = get_defaults(pwd->pw_gecos);
***************
*** 429,435 ****
*/
do {
printf("\nName [%s]: ", defaults->name);
! (void) fgets(in_str, BUFSIZ, stdin);
if (special_case(in_str, defaults->name))
break;
} while (illegal_input(in_str));
- --- 431,437 ----
*/
do {
printf("\nName [%s]: ", defaults->name);
! (void) fgets(in_str, STRSIZE, stdin);
if (special_case(in_str, defaults->name))
break;
} while (illegal_input(in_str));
***************
*** 440,446 ****
do {
printf("Room number (Exs: 597E or 197C) [%s]: ",
defaults->office_num);
! (void) fgets(in_str, BUFSIZ, stdin);
if (special_case(in_str, defaults->office_num))
break;
} while (illegal_input(in_str) || illegal_building(in_str));
- --- 442,448 ----
do {
printf("Room number (Exs: 597E or 197C) [%s]: ",
defaults->office_num);
! (void) fgets(in_str, STRSIZE, stdin);
if (special_case(in_str, defaults->office_num))
break;
} while (illegal_input(in_str) || illegal_building(in_str));
***************
*** 452,458 ****
do {
printf("Office Phone (Ex: 6426000) [%s]: ",
defaults->office_phone);
! (void) fgets(in_str, BUFSIZ, stdin);
if (special_case(in_str, defaults->office_phone))
break;
remove_hyphens(in_str);
- --- 454,460 ----
do {
printf("Office Phone (Ex: 6426000) [%s]: ",
defaults->office_phone);
! (void) fgets(in_str, STRSIZE, stdin);
if (special_case(in_str, defaults->office_phone))
break;
remove_hyphens(in_str);
***************
*** 464,470 ****
*/
do {
printf("Home Phone (Ex: 9875432) [%s]: ", defaults->home_phone);
! (void) fgets(in_str, BUFSIZ, stdin);
if (special_case(in_str, defaults->home_phone))
break;
remove_hyphens(in_str);
- --- 466,472 ----
*/
do {
printf("Home Phone (Ex: 9875432) [%s]: ", defaults->home_phone);
! (void) fgets(in_str, STRSIZE, stdin);
if (special_case(in_str, defaults->home_phone))
break;
remove_hyphens(in_str);
***************
*** 501,507 ****
if (input_str[length-1] != '\n') {
/* the newline and the '\0' eat up two characters */
printf("Maximum number of characters allowed is %d\n",
! BUFSIZ-2);
/* flush the rest of the input line */
while (getchar() != '\n')
/* void */;
- --- 503,509 ----
if (input_str[length-1] != '\n') {
/* the newline and the '\0' eat up two characters */
printf("Maximum number of characters allowed is %d\n",
! STRSIZE-2);
/* flush the rest of the input line */
while (getchar() != '\n')
/* void */;

- 相关参考

     

     

    关于SCAP中文社区

    SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

    版权声明

    CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站