Bugzilla – Bug 845511
VUL-0: CVE-2013-4422: quassel: sql injection
Last modified: 2015-04-27 11:10:23 UTC
From: Bas Pape <firstname.lastname@example.org>
Date: Wed, 9 Oct 2013 18:48:01 +0200
Subject: [oss-security] CVE Request - Quassel IRC SQL injection
Please assign a CVE to the following issue:
Quassel IRC is vulnerable to SQL injection on all current versions
(0.9.0 being the latest at the time of writing), if used with Qt 4.8.5
(the vulnerability is caused by a change in its postgres driver[1,2])
and PostgreSQL 8.2 or later with standard_conforming_strings enabled
(which is the default in those versions). The vulnerability allows
anyone to trick the core into executing SQL queries, which includes
cascade deleting the entire database. It is tracked upstream in bug
#1244 . It was firstly noticed by due to minor issues with
migration to postgres and problems with certain messages, a simple
test with an unmodified installation of postgres and quassel showed
that it was indeed possible to drop tables.
No upstream fix is available at this time, although the below patch
does fix the current issue.
Bas Pape (Tucos)
Author: Bas Pape <email@example.com>
Date: Mon Oct 7 19:51:52 2013 +0200
Detect the need for standard_conforming_strings.
diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp
index 3965704..70bf894 100644
@@ -101,6 +101,15 @@ void PostgreSqlStorage::initDbSession(QSqlDatabase &db)
// this blows... but unfortunately Qt's PG driver forces us to this...
db.exec("set standard_conforming_strings = off");
db.exec("set escape_string_warning = off");
+ // Fortunately things can always blow more. Refer to the commit message for
+ // the juicy details, tread lightly.
+ // First standard_conforming_strings are turned off, because
that's what used
+ // to be necessary, here the actual behaviour is tested.
+ QSqlQuery query = db.exec("SELECT '\\\\' x");
+ if (query.first())
+ if (query.value(0).toString() == "\\")
+ db.exec("set standard_conforming_strings = on");
bugbot adjusting priority
For completeness sake, upstream fixed it  and announced a new
release (0.9.1 ).
Hey, I am not the maintainer ;-)
Anyway somebody bumped it in KDE:Distro:Factory so it should probably be submitted to maintenance channels and factory.
As I was bumping it for this bug and it was changed by community member in meantime I at least moved it from init script to unit file to not feel like doing nothing :)
This is an autogenerated message for OBS integration:
This bug (845511) was mentioned in
https://build.opensuse.org/request/show/203227 Factory / quassel
Both openSUSE 13.1 and Factory contain quassel >= 0.9.1 where this bug is fixed, so I'm changing the state to resolved / upstream