Bug 126940 - im-switch symlink vulnerability
Summary: im-switch symlink vulnerability
Alias: None
Product: Fedora
Classification: Fedora
Component: im-sdk   
(Show other bugs)
Version: 2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jens Petersen
QA Contact:
Keywords: i18n, Security
Depends On:
Blocks: IIIMF
TreeView+ depends on / blocked
Reported: 2004-06-29 15:01 UTC by SEKINE Tatsuo
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-07-07 04:16:56 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description SEKINE Tatsuo 2004-06-29 15:01:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Description of problem:
/usr/bin/im-switch program use file "/tmp/imswitcher$$" as temporary file.

This way to use temporary file is insecure, because
/tmp/ is everyone writable and $$(PID) is predictable.

When root try to set system-wide setting of IM, attacker can crash
 important file without root privilege.

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

How reproducible:

Steps to Reproduce:
1. an attacker who has onlu normal privilege types as followed:

  $ bash -c 'i=1;while [ $i -lt 65536 ]; do ln -s /etc/IMPORTANT_FILE
/tmp/imswitcher$i; let "i++"; done'

2. root types below to set system-wide IM setting:

  # /usr/bin/im-switch -w -m xim


Actual Results:  /etc/IMPORTANT_FILE becomes broken.

Expected Results:  /etc/IMPORTANT_FILE is independent from the
behavior of im-switch program.

Additional info:

mktemp(1) command or "umask 077; mkdir /tmp/..." should be used to
make temporary file(directory).

Comment 1 Jens Petersen 2004-07-05 11:36:35 UTC
Thanks for spotting this - should get fixed in an update soon.

Comment 2 Jens Petersen 2004-07-06 07:13:48 UTC
im-sdk-11.4-46.1 has been built to address this issue.

Comment 3 Lawrence Lim 2004-07-07 04:16:56 UTC
Great efforts guys.

Performed sanity check and verified that the tmp file imswitcher$$ no
longer exist in the dir after using im-swicth command.

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