laravel/laravel — Issue #218: URI Segments
Author: mybigman
Created: 2011-12-28 07:28:41+00:00
State: open

Its might be possible to lead to some sort of buffer overflow by using the maximum segments permissible (bytes) and sending multiple requests at once.

example.com/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/.../max/ etc

A hard coded segment length or user config controlled would be perferred.

protected function controller_key($segments)
{
// To find the proper controller, we need to iterate backwards through
// the URI segments and take the first file that matches. That file
// should be the deepest controller matched by the URI.
foreach (array_reverse($segments, true) as $key => $value)
{
$controller = implode('/', array_slice($segments, 0, $key + 1)).EXT;

if (file_exists($path = $this->controllers.$controller))
{
return $key + 1;
}
}
}

@ http://forums.laravel.com/viewtopic.php?id=477