Project

General

Profile

Actions

Bug #20785

closed

Potential SQL injection in class.t3lib_tsfebeuserauth.php

Added by Christian Weiske over 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
-
Start date:
2009-07-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

t3lib/class.t3lib_tsfebeuserauth.php contains a potential security problem, leading to a SQL injection possibility:

$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(implode(',',$fields), $table, 'uid='.$uid);

$uid is from

list($table,$uid) = explode(':',$this->TSFE_EDIT['record']);

which itself is from

$this->TSFE_EDIT = t3lib_div::_POST('TSFE_EDIT');

The problem exists in 4_2 branch, but not in typo3 4 trunk.
https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2/t3lib/class.t3lib_tsfebeuserauth.php

(issue imported from #M11586)


Files

sdm-1605.diff (544 Bytes) sdm-1605.diff Administrator Admin, 2009-07-27 16:18
11586.diff (3.67 KB) 11586.diff Administrator Admin, 2009-09-20 14:28
11586_41.diff (547 Bytes) 11586_41.diff Administrator Admin, 2009-10-13 17:08
11586_42.diff (547 Bytes) 11586_42.diff Administrator Admin, 2009-10-13 17:08

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #21344: Frontend editing (standard and advanced) is brokenClosedErnesto Baschny2009-10-23

Actions
Actions #1

Updated by Oliver Klee about 15 years ago

The 4.2 branch patch looks okay to me (although I'd prefer intval, but that is just a style issue). As this isn't on the trunk, we won't have any unit tests for this.

On the trunk, a similar problem exists in t3lib_frontendedit::editAction. I'm still looking into whether this is used in any DB calls.

Actions #2

Updated by Oliver Klee about 15 years ago

Ernesto, could you have a look at the trunk patch?

Actions #3

Updated by Oliver Klee about 15 years ago

The patch also adds missing (but used) member variable.

Actions #4

Updated by Ernesto Baschny about 15 years ago

Oli, patch is fine, the unit test work.

I was not really able to exploit the issue, but the potential is probably there, and these patches will fix it.

I would apply the same sort of fix to the 4.2 branch (there in t3lib_tsfebeuserauth::extEditAction), meaning using intval instead of (int) casting, as this is the style used throughout this file already.

+1 by reviewing and testing on all branches (including 4.1, as the function is the same as in 4.2).

Actions #5

Updated by Oliver Klee about 15 years ago

I've created new 4.1 and 4.2 patches that now use intval instead of (int).

Actions #6

Updated by Christian Weiske about 15 years ago

Wow. I opened this security bug in july 2009, and four months later a new patch has been developed, changing "(int)" to "intval("? You are my true heroes.

Actions #7

Updated by Oliver Klee about 15 years ago

Christian, there are several patches. The cosmetic change is on the 4.1 and 4.2 branch versions only. The biggest part of the work has been done on the trunk, including unit tests.

Actions #8

Updated by Helmut Hummel about 15 years ago

+1 (did not look at the testcases though)

Actions #9

Updated by Michael Stucki about 15 years ago

+1 on reading the following patches:
11586.diff
11586_41.diff
11586_42.diff

Actions #10

Updated by Ernesto Baschny about 15 years ago

Commited to
trunk (rev.6229 = beta2)
TYPO3 4.2 (rev. 6230 = 4.2.10)
TYPO3 4.1 (rev. 6231 = 4.1.11)

Actions #11

Updated by Ernesto Baschny about 15 years ago

reopened to change it to "public".

Actions

Also available in: Atom PDF