#106345Sign extbase __identity field value with HMAC
Description
It is documented in the Security Guidelines, that the extbase __identity field can be manipulated. In order to prevent identity field manipulation, a HMAC should be appended to the field value.
Reviews 1
Files 1
History 716
-
Torben Hansen changed subject
Sign extbase __identity field with HMACSign extbase __identity field value with HMAC <span data-processor="relativetime" data-value="2025-03-09T13:31:35+00:00" > 03/09/25, 13:31 </span> -
Gerrit Code Review pushed patch set 1 for main to change 88543 status
NewUnder Review <span data-processor="relativetime" data-value="2025-03-09T13:43:44+00:00" > 03/09/25, 13:43 </span> -
Gerrit Code Review pushed patch set 2 for main to change 88543 <span data-processor="relativetime" data-value="2025-03-09T13:46:44+00:00" > 03/09/25, 13:46 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 88543 <span data-processor="relativetime" data-value="2025-03-09T17:39:22+00:00" > 03/09/25, 17:39 </span>
-
Torben Hansen commented <span data-processor="relativetime" data-value="2025-03-23T13:57:37+00:00" > 03/23/25, 13:57 </span>
Thanks for your feedback!
I totally agree that this change does not resolve the underlying requirement for extension developers to implement proper access checks for actions like
show,edit,update, ordelete— especially in applications with authenticated users and varying access permissions. Ensuring authorization at the application level remains essential and cannot be “solved” by this patch.The primary goal of this patch is to prevent manipulation of the hidden
__identityfield in forms generated via f:form and similar ViewHelpers. By signing the field value with a HMAC, we can make sure that it cannot be arbitrarily changed to another UID without triggering an exception during property mapping. This hardens a common attack vector where attackers could manipulate the UID in the hidden field and cause unintended data modification — assuming a missing or incomplete access check on the application side.To address your concern: yes, the HMAC is publicly visible and not a secret per se—but it is tied to the specific object, meaning the HMAC cannot be reused for different object identifiers.
This change should be seen as a hardening measure to close one of the more trivial manipulation possibilities. It is not a general protection against IDOR and it doesn’t replace access checks in any way. But it does raise the bar for attackers and helps mitigate accidental misconfigurations in custom access check implementations.
-
Helmut Hummel commented <span data-processor="relativetime" data-value="2025-04-10T15:44:59+00:00" > 04/10/25, 15:44 </span>
Torben Hansen wrote in #note-6:
> The primary goal of this patch is to prevent manipulation of the hidden
__identityfield in forms generated via f:form and similar ViewHelpers. By signing the field value with a HMAC, we can make sure that it cannot be arbitrarily changed to another UID without triggering an exception during property mapping. This hardens a common attack vector where attackers could manipulate the UID in the hidden field and cause unintended data modification — assuming a missing or incomplete access check on the application side.
>
> To address your concern: yes, the HMAC is publicly visible and not a secret per se—but it is tied to the specific object, meaning the HMAC cannot be reused for different object identifiers.So this approach does not cover authorisation checks, when authorized user data is subject to be changed. But then a typical use case is to allow editing of records in a list by generating their edit link, e.g. /edit/record/12
Then this approach generates a valid hmac in the edit form for id 12 for object identifier “record”.
Attacker can then generate arbitrary edit form links with arbitrary valid hmacs (edit/record/42).
There is no way to determine for the system conceptually, whether the ID was sent legitimately or not, without implementing any authorisation check.With that, I’m not sure which is a left over scenario that has improved security by using hmac verification. Can you help out with any, maybe from the things that were fixed in the past?
The only technical scenario would be an edit form, where the UID can not be controlled by the attacker, but except for logged in user prefs (which we agree should come with authorisation checks anyway), I can’t come up with a reasonable use case? Maybe an editor select a single record in the backend, that can be edited in the frontend?
In any case, my fear is, that devs rather think they can count on this check without understanding its limitations, which would make the situation worse (and harder to explain) than the one we have now
-
Gerrit Code Review pushed patch set 4 for main to change 88543 <span data-processor="relativetime" data-value="2025-06-25T09:52:42+00:00" > 06/25/25, 09:52 </span>
-
Gerrit Code Review <span data-processor="relativetime" data-value="2025-06-26T09:27:32+00:00" > 06/26/25, 09:27 </span> Patch set 1 for branch *main* of project *Teams/Security/TYPO3v4-Core* has been pushed to the review server. It is available at https://review.typo3.org/c/Teams/Security/TYPO3v4-Core/+/89913
-
Gerrit Code Review pushed patch set 5 for main to change 88543 <span data-processor="relativetime" data-value="2025-06-26T09:37:00+00:00" > 06/26/25, 09:37 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 88543 <span data-processor="relativetime" data-value="2025-06-26T18:45:34+00:00" > 06/26/25, 18:45 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 88543 <span data-processor="relativetime" data-value="2025-07-04T06:31:14+00:00" > 07/04/25, 06:31 </span>
-
Torben Hansen commented <span data-processor="relativetime" data-value="2025-07-08T14:11:40+00:00" > 07/08/25, 14:11 </span>
Summary of a slack discussion with @helhum:
This patch is intended as a hardening measure for Extbase forms using
<f:form>ViewHelper. Specifically, it aims to prevent trivial manipulation of the hidden__identityfield by signing it with a HMAC. This means that an attacker cannot simply change the UID of an object in a submitted form without triggering a property mapping exception.Important clarifications:
- This change does not replace or remove the need for proper access and authorization checks in actions such as edit, update, or delete.
- It also does not protect routes like
/edit/record/12or GET parameter-based record access, where no form submission with signed data is involved. - The HMAC is tied to the object identifier and context, so it cannot be reused for arbitrary UIDs.
- This is not a generic solution against IDOR (Insecure Direct Object Reference) or BOLA (Broken Object Level Authorization).
- The goal is solely to raise the bar for attackers in cases where developers may have forgotten or improperly implemented access checks, especially when dealing with submitted forms for persisted extbase objects.
The overall intention is to reduce the impact of common developer mistakes by making certain types of attacks more difficult. This is not a comprehensive security mechanism, but a targeted mitigation for a specific, recurring weakness.
-
Helmut Hummel commented and changed attached test_id.zip <span data-processor="relativetime" data-value="2025-07-22T16:26:12+00:00" > 07/22/25, 16:26 </span>
Torben Hansen wrote in #note-13:
> * It also does not protect routes like
/edit/record/12or GET parameter-based record access, where no form submission with signed data is involved.Problem with this is, that the edit form referenced from this URL will generate a valid hmac. And with this hmac, updating the according entity is possible in any edit form that renders an edit action of such entities.
Find attached a simple kickstarted extension with list/edit/update actions. without any access checks, such “default” example code will not benefit of a change with the approach to hmac the identity value.
-
Gerrit Code Review pushed patch set 8 for main to change 88543 <span data-processor="relativetime" data-value="2025-11-12T16:35:56+00:00" > 11/12/25, 16:35 </span>
-
Torben Hansen commented and changed status
Under ReviewRejected <span data-processor="relativetime" data-value="2025-11-17T13:34:43+00:00" > 11/17/25, 13:34 </span>The TYPO3 security team discussed the suggested change on the november 2025 codesprint and decided, that the suggested hardening/signing of the
__identityparameter is not sufficient, because it does not protect against reusing the generated HMAC via GET/POST identity manipulation in context of the current object. Access checks before every extbase action (#107826) call could be a solution to prevent reading/modification of persisted objects on a per user basis.
Here are the reasons, why I think the proposed approach (HMAC) is deceptive:
In sum: it is deceptive, because it actually does make manipulation less accessible on the one hand, but still leaves the door wide open for multiple other attack vectors, which can not be fixed with the concept of using a HMAC