Skip Menu |

This queue is for tickets about the Pod-Perldoc CPAN distribution.

Report information
The Basics
Id: 11118
Status: resolved
Priority: 0/
Queue: Pod-Perldoc

People
Owner: Nobody in particular
Requestors: vasi [...] users.sourceforge.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.14
Fixed in: (no value)



Subject: ToMan.pm doesn't quote filename in system command
Running perl 5.8.6 (via the Fink distribution) on Mac OS X 10.3.7. Pod::Perldoc version 3.13 installed. In Pod::Perldoc::ToMan.pm, line 63: my $command = "$pod2man $switches --lax $file | $render -man"; If $file contains special shell characters (spaces for example), then $command will not do the right thing when executed. Eg: vasi$ perldoc "/Users/vasi/Library/Application Support/Glues/Terminal.pod" Can't open /Users/vasi/Library/Application for reading: No such file or directory at /usr/bin/pod2man line 60 Got a 0-length file from /Users/vasi/Library/Application Support/Glues/Terminal.pod via Pod::Perldoc::ToMan!? This has potential security implications,. If a user can create a file in a known locate, and can pass an argument to perldoc (eg: via mod_perl), they can execute arbitrary commands. Eg: perldoc '; rm -rf /; .pm' An easy fix is to change the offending line to quote the filename: my $command = "$pod2man $switches --lax \Q$file\E | $render -man"; The other embedded variables in the command may also require quoting to ensure that perldoc operates correctly in all circumstances.
I've added this change in the github repository at https://github.com/briandfoy/Pod-Perldoc . It's commit 63f82585b794bf0cb8c776ac2f3154ff23ef5e5e .