Arc不安全临时文件创建漏洞

Arc不安全临时文件创建漏洞

漏洞ID 1197653 漏洞类型 访问验证错误
发布时间 2005-10-13 更新时间 2005-10-25
图片[1]-Arc不安全临时文件创建漏洞-安全小百科CVE编号 CVE-2005-2992
图片[2]-Arc不安全临时文件创建漏洞-安全小百科CNNVD-ID CNNVD-200510-076
漏洞平台 N/A CVSS评分 2.1
|漏洞来源
https://cxsecurity.com/issue/WLB-2005090009
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200510-076
|漏洞详情
Arc5.21j之前版本允许本地用户借助临时文件上的symlink攻击,改写任意文件。
|漏洞EXP
#########################################################

arc insecure temporary file creation

Vendor:  http://arc.sourceforge.net/
Advisory: http://www.zataz.net/adviso/arc-09052005.txt
Vendor informed: yes
Exploit available: yes
Impact : low
Exploitation : low

#########################################################

The vulnerability is caused due to temporary file being created insecurely.
The temporary file used for archive creation could be read by untrusted 
users.

Secunia has reported that D1g1t4lLeech has discovered this bug the 
2005-09-16.

ZATAZ Audit has discovered this bug the 2005-09-05

D1g1t4lLeech you are a true Leecher ;)

##########
Versions:
##########

arc <= 5.21j

##########
Solution:
##########

No solutions

#########
Timeline:
#########

Discovered : 2005-09-05
Vendor notified : no time to report (Leech powa)
Vendor response : no reponse
Vendor fix : no patch
Vendor Sec report (vendor-sec (at) lst (dot) de [email concealed]) :
Disclosure : 2005-09-19

#####################
Technical details :
#####################

Vulnerable code :
-----------------

In arc.c :

210         /* see where temp files go */
211 #if     !_MTS
212         arctemp = calloc(1, STRLEN);
213         if (!(arctemp2 = envfind("ARCTEMP")))
214                 arctemp2 = envfind("TMPDIR");
215         if (arctemp2) {
216                 strcpy(arctemp, arctemp2);
217                 n = strlen(arctemp);
218                 if (arctemp[n - 1] != CUTOFF)
219                         arctemp[n] = CUTOFF;
220         }
221 #if     UNIX
222         else    strcpy(arctemp, "/tmp/");
223 #endif
224 #if     !MSDOS
225         {
226                 static char tempname[] = "AXXXXXX";
227                 strcat(arctemp, mktemp(tempname));
228         }
229 #else
230         strcat(arctemp, "$ARCTEMP");
231 #endif
232 #else
233         guinfo("SHFSEP  ", gotinf);
234         sepchr[0] = gotinf[0];
235         guinfo("SCRFCHAR", gotinf);
236         tmpchr[0] = gotinf[0];
237         arctemp = "-$$$";
238         arctemp[0] = tmpchr[0];
239 #endif
240         arctemp2 = NULL;
241
242 #if     !UNIX
243         /* avoid any case problems with arguments */
244
245         for (n = 1; n < num; n++)       /* for each argument */
246                 upper(arg[n]);  /* convert it to uppercase */
247 #else
248         /* avoid case problems with command options */
249         upper(arg[1]);          /* convert to uppercase */
250 #endif
251
252         /* create archive names, supplying defaults */
253 #if     UNIX
254         if (!stat(arg[2],&sbuf)) {
255                 if ((sbuf.st_mode & S_IFMT) == S_IFDIR)
256                         makefnam(arg[2],".arc",arcname);
257                 else
258                         strcpy(arcname,arg[2]);
259         } else
260                 makefnam(arg[2],".arc",arcname);
261 #else
262         makefnam(arg[2], ".ARC", arcname);
263 #endif

Take a look on a the right off temporary files in /tmp :

-rw-r--r--   1 root root       1564 Sep  5 10:28 A3C6Zs4.arc

The file should not be world readable.

The same problem for marc.c

#########
Related :
#########

Bug report :
CVE :

#####################
Credits :
#####################

Eric Romang (eromang (at) zataz (dot) net [email concealed] - ZATAZ Audit)
Thxs to Gentoo Security Team. (Taviso, jaervosz, solar, Koon, etc.)
|参考资料

来源:DEBIAN
名称:DSA-843
链接:http://www.debian.org/security/2005/dsa-843
来源:SECUNIA
名称:16805
链接:http://secunia.com/advisories/16805
来源:FULLDISC
名称:20050920Re:arcinsecuretemporaryfilecreation
链接:http://archives.neohapsis.com/archives/fulldisclosure/2005-09/0535.html
来源:BUGTRAQ
名称:20050916arcinsecuretemporaryfilecreation
链接:http://marc.theaimsgroup.com/?l=bugtraq&m;=112689596714383&w;=2
来源:SREASON
名称:11
链接:http://securityreason.com/securityalert/11
来源:SECUNIA
名称:17068
链接:http://secunia.com/advisories/17068

相关推荐: Dino Webserver服务器远程目录遍历漏洞

Dino Webserver服务器远程目录遍历漏洞 漏洞ID 1204851 漏洞类型 未知 发布时间 2002-01-09 更新时间 2005-05-02 CVE编号 CVE-2002-0111 CNNVD-ID CNNVD-200203-072 漏洞平台 …

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享