Bug 466528 - (CVE-2008-2238) CVE-2008-2238 OpenOffice.org multiple EMF buffer overflows
CVE-2008-2238 OpenOffice.org multiple EMF buffer overflows
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
http://nvd.nist.gov/nvd.cfm?cvename=C...
impact=important,source=upstream,repo...
: Security
Depends On: 462642 462643 462644 462645 462719 462720 462721
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-10 14:53 EDT by Josh Bressers
Modified: 2008-11-06 05:58 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-06 05:58:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Josh Bressers 2008-10-10 14:53:53 EDT
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 15:01:33 EDT
Created attachment 320049 [details]
Upstream patch
Comment 2 Tomas Hoger 2008-10-22 10:45:53 EDT
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 11:20:38 EDT
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 12:53:12 EDT
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 06:34:16 EDT
> 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 06:54:59 EDT
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 06:45:01 EDT
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 04:39:20 EDT
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 04:50:19 EDT
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 06:23:43 EDT
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 06:27:08 EDT
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.