当前位置: 安全纵横 > 安全公告

erl rmdir()函数本地竞争条件漏洞

受影响系统:
Larry Wall Perl 5.8.8
Larry Wall Perl 5.10
描述:

Perl是一种免费且功能强大的编程语言。

Perl的lib/File/Path.pm模块中的rmtree函数存在竞争条件错误:

   170          (undef, undef, my $rp) = lstat $root or next;
   171          $rp &= 07777;   # don't forget setuid, setgid, sticky bits
   172          if ( -d _ ) {
   ...
   209              if (rmdir $root) {
   210                  ++$count;
   211              }
   212              else {
   213                  carp "Can't remove directory $root: $!";
   214                  chmod($rp, ($Is_VMS ? VMS::Filespec::fileify($root) : $root))
   215                      or carp("and can't restore permissions to "
   216                              . sprintf("0%o",$rp) . "\n");
   217              }
   218          }
   ...

本地攻击者可以通过符号链接攻击创建任意setuid二进制程序。

厂商补丁:

Debian
------
Debian已经为此发布了一个安全公告(DSA-1678-1)以及相应补丁:
DSA-1678-1:New perl packages fix privilege escalation
链接:http://www.debian.org/security/2008/dsa-1678

补丁下载:

Source archives:

http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5.dsc
Size/MD5 checksum:      750 a57837967b7420057558cab7efca9202
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8.orig.tar.gz
Size/MD5 checksum: 12829188 b8c118d4360846829beb30b02a6b91a7
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5.diff.gz
Size/MD5 checksum:   105052 cfd4c3d27c5a7a342c441383867dae89

Architecture independent packages:

http://security.debian.org/pool/updates/main/p/perl/libcgi-fast-perl_5.8.8-7etch5_all.deb
Size/MD5 checksum:    41082 9dfa8758852aadcaadb2edbdfa17f942
http://security.debian.org/pool/updates/main/p/perl/perl-doc_5.8.8-7etch5_all.deb
Size/MD5 checksum:  7378812 3baade38d4a703ae7db0e2f7d7b2df62
http://security.debian.org/pool/updates/main/p/perl/perl-modules_5.8.8-7etch5_all.deb
Size/MD5 checksum:  2316518 dc45e7d6fbedf992db42f31326457df2

alpha architecture (DEC Alpha)

http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_alpha.deb
Size/MD5 checksum:  4150162 345ac6cfebda2d2e6807a1dc0e14957c
http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_alpha.deb
Size/MD5 checksum:     1006 f010eb97c3f81b2958c7546ba69296eb
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_alpha.deb
Size/MD5 checksum:  2928894 52f0aa7e688e63cd4d487a6492d9ee2e
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_alpha.deb
Size/MD5 checksum:    36236 eb16c8490e1e164ef6444f4b7680fbc6
http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_alpha.deb
Size/MD5 checksum:   821796 d48d9e6f1a07eafdc6acb6d990cf1fbc
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_alpha.deb
Size/MD5 checksum:   880174 f32a7823fd919ada981b3eda1abe6a70

amd64 architecture (AMD x86_64 (AMD64))

http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_amd64.deb
Size/MD5 checksum:   630776 4f134545671885f476770a9da3695301
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_amd64.deb
Size/MD5 checksum:   806610 02ed83b2872342eb732c0179daa52869
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_amd64.deb
Size/MD5 checksum:    32774 4db9f5a96272f4a561abadbc3a1ed175
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_amd64.deb
Size/MD5 checksum:  4248964 b09695271b26cb6b6245a791e9e7122d
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_amd64.deb
Size/MD5 checksum:  2735132 c8bb2c571273b1ef47beb05874ae4277
http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_amd64.deb
Size/MD5 checksum:     1010 4223d65b463272ca026ee7e7d7d0ff02

arm architecture (ARM)

http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_arm.deb
Size/MD5 checksum:     1008 fd5146b7fceeb55c7ba16831e95f0b4a
http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_arm.deb
Size/MD5 checksum:   562112 24fe7aacf39d42673555f228e6edd5d7
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_arm.deb
Size/MD5 checksum:    30338 57ce7264534de68fe870e72eaae6a186
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_arm.deb
Size/MD5 checksum:  3410084 382ee29a48541e9270cb20926ff2c58a
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_arm.deb
Size/MD5 checksum:   760136 6939901d705dbdac94e959ebab73d32a
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_arm.deb
Size/MD5 checksum:  2548202 07796362a684d112be9dbea0ff5a2ab5

i386 architecture (Intel ia32)

http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_i386.deb
Size/MD5 checksum:  3589118 bdcb99ed51d06b1639d98a661ce42d58
http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_i386.deb
Size/MD5 checksum:   527162 c511226a2cbddb98a170c8f563d6670a
http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_i386.deb
Size/MD5 checksum:   585396 f3f34d325de643667d4c12f897a15f48
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_i386.deb
Size/MD5 checksum:    32070 59d70d1ee4f0e7584230095ca079ceb7
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_i386.deb
Size/MD5 checksum:  2491980 7149381d9862cc1ebd20092fae76dda9
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_i386.deb
Size/MD5 checksum:   762200 40254226d8ae5963a908661350816f0c

ia64 architecture (Intel ia64)

http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_ia64.deb
Size/MD5 checksum:   978092 e856d5880b7b4c26222a3e0a3e0e0610
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_ia64.deb
Size/MD5 checksum:  3364496 8248ac1db0819b45b0ea5bf2ba748f6f
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_ia64.deb
Size/MD5 checksum:  1154060 3ff9faa1f05b380c486a86f79e7993a0
http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_ia64.deb
Size/MD5 checksum:     1008 ce21fdde9f6a971ab9bb950d5a4f8846
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_ia64.deb
Size/MD5 checksum:    51272 85acec2cd9ad024ec30e00a5af6f5ccb
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_ia64.deb
Size/MD5 checksum:  4336594 d4756a2b2de75f43cdb2f8ff4ccc0566

