Bug 79289 - man -k attempts to run 'unsafe' script
Summary: man -k attempts to run 'unsafe' script
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: man
Version: 7.3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Eido Inoue
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2002-12-09 16:54 UTC by David Wijnants
Modified: 2007-03-27 03:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-01-06 22:19:58 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2003:133 0 normal SHIPPED_LIVE : Updated man packages fix minor vulnerability 2003-05-01 04:00:00 UTC
Red Hat Product Errata RHSA-2003:134 0 normal SHIPPED_LIVE Low: man security update 2003-04-28 04:00:00 UTC

Description David Wijnants 2002-12-09 16:54:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.18-18.7.x i686)

Description of problem:
If the parameter passed to 'man -k' contains a space, it exits with 'sh: unsafe:
command not found'. If there is a script with that name on the path, the script
will be run.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. man -k 'what is'
2. Now the same with example script (unsafe) on the path

echo "You've been trojaned!"

Actual Results:  Without 'unsafe' on path:

sh: unsafe: command not found
Error executing formatting or display command.
System command unsafe exited with status 32512.

With 'unsafe' on path:

You've been trojaned!

Expected Results:

what: nothing appropriate
is: nothing appropriate

(cf. apropos)

Additional info:

man-1.5j/src/utils.c filters out 'non-shell-safe commands' by replacing them
with the string 'unsafe', but man still goes ahead and runs the 'unsafe'

Comment 1 Alan Cox 2002-12-18 18:44:54 UTC
Agreed. We don't have "." on the path so the damage is minimal but its a bug
that wants squashing

Comment 2 Eido Inoue 2003-01-06 22:19:58 UTC
fixed in man-1.5j-14

Comment 3 Mark J. Cox 2003-04-28 12:45:56 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.


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