Perl 'rmtree()' Function... CVE-2008-2827 CNNVD-200806-316

4.6 AV AC AU C I A
发布: 2008-06-23
修订: 2017-08-08

Perl是一种免费且功能强大的编程语言。 Perl的lib/File/Path.pm文件中的rmtree函数在执行chmod时没有正确地检查权限: my $nperm = $perm & 07777 | 0600; if ($nperm != $perm and not chmod $nperm, $root) { if ($Force_Writeable) { _error($arg, "cannot make file writeable", $canon); } } 上述代码仅在尝试chmod后才测试$Force_Writeable变量,该变量用于定义在删除文件时操作系统是否需要写权限。当rmtree()遇到符号链接时,就会将链接目标的权限更改为链接的权限,通常为0777。 % touch foo % ln -s foo bar % ls -l foo bar lrwxrwxrwx 1 niko niko 3 2008-06-21 09:06 bar -> foo -rw-r--r-- 1 niko niko 0 2008-06-21 09:06 foo % perl -e 'use File::Path rmtree; rmtree bar' % ls -l foo bar ls: cannot access bar: No such file or directory -rwxrwxrwx 1 niko niko 0 2008-06-21 09:06 foo

0%
当前有4条漏洞利用/PoC
当前有1条受影响产品信息