mips architecture (MIPS (Big Endian))

http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_mips.deb
Size/MD5 checksum:  2782132 4999312ae9a1844b4d475f34d312d334
http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_mips.deb
Size/MD5 checksum:   694018 e974c764d6a3350e7425cf5990f02201
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_mips.deb
Size/MD5 checksum:  3678988 94244c7432977a979063076fc67bbf29
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_mips.deb
Size/MD5 checksum:    32216 cacc1e6e5d2649606ddccc99a9f09ebd
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_mips.deb
Size/MD5 checksum:   786110 1713743185beb6ddc6de091ed4a7a0e5
http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_mips.deb
Size/MD5 checksum:     1008 905da3949be11e01942cb096f279cd63

powerpc architecture (PowerPC)

http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_powerpc.deb
Size/MD5 checksum:   653440 4ccf1e83f3159d64262c9d30506e151a
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_powerpc.deb
Size/MD5 checksum:  2710130 036b5620a814a6443d173a1a5f62a051
http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_powerpc.deb
Size/MD5 checksum:     1012 3bf894f640eeb63b15a997dbb1e06a63
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_powerpc.deb
Size/MD5 checksum:    32908 bb7ccbed135a9625df993587576fbcf6
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_powerpc.deb
Size/MD5 checksum:   811032 6ea8cf13343916db0f3e46c759f448da
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_powerpc.deb
Size/MD5 checksum:  3824810 5864271ba481be6308ab9e704c2454c1

s390 architecture (IBM S/390)

http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_s390.deb
Size/MD5 checksum:   823642 682e9f9fb581af9cc0aa9860c2747eba
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_s390.deb
Size/MD5 checksum:    33108 311441a02f7965c21790d988b63879c6
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_s390.deb
Size/MD5 checksum:  2796658 3b4c21061de13bec62299cfda17c21a8
http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_s390.deb
Size/MD5 checksum:     1008 201b45bdbf264748d665b789e501e2c9
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_s390.deb
Size/MD5 checksum:  4100050 c2348e4c49820501d30e3736bb60e442
http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_s390.deb
Size/MD5 checksum:   633612 6d818da26553af14a4479a23731ea8b0

sparc architecture (Sun SPARC/UltraSPARC)

http://security.debian.org/pool/updates/main/p/perl/libperl5.8_5.8.8-7etch5_sparc.deb
Size/MD5 checksum:     1014 bd9f92414f3d44f15efa2c8b25fd39d9
http://security.debian.org/pool/updates/main/p/perl/perl_5.8.8-7etch5_sparc.deb
Size/MD5 checksum:  3796714 95538b186d68bd25eec0dd3a27fe1447
http://security.debian.org/pool/updates/main/p/perl/perl-base_5.8.8-7etch5_sparc.deb
Size/MD5 checksum:   783702 e07757e74203c7c8eec5f2db41051bc4
http://security.debian.org/pool/updates/main/p/perl/perl-suid_5.8.8-7etch5_sparc.deb
Size/MD5 checksum:    31056 d0ead72ea7bb47971f638ef7aee22705
http://security.debian.org/pool/updates/main/p/perl/perl-debug_5.8.8-7etch5_sparc.deb
Size/MD5 checksum:  2565984 253cc0540fbaead2b39bbcf9dda3ab96
http://security.debian.org/pool/updates/main/p/perl/libperl-dev_5.8.8-7etch5_sparc.deb
Size/MD5 checksum:   594486 85b2168a8092deadace3044f51ebd20a

补丁安装方法:

1. 手工安装补丁包:

  首先,使用下面的命令来下载补丁软件:
  # wget url  (url是补丁下载链接地址)

  然后,使用下面的命令来安装补丁:  
  # dpkg -i file.deb (file是相应的补丁名)

2. 使用apt-get自动安装补丁包:

   首先,使用下面的命令更新内部数据库:
   # apt-get update
  
   然后,使用下面的命令安装更新软件包:
   # apt-get upgrade

Larry Wall
----------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://download.fedoralegacy.org/fedora/1/updates/i386/perl-5.8.3-17.4.legacy.i386.rpm

RedHat
------
RedHat已经为此发布了一个安全公告(RHSA-2005:674-01)以及相应补丁:
RHSA-2005:674-01:Low: perl security update
链接:http://lwn.net/Alerts/154618/?format=printable

补丁下载:

Red Hat Enterprise Linux AS version 4:

SRPMS:
ftp://updates.redhat.com/enterprise/4AS/en/os/SRPMS/perl-...
680ce92a9da6cccf344e1b13123d9aaa  perl-5.8.5-16.RHEL4.src.rpm

i386:
9ec1570c81d4034b22e5b4e10d1b9e18  perl-5.8.5-16.RHEL4.i386.rpm
cfe9e85adc4c8faa977e56f3ff06abd3  perl-suidperl-5.8.5-16.RHEL4.i386.rpm

ia64:
453283cb6c5d392580a318ddf0a5fbb5  perl-5.8.5-16.RHEL4.ia64.rpm
9f01a4ef79fc601ac34892d5df64a7a4  perl-suidperl-5.8.5-16.RHEL4.ia64.rpm

ppc:
89dad8dbc4dc1ca219ad353c0ebce105  perl-5.8.5-16.RHEL4.ppc.rpm
d768e18d710ed0ddf9ff928cd7b62991  perl-suidperl-5.8.5-16.RHEL4.ppc.rpm

s390:
d2b9782e99e123ada2a42c0719d