J-Security Center

Title: Netscape Communicator JPEG-Comment Heap Overwrite Vulnerability

Severity: HIGH

Description:

Netscape Browsers use the Independent JPEG Group's decoder library to process JPEG encoded images. The library functions skip JPEG comments; however, the browser uses a custom function to process these comments and store them in memory. The comment includes a 2-byte "length" field which indicates how long the comment is - this value includes the 2-bytes of the "length" field. To determine the length of the comment string alone (for memory allocation), the function reads the value in the "length" field and subtracts two. The function then allocates the length of the comment + one byte for NULL termination. There is no error checking to ensure the "length" value is valid. This makes it possible to cause an overflow by creating an image with a comment "length" field containing the value 1. The memory allocation call of 0 bytes (1 minus 2 (length field) + 1 (null termination)) will succeed. The calculated comment size variable is declared unsigned, resulting in a large positive value (from 1 minus 2). The comment handling function goes into a loop to read the comment into memory, but since the calculated comment size is enormous this causes the function to read the entire JPEG stream, overwriting the heap. It is theoretically possible to exploit this to execute arbitrary code. The browser, mail and news readers are all vulnerable to this.

Affected Products:

  • Mozilla Browser 0.0.0M15
  • Netscape Communicator 0.0.04.06
  • Netscape Communicator 0.0.04.07
  • Netscape Communicator 0.0.04.08
  • Netscape Communicator 4.0.0
  • Netscape Communicator 4.5.0
  • Netscape Communicator 4.5.0BETA
  • Netscape Communicator 4.51.0
  • Netscape Communicator 4.6.0
  • Netscape Communicator 4.61.0
  • Netscape Communicator 4.7.0
  • Netscape Communicator 4.72.0
  • Netscape Communicator 4.73.0
  • RedHat Linux 5.2.0
  • RedHat netscape-common-4.07-1.i386.rpm 0.0.0
  • RedHat netscape-communicator-4.07-1.i386.rpm 0.0.0
  • RedHat netscape-navigator-4.07-1.i386.rpm 0.0.0

References:

Juniper Networks provides this content via a wide variety of sources and production methods. If notified of errors or omissions in the content of this page, Juniper Networks, at its discretion, will modify or remove the page or leave the content as is, depending on various factors including but not limited to the reputation and authority of the party providing the notification. Please use the contact information displayed elsewhere on this page to report any errors or omissions regarding the content on this page.