|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60876 max_input_vars corrupt posted data
Submitted: 2012-01-25 10:03 UTC Modified: 2012-02-03 21:34 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: jiri dot reischig at ecn dot cz Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.9 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
37 + 15 = ?
Subscribe to this entry?

 [2012-01-25 10:03 UTC] jiri dot reischig at ecn dot cz
When you post some data to the php script where are more variables than limit in max_input_vars the php script does not get any information that php don't put any of data to the system variables (for example $_REQUEST[]).
There is only "PHP Warning" generated but the php script is still running without any problem with corrupted dataset from post.

Solution will be to stop executing the script if max_input_vars is reached.

Without stoping the script you are working with currupted dataset and you can make some data inconsistencies in your aplication without any knowledge.

Test script:
max_input_vars = 1

sending post: test.php?a=1&b=2&c=3


Expected result:
Stop the script if max_input_vars is reached.

Actual result:
    [a] => 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-25 17:29 UTC] carloschilazo at gmail dot com
I'm not sure as it would have to absolutley halt the execution; 

Some routines maybe in the script to handle those kind of situations, hence only a 
warning is issued
 [2012-01-30 11:49 UTC] jiri dot reischig at ecn dot cz
I think that halt the execution is good option because there are o lot of existing scripts that do not have any handling warnings and when the script don't halt scripts got corrupted data without any information about it. So corrupted data was stored to the database for example.
 [2012-02-03 21:34 UTC]
-Status: Open +Status: Not a bug
 [2012-02-03 21:34 UTC]
Generally max_input_vars would be set such that it is way above what any normal 
script would expect to receive, so I am not sure this is a real concern. If you 
really do have scripts that take thousands of GET/POST variables, you will need 
to increase this setting and do some input validation. This isn't any different 
from when you didn't have this limit. At these levels there are various arbitrary 
browser and server limits that could be cutting this off without PHP's knowledge, 
so again proper input validation is the only right answer here.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 23:01:30 2024 UTC