Exploit database

GH-8c7f0e4b0e998904a1d6f7dcd99e3e7d

d-xuan/cve-2024-52510

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-52510

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files7
d-xuan/cve-2024-52510Revision 6c0d89756ae0

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

apps/testing/lib/AlternativeHomeUserBackend.php

PHP · 964 bytes
<?php
/**
 * SPDX-FileCopyrightText: 2016 ownCloud GmbH.
 * SPDX-License-Identifier: AGPL-3.0-only
 */
namespace OCA\Testing;

/**
 * Alternative home user backend.
 *
 * It returns a md5 of the home folder instead of the user id.
 * To configure, need to add this in config.php:
 *	'user_backends' => [
 *			'default' => false, [
 *				'class' => '\\OCA\\Testing\\AlternativeHomeUserBackend',
 *				'arguments' => [],
 *			],
 *	]
 */
class AlternativeHomeUserBackend extends \OC\User\Database {
	public function __construct() {
		parent::__construct();
	}
	/**
	 * get the user's home directory
	 * @param string $uid the username
	 * @return string|false
	 */
	public function getHome($uid) {
		if ($this->userExists($uid)) {
			// workaround to avoid killing the admin
			if ($uid !== 'admin') {
				$uid = md5($uid);
			}
			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
		}

		return false;
	}
}