Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
93937[TASK] Let reaction itself verify request
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 5
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/37/93937/5 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/37/93937/5 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Issues 1
Files 2
Review log 611
-
Soren Malling uploaded patch set 1 05/03/26, 20:06
-
core-ci voted on patch set 1 V -1 05/03/26, 20:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101439
-
Toke Bundgaard uploaded patch set 2
V -105/05/26, 13:16 -
core-ci voted on patch set 2 V -1 05/05/26, 13:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101555
-
Soren Malling updated the commit message in patch set 3
V -105/06/26, 07:37 -
core-ci voted on patch set 3 V -1 05/06/26, 07:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101598
-
Toke Bundgaard uploaded patch set 4
V -105/06/26, 09:20 -
core-ci voted on patch set 4 V +1 05/06/26, 09:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101605
-
Toke Bundgaard updated the commit message in patch set 5
V +105/06/26, 10:30 -
core-ci voted on patch set 5 V +1 05/06/26, 10:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101609
-
Oli Bartsch commented on patch set 5 09/17/26, 15:12
ReactionResolver.php:65UnresolvedThe repository lookup now happens before any input validation. Previously `$secretKey === '' || !Uuid::isValid($reactionIdentifier)` short-circuited first, so a request with no `x-api-key` or a garbage identifier never reached the database. Every unauthenticated POST to `/typo3/reaction/<anything>` now runs a query.ReactionResolver.php:70Unresolved`ReactionHandler::handleReaction()` resolves the very same reaction from the registry again. Either pass the resolved `$reaction` into the handler, or leave the resolution to the handler and only ask the registry here for the `VerifyRequestInterface` check. As it stands the handler's null branch is dead code.ReactionResolver.php:72UnresolvedThis exception is thrown outside the `try`/`catch` at line 96, so nothing converts it into a response. Before this patch the same condition was reached inside `ReactionHandler::handleReaction()` (code `1662458842`) and caught. producing a clean JSON 404. Now a `sys_reaction` record whose `reaction_type` is no longer registered turns into a 500 exception. It is also thrown before any secret check, so an unauthenticated request can trigger it. Please return `$this->getFailureResponse('No reaction found for given reaction type', $request, 404)` instead, and only after verification has passed.ReactionResolver.php:76Unresolved`verify()` receives only the request, not `$reactionInstruction`.ReactionResolver.php:81UnresolvedThis `Uuid::isValid()` check can no longer fail in practice: the record was already fetched by this exact identifier at line 65, and `sys_reaction.identifier` always holds a UUID. It was a meaningful pre-filter in its old position; here it is a no-op. Move the validation back before the lookup.VerifyRequestInterface.php:22UnresolvedThis interface is public API for extension authors but carries no docblock stating that, while the surrounding classes are all marked `@internal`. Please add a class docblock explaining when to implement it and what the security contract is: implementing it disables the `x-api-key` check entirely for that reaction type, so a `verify()` that returns `true` too eagerly opens the endpoint. That warning belongs both here and in the changelog.VerifyRequestInterface.php:22Unresolved`VerifyRequestInterface` reads as an imperative. `RequestVerificationInterface` or `VerifiesRequestInterface` would sit better next to `ReactionInterface`.VerifyRequestInterface.php:27Unresolved```suggestion public function verify(ServerRequestInterface $request, ReactionInstruction $reaction): bool; ``` Without the instruction the interface cannot implement the scenario the issue describes.
Unresolved