Perl:为什么。在Debian 9中不再是@INC的一部分了吗?

时间:2017-02-07 12:26:24

标签: perl debian

在安装Debian 9时,我发现.不再是@INC的一部分了。

为x86_64-linux-gnu-thread-multi构建的Perl(v5.24.1)

Built under linux
Compiled at Jan 15 2017 23:35:20
@INC:
 /etc/perl
 /usr/local/share/perl/5.24.1
 /usr/lib/x86_64-linux-gnu/perl5/5.24
 /usr/share/perl5
 /usr/lib/x86_64-linux-gnu/perl/5.24
 /usr/share/perl/5.24
 /usr/local/lib/site_perl
 /usr/lib/x86_64-linux-gnu/perl-base

有谁知道为什么?

1 个答案:

答案 0 :(得分:14)

因为.已从@INC中删除了5.24.1中的核心模块。这是一个安全功能,可以防止this blog post所涉及的漏洞利用。

  

2月份,我用Perl 5 Porters打开了一张票,让他们接受一个非默认的删除选项。来自@INC。不幸的是,我被打败了,并且Perl 5 Security披露了漏洞。 TL; DR:现在已经有了关于拥有的不安全感。在@INC。

对于5.24.1,perldelta记录了此更改。

  

这可以防止攻击者将可选模块注入由另一个用户运行的进程,其中当前目录可由攻击者写入,例如, / tmp目录。

很可能是be removed completely in 5.26。 p5p邮件列表中的Here's more discussion取自this blog post

Here are (some of) the commits进行了这些更改。

Perl Pumpkin Sawyer X也在the talk Perl 5.24, 5.26, and the Future of Perl 5 he gave at FOSDEM 2017中解释了这一点。谈话 1 Here is the recording

1)all videos from the Perl room at FOSDEM 2017