[原文]GNU locate in findutils 4.1 on Slackware 7.1 and 8.0 allows local users to gain privileges via an old formatted filename database (locatedb) that contains an entry with an out-of-range offset, which causes locate to write to arbitrary process memory.
GNU locate is an application that searches file databases for file names that match user-supplied patterns.
A boundary condition error can occur when the program reads database files composed in an "old" format, produced by GNU locate prior to version 4.0 and by Unix versions of locate and find. 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.
char shellcode =
char putshell =
int z0=0; int addr=0x0804a970;
int z1=0; int addr2=-626;
int z2=0; int addr3=addr+6;
GNU findutils locate Memory Write Privilege Escalation
Local Access Required
Loss of Confidentiality,
Loss of Integrity
A local buffer overflow exists in the GNU findutils locate command. The locate command fails to check input in the old locate database format resulting in a potential buffer overflow. With a specially crafted entry in such a database file, an attacker can cause execution of code resulting in a loss of confidentiality and integrity.
Currently, there are no known upgrades, patches, or workarounds available to correct this issue.