Integer overflow in the ObjectStream::ObjectStream function in XRef.cc in Xpdf 3.x before 3.02pl4 and Poppler before 0.12.1, as used in GPdf, kdegraphics KPDF, CUPS pdftops, and teTeX, might allow remote attackers to execute arbitrary code via a crafted PDF document that triggers a heap-based buffer overflow.
A heap based buffer overflow was found in the parser for AFM font files, which are used for rendering DVI files in GNOME evince document viewer. Due to insufficient bounds checks when writing data to a memory buffer allocated on a heap, it may be possible to cause an arbitrary memory overwrite, leading to code execution.
Common Vulnerabilities and Exposures assigned an identifier CVE-2010-2642 to this issue.
The vulnerability is present in the code that handles loading of fonts used by DVI files.To exploit you need two files, a DVI file and the malicious font. The vulnerability is triggered not only by opening the document in evince, but also by browsing to a folder which contains the malicious files, where evince thumbnailer will load the malicious file to generate a thumbnail for it.
Acknowledgements:
Red Hat would like to thank the Evince development team for reporting this issue. Upstream acknowledges Jon Larimer of IBM X-Force as the original reporter.
A heap-based buffer overflow flaw was found in the way AFM font file parser, used for rendering of DVI files, in GNOME evince document viewer and other products, processed line tokens from the given input stream. A remote attacker could provide a DVI file, with embedded specially-crafted font file, and trick the local user to open it with an application using the AFM font parser, leading to that particular application crash or, potentially, arbitrary code execution with the privileges of the user running the application. Different vulnerability than CVE-2010-2642.
Upstream bug report: [1] https://bugzilla.gnome.org/showbug.cgi?id=640923
Upstream patch: [2] https://bugzilla.gnome.org/showbug.cgi?id=640923#c1
Multiple off-by-one errors in the (1) token and (2) linetoken functions in backend/dvi/mdvi-lib/afmparse.c in t1lib, as used in teTeX 3.0.x, GNOME evince, and possibly other products, allow remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via a DVI file containing a crafted Adobe Font Metrics (AFM) file, different vulnerabilities than CVE-2010-2642 and CVE-2011-0433.