mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-20 00:15:06 +00:00
fix(auth): prevent cross-tenant IDOR in resource cloning (#8613)
This commit is contained in:
5 files changed
+101
-19
No files matched your search
@@ -191,6 +191,10 @@ function clone_application(Application $source, $destination, array $overrides =
|
||||
$uuid = $overrides['uuid'] ?? (string) new Cuid2;
|
||||
$server = $destination->server;
|
||||
|
||||
if ($server->team_id !== currentTeam()->id) {
|
||||
throw new \RuntimeException('Destination does not belong to the current team.');
|
||||
}
|
||||
|
||||
// Prepare name and URL
|
||||
$name = $overrides['name'] ?? 'clone-of-'.str($source->name)->limit(20).'-'.$uuid;
|
||||
$applicationSettings = $source->settings;
|
||||
|
||||
Reference in new issue
Block a user