J-Security Center

Title: BSD exec() Race Condition Vulnerability

Severity: MODERATE

Description:

NetBSD, FreeBSD and likely OpenBSD operating systems contain a race condition in the implementation of the exec() system call.

The 'exec()' system call is used to load a binary image from an executable file into a process.

When a setuid/setgid file is exec()'d by a process, flags are set in the kernel so that it cannot be attached to via ptrace(). There reportedly exists a new race condition which could allow for an attacker to attach to and modify a setuid/setgid process before these flags are set if the race is won. If an attacker can attach to the process, it's memory can be modified so that shellcode is executed with the elevated setuid/setgid privileges.

An attacker may be able to exec() a setuid image and attach to it by winning the race and successfully exploiting this vulnerability. If attached to, the process memory can be modified so that shellcode is executed.

It is not yet confirmed which other BSD-based operating systems may be vulnerable.

Affected Products:

  • FreeBSD FreeBSD 2.0.0
  • FreeBSD FreeBSD 2.1.0
  • FreeBSD FreeBSD 2.2.0
  • FreeBSD FreeBSD 2.2.2
  • FreeBSD FreeBSD 2.2.3
  • FreeBSD FreeBSD 2.2.4
  • FreeBSD FreeBSD 2.2.5
  • FreeBSD FreeBSD 2.2.6
  • FreeBSD FreeBSD 2.2.8
  • FreeBSD FreeBSD 3.0.0
  • FreeBSD FreeBSD 3.1.0
  • FreeBSD FreeBSD 3.2.0
  • FreeBSD FreeBSD 3.3.0
  • FreeBSD FreeBSD 3.4.0
  • FreeBSD FreeBSD 3.5.0
  • FreeBSD FreeBSD 3.5.1
  • FreeBSD FreeBSD 4.0.0
  • FreeBSD FreeBSD 4.1.0
  • FreeBSD FreeBSD 4.1.1
  • FreeBSD FreeBSD 4.1.1 -RELEASE
  • FreeBSD FreeBSD 4.1.1 -STABLE
  • FreeBSD FreeBSD 4.2.0
  • FreeBSD FreeBSD 4.2.0 -RELEASE
  • FreeBSD FreeBSD 4.2.0 -STABLE
  • FreeBSD FreeBSD 4.3.0
  • FreeBSD FreeBSD 4.3.0 -RELEASE
  • FreeBSD FreeBSD 4.3.0 -RELENG
  • FreeBSD FreeBSD 4.3.0 -STABLE
  • FreeBSD FreeBSD 4.4.0
  • FreeBSD FreeBSD 4.4.0 -RELENG
  • FreeBSD FreeBSD 4.4.0 -STABLE
  • NetBSD NetBSD 1.3.0
  • NetBSD NetBSD 1.3.1
  • NetBSD NetBSD 1.3.2
  • NetBSD NetBSD 1.3.3
  • NetBSD NetBSD 1.4.0
  • NetBSD NetBSD 1.4.1
  • NetBSD NetBSD 1.4.2
  • NetBSD NetBSD 1.4.3
  • NetBSD NetBSD 1.5.0
  • NetBSD NetBSD 1.5.1
  • NetBSD NetBSD 1.5.2
  • OpenBSD OpenBSD 2.0.0
  • OpenBSD OpenBSD 2.1.0
  • OpenBSD OpenBSD 2.2.0
  • OpenBSD OpenBSD 2.3.0
  • OpenBSD OpenBSD 2.4.0
  • OpenBSD OpenBSD 2.5.0
  • OpenBSD OpenBSD 2.6.0
  • OpenBSD OpenBSD 2.7.0
  • OpenBSD OpenBSD 2.8.0
  • OpenBSD OpenBSD 2.9.0
  • OpenBSD OpenBSD 3.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.