1 unresolved comment The owner has to answer or resolve it. Show the first one

Review main Ready for review

98018[TASK] Check backend access of a user in one class

Matthias Vogel CR 0 V 0 Hard +514 −19 updated 11/25/26, 13:48

Commit message

The frontend accepts the backend user of a request only after these
checks: [BE][IPmaskList], [BE][lockSSL], [BE][adminOnly] and
BackendUserAuthentication::isUserAllowedToLogin(). The checks are in
the protected method BackendUserAuthenticator::isAuthenticated() and
in FrontendBackendUserAuthentication::backendCheckLogin(). Code
outside the middleware cannot use the IP and HTTPS checks. The checks
return only true or false, so a caller cannot tell why the check
denies the backend user.

The new internal class BackendAccessCheck makes these checks in one
place and returns a BackendAccessDecision. A denial contains a
BackendAccessDenialReason and a message. isAuthenticated() stays and
delegates to the new class, so subclasses keep working. The behaviour
does not change.

FrontendBackendUserAuthentication::backendCheckLogin() stays, because
it is a public method. It delegates to the new method
BackendAccessCheck::checkBackendUser(). This method does not check the
IP address and HTTPS, because backendCheckLogin() never made these two
checks. The behaviour of backendCheckLogin() does not change. The core
does not call it anymore.

The backend middlewares LockedBackendGuard and
ForcedHttpsBackendRedirector stay unchanged. They run before the
authentication, when no backend user exists. They send an error
response or a redirect.

The preview of hidden pages across site domains (#110664) must make the
same decision for a backend user without a session cookie.
Show more Show less

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 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/18/98018/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/18/98018/2 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 2

Issues 2

Files 8

Review log 35

  1. Matthias Vogel uploaded patch set 1 11/25/26, 13:22

  2. core-ci voted on patch set 1 V -1 11/25/26, 13:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115450

  3. Benni Mack commented on patch set 1 11/25/26, 13:30

    Unresolved

    hey, I'm currently building the Authentication / Permission Layer on top of symfony/security - based on PDP and voters, as well as moving this to Security instead of "Authentication". This seems to be contradicting the current work as you see https://review.typo3.org/c/Packages/TYPO3.CMS/+/95784 - can we build on top of this?
  4. Matthias Vogel uploaded patch set 2 V -1 11/25/26, 13:41

  5. core-ci voted on patch set 2 V +1 11/25/26, 13:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115458