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

Invoice creation failure and corruption due to max_input_vars #2504

Closed
kevinoid opened this issue Nov 14, 2018 · 0 comments
Closed

Invoice creation failure and corruption due to max_input_vars #2504

kevinoid opened this issue Nov 14, 2018 · 0 comments

Comments

@kevinoid
Copy link

After clicking "Invoice" from the "Tasks" tab of the "View Client" page with more than 78 tasks selected, then clicking "Save Draft" on the "New Invoice" page without making any changes, a new client is created with all fields blank, a new invoice is created for that client, and most but not all selected tasks are reassigned to the new blank client.

When pressing "Save Draft", the following message appears in the Apache error log:

[Wed Nov 14 17:48:32.094935 2018] [:error] [pid 9081] [client 192.168.0.5] PHP Warning:  Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: https://example.com/invoices/create/3

Based on some ad-hoc logging, it appears that the client.public_id and client.name request variables were dropped, which may be the source of the behavior described above. Increasing max_input_vars in php.ini increases the number of tasks which can be selected before the issue occurs.

You may want to consider restructuring the request to use fewer variables (the PHP default limit is 1000), setting max_input_vars, suhosin.post.max_vars, and suhosin.request.max_vars in .htaccess, detecting requests which likely surpassed the limit to reject/warn about it, and/or adding code to prevent client/invoice/task corruption from bad requests.

Thanks for considering,
Kevin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants