Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 79289 - man -k attempts to run 'unsafe' script
Summary: man -k attempts to run 'unsafe' script
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: man
Version: 7.3
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Eido Inoue
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2003-01-06 22:19:58 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2003:133 normal SHIPPED_LIVE : Updated man packages fix minor vulnerability 2003-05-01 04:00:00 UTC
Red Hat Product Errata RHSA-2003:134 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:
Always

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

#!/bin/sh
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'
command.

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.

http://rhn.redhat.com/errata/RHSA-2003-134.html



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