Perl rmtree()函数本地不安全权限漏洞

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

BUGTRAQ ID: 29902 CVE(CAN) ID: CVE-2008-2827 Perl是一种免费且功能强大的编程语言。 Perl的lib/File/Path.pm文件中的rmtree函数在执行chmod时没有正确地检查权限: my $nperm = $perm &amp; 07777 | 0600; if ($nperm != $perm and not chmod $nperm, $root) { if ($Force_Writeable) { _error($arg, &quot;cannot make file writeable&quot;, $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 -&gt; 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 Larry Wall Perl 5.10 Larry Wall ---------- 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载: <a href=http://www.perl.org/ target=_blank>http://www.perl.org/</a>

0%
暂无可用Exp或PoC
当前有0条受影响产品信息