Firebird is a relational database offering many ANSI SQL-92 features that runs on Linux, Windows, and a variety of Unix platforms. Firebird offers excellent concurrency, high performance, and powerful language support for stored procedures and triggers. It has been used in production systems, under a variety of names since 1981.
For more information on Firebird and InterBase, see:
Firebird has 3 binarys [gds_inet_server, gds_drop, and gds_lock_mgr], which all use insufficent bounds checking in conjunction with getenv(), making each one succeptable to local exploitation.
Firebird is by default setuid[firebird]. This exploit can lead to root/escalated privileges, should the attacker trojan the local firebird application.
--[ANALYSIS
Upon setting a large value for the INTERBASE environment variable a buffer can be overflowed. Links to the exploit should accompany this advisory.
--[Please note that there is an exploit written for both versions of firebird.
Exploiting this hole will allow the attacker to, amongst other things, manipulate and/or destroy the databases, and also add the option to trojan the firebird binaries. This will in effect allow for compromising of other users/root accounts.
--[SYSTEMS AFFECTED:
firebird 1.0.0 [BSD/Linux] are vulnerable. firebird-1.0.2 [BSD/Linux] are vulnerable.
--[EXPLOIT CODE
/* DSR-firebird.c by bob@dtors.net -------------------------------
Tested on: Firebird 1.0.2 FreeBSD 4.7-RELEASE
This is Proof Of concept code.
bash-2.05a$ ./DSR-firebird ( ( Firebird-1.0.2 Local exploit for Freebsd 4.7 ) ) ( ( by - bob@dtors.net ) ) ----------------------------------------------------
for (i = 0; i < 1024 - strlen(selectcode) -1; i++) *(ptr++) = 0x90; for (i = 0; i < strlen(selectcode); i++) *(ptr++) = selectcode[i]; egg[1024 - 1] = '\0';
As stated earlier, Linux is also vulnerable. The problem here is that Linux by defaults sets firebird setuid root. There exist a few more problems with linux. For example some command line overflows with certain switches will allow the attacker to change the flow of execution, of it can be changed using the enviroment variable [FIREBIRD_LOCK].