DSA-229-1 imp -- SQL injection

Related Vulnerabilities: CVE-2003-0025  

Jouko Pynnonen discovered a problem with IMP, a web based IMAP mail program. Using carefully crafted URLs a remote attacker is able to inject SQL code into SQL queries without proper user authentication. Even though results of SQL queries aren't directly readable from the screen, an attacker might update their mail signature to contain wanted query results and then view it on the preferences page of IMP. The impact of SQL injection depends heavily on the underlying database and its configuration. If PostgreSQL is used, it's possible to execute multiple complete SQL queries separated by semicolons. The database contains session id's so the attacker might hijack sessions of people currently logged in and read their mail. In the worst case, if the hordemgr user has the required privilege to use the COPY SQL command (found in PostgreSQL at least), a remote user may read or write to any file the database user (postgres) can. The attacker may then be able to run arbitrary shell commands by writing them to the postgres user's ~/.psqlrc; they'd be run when the user starts the psql command which under some configurations happens regularly from a cron script. For the current stable distribution (woody) this problem has been fixed in version 2.2.6-5.1. For the old stable distribution (potato) this problem has been fixed in version 2.2.6-0.potato.5.1. For the unstable distribution (sid) this problem have been fixed in version 2.2.6-7. We recommend that you upgrade your IMP packages.

Debian Security Advisory

DSA-229-1 imp -- SQL injection

Date Reported:
15 Jan 2003
Affected Packages:
imp
Vulnerable:
Yes
Security database references:
In the Bugtraq database (at SecurityFocus): BugTraq ID 6559.
In Mitre's CVE dictionary: CVE-2003-0025.
More information:

Jouko Pynnonen discovered a problem with IMP, a web based IMAP mail program. Using carefully crafted URLs a remote attacker is able to inject SQL code into SQL queries without proper user authentication. Even though results of SQL queries aren't directly readable from the screen, an attacker might update their mail signature to contain wanted query results and then view it on the preferences page of IMP.

The impact of SQL injection depends heavily on the underlying database and its configuration. If PostgreSQL is used, it's possible to execute multiple complete SQL queries separated by semicolons. The database contains session id's so the attacker might hijack sessions of people currently logged in and read their mail. In the worst case, if the hordemgr user has the required privilege to use the COPY SQL command (found in PostgreSQL at least), a remote user may read or write to any file the database user (postgres) can. The attacker may then be able to run arbitrary shell commands by writing them to the postgres user's ~/.psqlrc; they'd be run when the user starts the psql command which under some configurations happens regularly from a cron script.

For the current stable distribution (woody) this problem has been fixed in version 2.2.6-5.1.

For the old stable distribution (potato) this problem has been fixed in version 2.2.6-0.potato.5.1.

For the unstable distribution (sid) this problem have been fixed in version 2.2.6-7.

We recommend that you upgrade your IMP packages.

Fixed in:

Debian GNU/Linux 2.2 (potato)

Source:
http://security.debian.org/pool/updates/main/i/imp/imp_2.2.6-0.potato.5.1.dsc
http://security.debian.org/pool/updates/main/i/imp/imp_2.2.6-0.potato.5.1.diff.gz
Architecture-independent component:
http://security.debian.org/pool/updates/main/i/imp/imp_2.2.6-0.potato.5.1_all.deb

Debian GNU/Linux 3.0 (woody)

Source:
http://security.debian.org/pool/updates/main/i/imp/imp_2.2.6-5.1.dsc
http://security.debian.org/pool/updates/main/i/imp/imp_2.2.6-5.1.diff.gz
Architecture-independent component:
http://security.debian.org/pool/updates/main/i/imp/imp_2.2.6-5.1_all.deb

MD5 checksums of the listed files are available in the original advisory.

MD5 checksums of the listed files are available in the revised advisory.