Feature #102761
closedIntroduce class for HMAC generation
0%
Description
The core currently has the following functions or classes to create HMACs:
GeneralUtility::hmac($input, $additionalSecret = '')
- Extbase
HashService
withgenerateHmac(string $string)
,appendHmac(string $string)
,validateHmac(string $string, string $hmac)
andvalidateAndStripHmac(string $string)
The GeneralUtility::hmac($input, $additionalSecret = '')
is used in several places in TYPO3 core and allows to provide an $additionalSecret
. If the additional secret is used, it is safe to create hashed for the same input in a different context. If however the additional secret is left blank, the same input will result in the same HMAC, which is bad in terms of security, since a calculated HMAC possibly can be reused in a different context.
- Extension 1 used
GeneralUtility::hmac('1')
to calculate a HMAC. This HMAC is used in a extbase actionconfirmNewsletterSubscription(int $uid, string $hmac)
- Extension 2 uses
GeneralUtility::hmac('1')
to calculate a HMAC. This HMAC is used in a extbase actiondeleteUser(int $userId, string $hmac)
The HMAC generated my extension 1 for $uid === 1
can be reused in extension 2, since no additional secret is provided.
The Extbase HashService
does not allow to provide any additional secret, so calculated HMACs will always be equal for the same value but in different context.
TYPO3 should have a dedicated class, which combines the fuctionality of GeneralUtility::hmac()
and extbase HashService
. The additional secret should be a mandatory parameter and not be empty.
Updated by Gerrit Code Review 11 months ago
- Status changed from New to Under Review
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80394
Updated by Gerrit Code Review 11 months ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80394
Updated by Gerrit Code Review 11 months ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80394
Updated by Gerrit Code Review 11 months ago
Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80394
Updated by Gerrit Code Review 10 months ago
Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80394
Updated by Gerrit Code Review 10 months ago
Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80394
Updated by Gerrit Code Review 10 months ago
Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80394
Updated by Torben Hansen 10 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 496c4303bee0e1c9fe56619e9b1f05560748e20c.
Updated by Torben Hansen 10 months ago
- Related to Task #102763: Deprecate Extbase HashService added
Updated by Torben Hansen 9 months ago
- Related to Task #102762: Deprecate GeneralUtility::hmac() added
Updated by Torben Hansen 9 months ago
- Related to Task #103245: Replace GeneralUtility::hmac usage with HashService added
Updated by Julian Lichte 9 months ago
- Related to Task #103251: Replace GeneralUtility::hmac usage in ext:install added
Updated by Christian Kuhn 9 months ago
- Related to Task #103320: Remove internal declaration for hashService property in actionController added
Updated by Christian Kuhn 9 months ago
- Related to Task #103248: Replace GeneralUtility::hmac usage in ext:core added
Updated by Christian Kuhn 9 months ago
- Related to Task #103249: Replace GeneralUtility::hmac usage in ext:form added
Updated by Christian Kuhn 9 months ago
- Related to Task #103247: Replace GeneralUtility::hmac usage in ext:backend added