Home

Description

File::Find::Rule through 0.34 for Perl is vulnerable to Arbitrary Code Execution when `grep()` encounters a crafted filename. A file handle is opened with the 2 argument form of `open()` allowing an attacker controlled filename to provide the MODE parameter to `open()`, turning the filename into a command to be executed. Example: $ mkdir /tmp/poc; echo > "/tmp/poc/|id" $ perl -MFile::Find::Rule \ -E 'File::Find::Rule->grep("foo")->in("/tmp/poc")' uid=1000(user) gid=1000(user) groups=1000(user),100(users)

PUBLISHED Reserved 2025-06-05 | Published 2025-06-05 | Updated 2025-06-11 | Assigner CPANSec

Problem types

CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Product status

Default status
unaffected

Any version
affected

Timeline

2011-01-04:A bug was reported by Kevin Ryde to the upstream RT bugtracker described as "grep() can truncate files".
2025-06-04:CPANSec became aware of the bug and started triage. Code execution impact was confirmed, a patch was made, and the author, the distros list and additional downstream vendors were notified.
2025-06-05:The author released File::Find::Rule 0.35.

References

github.com/richardc/perl-file-find-rule/pull/4 exploit

lists.debian.org/debian-lts-announce/2025/06/msg00006.html

www.openwall.com/lists/oss-security/2025/06/05/4

www.openwall.com/lists/oss-security/2025/06/06/1

www.openwall.com/lists/oss-security/2025/06/06/3

metacpan.org/...-Find-Rule-0.34/source/lib/File/Find/Rule.pm

rt.cpan.org/Public/Bug/Display.html?id=64504 issue-tracking exploit

github.com/richardc/perl-file-find-rule/pull/4 issue-tracking

github.com/...df58128bcee4c1da78c34d7f3fe1357e575ad56f.patch patch

cve.org (CVE-2011-10007)

nvd.nist.gov (CVE-2011-10007)

Download JSON