RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 847949 - CVE-2012-3878 perl: "require" directive allows to load files from paths not stored in @INC
Summary: CVE-2012-3878 perl: "require" directive allows to load files from paths not s...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: perl
Version: 7.0
Hardware: All
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: perl-maint-list
QA Contact: BaseOS QE - Apps
URL: http://www.nntp.perl.org/group/perl.p...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-14 07:32 UTC by Stefan Cornelius
Modified: 2015-01-24 13:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-03 10:26:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Stefan Cornelius 2012-08-14 07:32:44 UTC
It was discovered that the "require" directive allows to load files from paths not stored in @INC. If a Perl application allows users to specify arbitrary module names and an attacker can place a malicious file containing Perl code ending with .pm or .pmc on the local file system, he could exploit this behaviour to load and execute the malicious file.

http://www.nntp.perl.org/group/perl.perl5.porters/2012/07/msg189909.html
http://perl5.git.perl.org/perl.git/shortlog/refs/heads/smoke-me/require

Comment 1 Stefan Cornelius 2012-08-14 07:33:31 UTC
*** Bug 840895 has been marked as a duplicate of this bug. ***

Comment 2 Marcela Mašláňová 2012-08-14 13:22:02 UTC
The new behaviour of require will be default in perl-5.16.x. It might be in perldelta, but it's not there yet. We might document it.

Comment 4 Petr Pisar 2013-10-30 12:10:00 UTC
Upstream has never merged the change into blead and never released a perl version which would incorporate the change:

v5.18.1:
$ strace perl -e 'require ::tmp::foo' 2>&1 | grep foo
execve("/bin/perl", ["perl", "-e", "require ::tmp::foo"], [/* 20 vars */]) = 0
stat("/tmp/foo.pmc", 0x7fff5ec8e3d0)    = -1 ENOENT (No such file or directory)
stat("/tmp/foo.pm", 0x7fff5ec8e310)     = -1 ENOENT (No such file or directory)
write(2, "Can't locate /tmp/foo.pm in @INC"..., 252Can't locate /tmp/foo.pm in @INC (you may need to install the ::tmp::foo module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at -e line 1.

v5.16.3:
# strace perl -e 'require ::tmp::foo' 2>&1 | grep foo
execve("/usr/bin/perl", ["perl", "-e", "require ::tmp::foo"], [/* 30 vars */]) = 0
stat("/tmp/foo.pmc", 0x7fff5749fbb0)    = -1 ENOENT (No such file or directory)
stat("/tmp/foo.pm", 0x7fff5749fb00)     = -1 ENOENT (No such file or directory)
write(2, "Can't locate /tmp/foo.pm in @INC"..., 204Can't locate /tmp/foo.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at -e line 1.

As you can see, the leading quad-dot still resolves to absolute path.

In my opinion, upstream put the resolution into dormant state.

Because the fix changes behavior, I cannot consider applying it into our distribution as a good resolution.

Comment 5 Petr Pisar 2014-06-03 10:26:14 UTC
(In reply to Petr Pisar from comment #4)
> Because the fix changes behavior, I cannot consider applying it into our
> distribution as a good resolution.

If you want to see this change in a future major Red Hat Enterprise Linux release, please persuade upstream to accept this change first.


Note You need to log in before you can comment on or make changes to this bug.