Skip to content

Commit

Permalink
Merge pull request from GHSA-r67m-m8c7-jp83
Browse files Browse the repository at this point in the history
Prevent allowing reinstall by clearing the app_name setting
  • Loading branch information
sedan07 authored Aug 27, 2021
2 parents ff63d1c + ee7781e commit 120bd19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/Http/Controllers/Dashboard/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@ public function postSettings()
$settingValue = rtrim($settingValue, '/');
}

if ($settingName === 'app_name') {
if (empty($settingValue)) {
continue;
}
}

$setting->set($settingName, $settingValue);
}
} catch (Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/ReadyForUse.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(Repository $settings)
*/
public function handle(Request $request, Closure $next)
{
if (!$request->is('setup*') && !$this->settings->get('app_name')) {
if (!$request->is('setup*') && $this->settings->get('app_name') === null) {
return cachet_redirect('setup');
}

Expand Down

0 comments on commit 120bd19

Please sign in to comment.