develooper Front page | perl.perl5.porters | Postings from July 2016

CVE-2016-1238: Important unsafe module load path flaw

Thread Next
Sawyer X
July 25, 2016 13:18
CVE-2016-1238: Important unsafe module load path flaw
Message ID:
Steve Hay just pushed fixes for CVE-2016-1238 to maint-5.22 and
maint-5.24 for:

Steve has also just released RCs for 5.22.3 and 5.24.1 carrying these fixes:

The problem relates to Perl 5 ("perl") loading modules from the includes
directory array ("@INC") in which the last element is the current
directory ("."). For more information, see the RT ticket linked above.

While the Perl Security group has attempted to mitigate some of these
problems by modifying Perl Modules, it is ultimately the responsibility
of the application writer to remove relative paths from @INC to assure
the security / consistent behavior of their code regardless of what
directory it executes from.

The fix is to check if the last entry of @INC is "." and if so, to
remove it as an included path.

The following line, when added to the top of Perl applications, should
mitigate this problem. This assumes your code is not intentionally
depending on paths relative to your current working directory:

    BEGIN { pop @INC if $INC[-1] eq '.' }

We would also like to discourage using relative paths in @INC.

This problem was first reported by John Lightsey and Todd Rinaldo,
courtesy of the cPanel Security Team at cPanel. The CVE is courtesy of
Debian. The fix was done by Tony Cook.

-- Sawyer X, p5p.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About