Description of problem:
/etc/profile.d/autojump.sh might load $CWD/custom_install/autojump.$SHELL
or $CWD/custom_install/autojump.$SHELL. When a user starts a shell in /tmp or another publicly writable directory, and has $SHELL unset or set to something different than zsh or bash, e.g. dash, an attacker might create this file there.
Version-Release number of selected component (if applicable):
I think that the script hasn't changed recently, so Fedora 17 to rawhide is probably affected.
a security flaw was found in the way autojump, a tool for faster filesystem
navigation from the command line, used to honour content of custom_install
directory when global and local autojump installations were not found,
and $SHELL variable was unset or set to different value than bash or zsh.
If an unsuspecting autojump user was tricked into running autojump script
from the directory a local attacker has write access to, this flaw could be
used for arbitrary (Python) code execution with the privileges of the user
running the autojump binary / script.
Relevant (final) upstream patches are as follows:
[1] https://github.com/joelthelion/autojump/commit/ad09ee27d402be797b3456abff6edeb4291edfec
[2] https://github.com/joelthelion/autojump/commit/c763b2afadb188ab52849c21d43d2e8fe5b8800a
References:
[3] https://bugzilla.redhat.com/show_bug.cgi?id=950777
Credit: This issue was found and reported to Red Hat Bugzilla [3] by Zbigniew Jedrzejewski-Szmek.
Thanks also goes to Jan Pokorny for bringing this one to my attention,
and to William Ting of autojump upstream for promptly fixing the issue.