J-Security Center

Title: GNU Locate Arbitrary Command Execution Vulnerability

Severity: MODERATE

Description:

GNU locate is an application that searches file databases for file names that match user-supplied patterns.

The program supports searching through filename databases composed in two different formats: an old format produced by Unix versions of locate and find, and a new format used in versions 4.0 and greater of GNU locate.

A boundary condition error can occur when the program reads old-format database files. Each individual database entry begins with a one byte offset-differential count, indicating the number of characters of prefix of the preceding entry to use beyond the number that the preceding entry is using as its predecessor. Byte values 0 through 28 indicate offset-differential counts from -14 through 14. If the offset-differential count is larger than can be stored in a byte, the byte has the value 30 and the count follows in a machine-size word.

The problem exists because the machine-size word following a byte value of 30 is treated as a signed integer. By inserting an entry into the database with a negative value as the offset-differential count, it is possible to cause the program to write data read from the file to an arbitrary locations in process memory.

If an attacker is able to write a malicious entry to a database file used by other users, the attacker could cause arbitrary code to be executed by another user when the user runs the locate program.

It also should be noted that in earlier versions of Slackware(circa 3.5) the file is written by the superuser.

Affected Products:

  • GNU findutils 4.0.0
  • GNU findutils 4.1.0
  • Slackware Linux 7.1.0
  • Slackware Linux 8.0.0

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.