Bug #87845

cacheHash.excludedParameters will be ignore when Enhancer is called

Added by Alexey Atsyn 9 months ago. Updated 29 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Start date:
2019-03-05
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

We detected a problem: when system called PluginEnhancer he wil call exception in the \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::reqCHash function.
I've checked the code and find next:
PageArguments return all query parameters not from config as is and those parameters not compare with cacheHash.excludedParameters

We wrote next patch but don;;t sure is it correct solution:

    public function reqCHash()
    {
        $skip = false;
        if ($this->pageArguments !== null) {
            /** @var \TYPO3\CMS\Frontend\Page\CacheHashCalculator $cacheHashCalculator */
            $cacheHashCalculator = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\CacheHashCalculator::class);
            $relevantParameters = $cacheHashCalculator->getRelevantParameters(
                http_build_query($this->pageArguments->getDynamicArguments(), '', '&', PHP_QUERY_RFC3986)
            );
            $skip = empty($relevantParameters);
        }
        ...

P.S.: we detected this problem with fbclid


Related issues

Related to TYPO3 Core - Bug #87981: 404 Page when Google Analytics Parameters (utm_source) in URL Closed 2019-03-22
Related to TYPO3 Core - Bug #88370: Extbase detail view URL call breaks by attaching params from [FE][cacheHash][excludedParameters] if page is uncached Closed 2019-05-16
Duplicated by TYPO3 Core - Bug #88070: URL with extbase action and additional query string throws error using route enhancer Closed 2019-04-04

Associated revisions

Revision e94aefa0 (diff)
Added by Grigory Rechkin 29 days ago

[BUGFIX] Respect cacheHash excludedParameters in TSFE::reqCHash()

  • Requests with a parameter from "excludedParameters" settings
    will not raise a cHash comparison error
  • Requests with configured enhancers will not raise the
    "Page ID is missing" error when used with additional parameters

Resolves: #87845
Releases: master, 9.5
Change-Id: I4312aa790d6660e0e7f9214841fe3d27c5f1b4ea
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Tested-by: Benni Mack <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Benni Mack <>

Revision bce22ba7 (diff)
Added by Grigory Rechkin 29 days ago

[BUGFIX] Respect cacheHash excludedParameters in TSFE::reqCHash()

  • Requests with a parameter from "excludedParameters" settings
    will not raise a cHash comparison error
  • Requests with configured enhancers will not raise the
    "Page ID is missing" error when used with additional parameters

Resolves: #87845
Releases: master, 9.5
Change-Id: I4312aa790d6660e0e7f9214841fe3d27c5f1b4ea
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62221
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Susanne Moog 9 months ago

  • Category changed from Frontend to Link Handling, Site Handling & Routing

#2 Updated by Gerrit Code Review 9 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#3 Updated by Gerrit Code Review 9 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#4 Updated by Gerrit Code Review 9 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#5 Updated by Gerrit Code Review 9 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#6 Updated by Gerrit Code Review 9 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#7 Updated by Gerrit Code Review 9 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#8 Updated by Gerrit Code Review 9 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#9 Updated by Gerrit Code Review 9 months ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#10 Updated by Gerrit Code Review 9 months ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#11 Updated by Gerrit Code Review 9 months ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#12 Updated by Grigory Rechkin 9 months ago

  • Related to Bug #87981: 404 Page when Google Analytics Parameters (utm_source) in URL added

#13 Updated by Grigory Rechkin 8 months ago

  • Related to Bug #88070: URL with extbase action and additional query string throws error using route enhancer added

#14 Updated by Gerrit Code Review 8 months ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#15 Updated by Grigory Rechkin 7 months ago

  • Related to Bug #88370: Extbase detail view URL call breaks by attaching params from [FE][cacheHash][excludedParameters] if page is uncached added

#16 Updated by Josef Glatz 7 months ago

  • Target version set to Candidate for patchlevel

#17 Updated by Gerrit Code Review 7 months ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#18 Updated by Gerrit Code Review 7 months ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#19 Updated by Helmut Hummel 3 months ago

  • Related to deleted (Bug #88070: URL with extbase action and additional query string throws error using route enhancer)

#20 Updated by Helmut Hummel 3 months ago

  • Duplicated by Bug #88070: URL with extbase action and additional query string throws error using route enhancer added

#21 Updated by Gerrit Code Review 3 months ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#22 Updated by Gerrit Code Review 3 months ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#23 Updated by Gerrit Code Review 3 months ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#24 Updated by Gerrit Code Review 3 months ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#25 Updated by Gerrit Code Review 3 months ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#26 Updated by Gerrit Code Review 2 months ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#27 Updated by Robert von Hackwitz 2 months ago

Hi, same problem with default [FE][cacheHash][excludedParameters] = utm_source,utm_medium,pk_kwd,utm_source,utm_medium,utm_campaign,utm_term,utm_content,gclid,fbclid
and tx_news

Urls like https://sitename/read-news/news-path-segment?utm_source=xxx&utm_medium=twitter (as example) generates
error {"exception":"TYPO3\\CMS\\Core\\Error\\Http\\PageNotFoundException: Request parameters could not be validated (&cHash empty)

Patch doesn't works

#28 Updated by Alexander Opitz 2 months ago

Hi Robert,

do you overwrite this setting in your LocalConfiguration/AdditionalConfiguration? If yes, do you use a string or an array for that? I ask, cause your line (copied from install tool?) looks a bit confuse, it misses the L and pk_compaign parameter and utm_source/medium is doubled.

#29 Updated by Robert von Hackwitz 2 months ago

Hi Alexander, thank you for your kind response.
You're right: [FE][cacheHash][excludedParameters] is wrong.
I have restored default settings [FE][cacheHash][excludedParameters] = L,pk_campaign,pk_kwd,utm_source,utm_medium,utm_campaign,utm_term,utm_content,gclid,fbclid

but the problem persist

#30 Updated by Alexander Opitz 2 months ago

Hi Robert,

can you show the configuration how it is written in your LocalConfiguration.php?

#31 Updated by Robert von Hackwitz 2 months ago

Hi Alexander,
here's the configuration
'FE' => [
'cacheHash' => [
'excludedParameters' => [
'L',
'pk_campaign',
'pk_kwd',
'utm_source',
'utm_medium',
'utm_campaign',
'utm_term',
'utm_content',
'gclid',
'fbclid'
],
],
'debug' => true,
'disableNoCacheParameter' => true,
'loginSecurityLevel' => 'normal',
'pageNotFoundOnCHashError' => true,
'passwordHashing' => [
'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2iPasswordHash',
'options' => [],
],
],

#32 Updated by Alexander Opitz 2 months ago

Ok, looks fine :-)
So, you are using the given patch on a TYPO3 from git master?

#33 Updated by Gerrit Code Review 29 days ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#34 Updated by Gerrit Code Review 29 days ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60296

#35 Updated by Gerrit Code Review 29 days ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62221

#36 Updated by Gerrit Code Review 29 days ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62221

#37 Updated by Grigory Rechkin 29 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF