The problem is that the attacker is generating the strings that go into the hash table. He chooses strings that collide and produce the worst-case performance. The worst-case performance isn't likely in normal use, but is easy for a malicious attacker to construct the strings.
There are some limits on how many strings can be inserted by an attacker. CGI.pm limits POST sizes. With a 1 MB limit and 10 bytes per string, that is 100,000 strings all trying to go into one hash bucket. Instead of taking a fraction of a second to parse, it takes the web server thousands of seconds.
It would be possible to add checks to prevent this attack. One easy way is limit the number of parameters in CGI.pm. 1000 is probably a reasonable limit. The proper solution is change the Perl hashing function so it isn't deterministic. If the attacker can't predict the behavior, they can't the worst-case strings.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||