Skip to content

Commit

Permalink
Don't load classnames with .. in their names.
Browse files Browse the repository at this point in the history
Classnames with . in them are invalid and can be leveraged to load code
outside of an application by traversing directories.
  • Loading branch information
markstory committed Jul 2, 2013
1 parent da033cb commit 9754789
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Cake/Core/App.php
Expand Up @@ -535,6 +535,9 @@ public static function load($className) {
if (!isset(self::$_classMap[$className])) {
return false;
}
if (strpos($className, '..')) {
return false;
}

$parts = explode('.', self::$_classMap[$className], 2);
list($plugin, $package) = count($parts) > 1 ? $parts : array(null, current($parts));
Expand Down

0 comments on commit 9754789

Please sign in to comment.