Hacker News new | ask | show | jobs
by perlgeek 4263 days ago
IMHO this is the direct result of conflating arrays/list and hashes/dictionaries into a single thing on the programming language level.

Sure, careful programming would have avoided that, but if the two concept were fundamentally different types, this bug would be impossible.

3 comments

ruby and perl web frameworks have had similar problems when receiving data it could be an array or a hash or a string and people assumed it was string but in the other cases it would cause sql injection or weird behaviour.
The ability to take in arrays as request variables where users don't expect them is a giant headache with PHP.
Surely you should only foreach() if you're working with a hash/map? Would a classic for($c=0, $l=count($arr); $c<$l; $c++) suffer from any similarly-exploitable problem?