Exploit databaseDownload repository ZIP
GH-8c7f0e4b0e998904a1d6f7dcd99e3e7d
d-xuan/cve-2024-52510
Sources for CVE-2024-52510
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files7
d-xuan/cve-2024-52510Revision 6c0d89756ae0
- ↑..Parent directory
- AsyncBus.php
- CallableJob.php
- ClosureJob.php
- CommandJob.php
- CronBus.php
- FileAccess.php
- QueueBus.php
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
lib/private/Command/CronBus.php
PHP · 1,350 bytes<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Command;
use Laravel\SerializableClosure\SerializableClosure;
use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\IJobList;
use OCP\Command\ICommand;
class CronBus extends AsyncBus {
public function __construct(
private IJobList $jobList,
) {
}
protected function queueCommand($command): void {
$this->jobList->add($this->getJobClass($command), $this->serializeCommand($command));
}
/**
* @param ICommand|callable $command
* @return class-string<IJob>
*/
private function getJobClass($command): string {
if ($command instanceof \Closure) {
return ClosureJob::class;
} elseif (is_callable($command)) {
return CallableJob::class;
} elseif ($command instanceof ICommand) {
return CommandJob::class;
} else {
throw new \InvalidArgumentException('Invalid command');
}
}
/**
* @param ICommand|callable $command
* @return string
*/
private function serializeCommand($command): string {
if ($command instanceof \Closure) {
return serialize(new SerializableClosure($command));
} elseif (is_callable($command) or $command instanceof ICommand) {
return serialize($command);
} else {
throw new \InvalidArgumentException('Invalid command');
}
}
}