Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archiving task fails when tracking failures contain large number of URL params (notify tracking failures) #20422

Open
tagleeson opened this issue Mar 6, 2023 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@tagleeson
Copy link

Expected Behavior

Archive task should complete successfully

Current Behavior

Archive task fails due to the following: parse_str(): Input variables exceeded 1000

Possible Solution

$failures = $this->trackingFailures->getAllFailures();
<- this code could short-circuit to check the configuration before attempting to find the failures.

Steps to Reproduce (for Bugs)

  1. Create a tracking failure on a URL with > 1000 parameters
  2. Attempt to run archiving task

Context

Sometimes there are malicious attempts to access URLs with many parameters, which causes the archiving task to fail when it comes to report the tracking failures. Note that we do not want to increase the parameter limit as suggested, since this is a malicious attempt.

We currently have the configuration setting for notifying tracking failures turned off, but this doesn't fix the issue, as noted above, the code attempts to get the failures before checking the config. It would be nice as a stopgap to avoid the issue by having the configuration switched off.

Your Environment

  • Matomo Version: 4.13.3
@tagleeson tagleeson added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Mar 6, 2023
@sgiehl
Copy link
Member

sgiehl commented Mar 7, 2023

@tagleeson You could try if adding an error suppression (@) on this line would solve the issue:

parse_str($failure['request_url'], $params);

The problem is that parse_str uses the php ini config max_input_vars and if the number of variables in the parsed string exeeds this number a warning is triggered and additional variables will be truncated. As this doesn't matter in this case, simply ignoring the warning might be fine.

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Mar 7, 2023
@sgiehl sgiehl added this to the For Prioritization milestone Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants