J-Security Center

Title: Portmon USER Environment Variable Buffer Overrun Vulnerability

Severity: MODERATE

Description:

Portmon is a freely available, open source network service monitoring utility. It is available for Unix and Linux operating systems.

A vulnerability has been discovered in Portmon version 1.8 and earlier. The problem occurs due to insufficient bounds checking before copying the USER environment variable into an internal memory buffer.

The problem specifically lies when calling the sprintf() library function to copy the USER environment variable data into the dynamically allocated err_msg buffer. The err_msg buffer is allocated using the following library call: (char *)malloc(128 * sizeof(char));. As a result, including approximately 129 bytes of data within the environment variable could allow an attacker to overwrite adjacent heap memory management structures and other values on the heap.

Although unconfirmed, this could potentially be exploited by an attacker to execute arbitrary code.

It should be noted that Portmon may not be installed setuid root by default, however a configuration option exists which allows an administrator to specify that the utility should in fact be installed setuid.

Affected Products:

  • Portmon Portmon 1.0.0
  • Portmon Portmon 1.1.0
  • Portmon Portmon 1.2.0
  • Portmon Portmon 1.3.0
  • Portmon Portmon 1.4.0
  • Portmon Portmon 1.5.0
  • Portmon Portmon 1.6.0
  • Portmon Portmon 1.7.0
  • Portmon Portmon 1.8.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.