summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-12-08 10:01:09 +0100
committerLukas Reschke <lukas@owncloud.com>2015-12-08 10:03:22 +0100
commit715f89a9d9dc8373a85a23f93d093dee2686e232 (patch)
tree28b4efbb9110186cecb9b2ecab869c2615283495 /lib
parentd6276faff6fafe88f59953cb61f9411038be23e9 (diff)
downloadnextcloud-server-715f89a9d9dc8373a85a23f93d093dee2686e232.tar.gz
nextcloud-server-715f89a9d9dc8373a85a23f93d093dee2686e232.zip
Sanitize the appId passed to `findAppInDirectories`
Would have prevented quite some security bugs in the past. Nice hardening for now.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/app.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 145517e218a..abf12264c58 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -474,9 +474,13 @@ class OC_App {
* search for an app in all app-directories
*
* @param string $appId
- * @return mixed (bool|string)
+ * @return false|string
*/
protected static function findAppInDirectories($appId) {
+ $sanitizedAppId = self::cleanAppId($appId);
+ if($sanitizedAppId !== $appId) {
+ return false;
+ }
static $app_dir = array();
if (isset($app_dir[$appId])) {