Project

General

Profile

Actions

Bug #21491

closed

Use HMACs for authencity and integrity checks

Added by Marcus Krause about 15 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2009-11-07
Due date:
% Done:

0%

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

Description

On several places in TYPO3 Core, md5() function calls are used to proove authencity and integrity of parameters in HTTP requests.
One example is showpic eID. By creating a MD5 hash over parameters and the secret encryption key, TYPO3 makes sure that no further parameter has been injected ore existing ones aren't modified.

However, MD5 hashing itself prooves to have a bunch of weaknesses. In the future, the TYPO3 way for integrity checks might become vulnerable. I hereby suggest to keep up with development in security industry.

Using HMAC [1] is a valid method to proove integrity and authencity of datat. WIth PHP5, a dedicated function is available. HMAC itself uses known hashing methods; nonetheless, creating HMACs is more than creating a hash.

This RFC is about extending t3lib_div by a hmac function. Using the newly introduced method throughout the Core will taken care of by an additional RFC.

Advantages of HMACs in TYPO3:
  • having a dedicated method for integrity and authencity checks on data
  • raising the awareness of HMACs and thus make them easily useable by creating a t3lib_div method
  • using one API method enables us to easily switch to a different hashing algorithm in future

Note:
Thanks to Sebastian Kurfürst, HMACs are already used in FLOW3 and Extbase.

[1] http://en.wikipedia.org/wiki/HMAC

(issue imported from #M12502)


Files

12502.diff (1.83 KB) 12502.diff Administrator Admin, 2009-11-07 11:44
12502_v1.diff (2.81 KB) 12502_v1.diff Administrator Admin, 2010-04-16 18:54
12502_v2.diff (3.01 KB) 12502_v2.diff Administrator Admin, 2010-04-16 22:29

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #21465: OpenID library should use PHP functions to compute HMAC-SHA1Closed2009-11-05

Actions
Actions #1

Updated by Marcus Krause over 14 years ago

I've added a new version (v1) of this RFC. This removes the dependency of ext/hash by adding a fallback hmac generation.
Also the length argument has been dropped. The resulting HMAC length is mentioned in PHPdoc.
I switched to HMAC-SHA-1 (instead of md5) because sha1 is already in use for extbase and openid.

Nonetheless, I added ext/hash to the recommended PHP extensions as using ext/hash will certainly have a speed advantage.

Actions #2

Updated by Marcus Krause over 14 years ago

v2 removes two unnecessary function calls in fallback hmac generation code

Actions #3

Updated by Benni Mack over 14 years ago

committed v2 to trunk (rev. 7474).

Actions #4

Updated by Susanne Moog over 13 years ago

  • Target version deleted (4.4.0)
Actions

Also available in: Atom PDF