Advisory from securesoftware@list.cr.yp.to: Date: 15 Dec 2004 08:37:03 -0000 From: "D. J. Bernstein" <djb@cr.yp.to> Subject: [remote] [control] unrtf 0.19.3 process_font_table overflows name buffer To: securesoftware@list.cr.yp.to, bug-unrtf@gnu.org, obraun@informatik.unibw-muenchen.de, tuorfa@yahoo.com X-HELOcheck: OK: FQDN Mailing-List: contact securesoftware-help@list.cr.yp.to; run by ezmlm Mail-Followup-To: securesoftware@list.cr.yp.to, bug-unrtf@gnu.org, obraun@informatik.unibw-muenchen.de, tuorfa@yahoo.com Automatic-Legal-Notices: See http://cr.yp.to/mailcopyright.html. [-- Attachment #1 [details] --] [-- Type: text/plain, Encoding: 7bit, Size: 1.5K --] 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
Created attachment 46032 [details] 81.rtf from advisory
robbat2/aliz: you have committed ebuilds for this before... pls verify and advise
Strange the DJB didn't attach a fix as well. Funnily enough that corrupt file is caught by Windows, but it does affect unrtf on linux.
====================================================== Candidate: CAN-2004-1297 URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-1297 Reference: MISC:http://tigger.uic.edu/~jlongs2/holes/unrtf.txt Buffer overflow in the process_font_table function in convert.c for unrtf 0.19.3 allows remote attackers to execute arbitrary code via a crafted RTF file. ======================================================
Created attachment 47210 [details, diff] unrtf-final.patch Patch from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287038
Created attachment 47211 [details, diff] unrtf-final.patch Clean unrtf-final.patch
No metadata... aliz/robbat2: please bump with patch.
-r1 in CVS now, ready for amd64 ppc s390 to stabilze. It's marked stable for x86 already.
ppc, s390: please test 0.19.3-r1 and mark stable
stable on ppc.
glsa 200501-15