Bug 460648 - crossfire-maps: Insecure auxiliary /tmp file usage (symlink attack possible)
Summary: crossfire-maps: Insecure auxiliary /tmp file usage (symlink attack possible)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-08-29 13:41 UTC by Jan Lieskovsky
Modified: 2019-09-29 12:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-22 15:42:55 UTC
Embargoed:


Attachments (Terms of Use)

Description Jan Lieskovsky 2008-08-29 13:41:40 UTC
The crossfire-maps package, as shipped within Fedora releases of 8, 9 and 10,
is prone to the symlink attack.

Affected file: /usr/share/crossfire/maps/Info/combine.pl

Relevant part of the code:

36:    system("ppmmake \\#000 $DEST_WIDTH $DEST_HEIGHT > /tmp/tmp.ppm");
40:    system("cp images/combine.ppm /tmp/tmp.ppm");
62:         system("pngtopnm images/world_$dx\_$dy.png | pnmscale -xysize $TILE_WIDTH $TILE_HEIGHT > /tmp/ppm.tmp");
65:         system("pnmpaste /tmp/ppm.tmp $sx $sy /tmp/tmp.ppm > /tmp/tmp.ppm1");
66:         unlink("/tmp/tmp.ppm");
67:         rename("/tmp/tmp.ppm1", "/tmp/tmp.ppm");
71:system("mv /tmp/tmp.ppm images/combine.ppm");

Description: 

A malicious user could precreate a symbolic link pointing to the file 
'/tmp/tmp.ppm'. Subsequent run of the crossfire command, would 
destroy / truncate the target of the symlink to zero size.

Affected versions:

This issue affects the versions of the crossfire-maps package, as shipped
within Fedora releases of 8, 9 and 10.


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