Bug 466528 (CVE-2008-2238) - CVE-2008-2238 OpenOffice.org multiple EMF buffer overflows
Summary: CVE-2008-2238 OpenOffice.org multiple EMF buffer overflows
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2008-2238
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL: http://nvd.nist.gov/nvd.cfm?cvename=C...
Whiteboard:
Depends On: 462642 462643 462644 462645 462719 462720 462721
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-10 18:53 UTC by Josh Bressers
Modified: 2019-09-29 12:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-11-06 10:58:01 UTC
Embargoed:


Attachments (Terms of Use)
Upstream patch (14.89 KB, patch)
2008-10-10 19:01 UTC, Josh Bressers
no flags Details | Diff
final patch (14.45 KB, patch)
2008-10-22 15:20 UTC, Caolan McNamara
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2008:0939 0 normal SHIPPED_LIVE Important: openoffice.org security update 2008-11-05 11:31:51 UTC

Description Josh Bressers 2008-10-10 18:53:53 UTC
iDefense reported multiple buffer overflows in OpenOffice.org's EMF file
parser.

If a victim opens a malicious EMF file, it could be possible to execute
arbitrary code with the permissions of the user running OpenOffice.org.

Comment 1 Josh Bressers 2008-10-10 19:01:33 UTC
Created attachment 320049 [details]
Upstream patch

Comment 2 Tomas Hoger 2008-10-22 14:45:53 UTC
Caolan, is the patch in comment #1 final patch used by upstream?  It does some nEndPos validation, but does not seem to try to prevent integer overflow in:

  nEndPos += nStartPos;

nStartPos is position in the stream, nEndPos is metafile size read from the file, so this addition may wrap and nEndPos can be lower than nStartPos.  So some tests based on nEndPos may go wrong.

Comment 3 Caolan McNamara 2008-10-22 15:20:38 UTC
Created attachment 321166 [details]
final patch

Final patch is here, its the same. 

Might be quite tricky to navigate a .emf past the size tests to get to any (nEndPos - nStartPos) comparisons.

Comment 5 Tomas Hoger 2008-10-27 16:53:12 UTC
The upstream patch basically does 2 types of changes:
- integer overflow checks
- checks using nEndPos to determine whether there is enough data in the file before reading larger arrays

Second type of changes does not seem to be directly related to what iDefense reports.  It seems to rather be a change to make the code bit more correct, and defensive.  Without them, hitting EOF in the middle of the larger read seems to be the worst case.  If no exception is raised when EOF is hit, values read are undefined, which is not worse than attacker-controlled ones.

Please correct me if I wrong in that, as if those checks are security-relevant as well, than "nEndPos += nStartPos" overflow does matter.

Thank you!

Comment 6 Caolan McNamara 2008-10-28 10:34:16 UTC
> The upstream patch basically does 2 types of changes:
> - integer overflow checks
> - checks using nEndPos to determine whether there is enough data in the file
> before reading larger arrays

right

> Second type of changes does not seem to be directly related to what iDefense
> reports.  

right

> It seems to rather be a change to make the code bit more correct, and
> defensive.

Yup, my understanding is that sj decided to stick some defensive code in there while addressing the (messy set of) iDefense overflow issues.

Comment 7 Tomas Hoger 2008-10-28 10:54:59 UTC
Ok, thanks, sounds reasonable.  If you are in communication with sj, please drop him a note about nEndPos issue, so the code can be made even bit more defensive in the future revisions.  Thanks!

Comment 8 Tomas Hoger 2008-10-29 10:45:01 UTC
Public now via:
  http://www.openoffice.org/security/cves/CVE-2008-2238.html

Fixed upstream in 2.4.2.

Comment 9 Fedora Update System 2008-10-30 08:39:20 UTC
openoffice.org-2.3.0-6.17.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/openoffice.org-2.3.0-6.17.fc8

Comment 10 Fedora Update System 2008-10-30 08:50:19 UTC
openoffice.org-2.4.2-18.1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/openoffice.org-2.4.2-18.1.fc9

Comment 11 Fedora Update System 2008-10-31 10:23:43 UTC
openoffice.org-2.4.2-18.1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2008-10-31 10:27:08 UTC
openoffice.org-2.3.0-6.17.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.