From bde1c768983e575f19a487ca066149a4241c2b71 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Thu, 23 Sep 2021 20:19:06 -0400 Subject: [PATCH] security: cross-site request forgery - huntr bounty --- resources/views/Staff/command/index.blade.php | 72 ++++++++++++++----- routes/web.php | 20 +++--- 2 files changed, 64 insertions(+), 28 deletions(-) diff --git a/resources/views/Staff/command/index.blade.php b/resources/views/Staff/command/index.blade.php index 575905bbe8..61ddba58a1 100644 --- a/resources/views/Staff/command/index.blade.php +++ b/resources/views/Staff/command/index.blade.php @@ -40,8 +40,12 @@

This commands enables maintenance mode while whitelisting only you IP Address.

- Run - Command +
+ @csrf + +
@@ -54,8 +58,12 @@

This commands disables maintenance mode. Bringing the site backup for all to access.

- Run - Command +
+ @csrf + +
@@ -68,8 +76,12 @@

This commands clears your sites cache. This cache depends on what driver you are using.

- Run - Command +
+ @csrf + +
@@ -84,8 +96,12 @@ Clear View Cache

This commands clears your sites compiled views cache.

- Run - Command +
+ @csrf + +
@@ -97,8 +113,12 @@ Clear Route Cache

This commands clears your sites compiled routes cache.

- Run - Command +
+ @csrf + +
@@ -110,8 +130,12 @@ Clear Config Cache

This commands clears your sites compiled configs cache.

- Run - Command +
+ @csrf + +
@@ -126,8 +150,12 @@ Clear All Cache

This commands clears ALL of your sites cache.

- Run - Command +
+ @csrf + +
@@ -139,8 +167,12 @@ Set All Cache

This commands sets ALL of your sites cache.

- Run - Command +
+ @csrf + +
@@ -152,8 +184,12 @@ Send Test Email

This commands tests your email configuration.

- Run - Command +
+ @csrf + +
diff --git a/routes/web.php b/routes/web.php index 026d83dc10..79cf301a19 100755 --- a/routes/web.php +++ b/routes/web.php @@ -733,16 +733,16 @@ // Commands Route::group(['prefix' => 'commands'], function () { Route::get('/', [App\Http\Controllers\Staff\CommandController::class, 'index'])->name('staff.commands.index'); - Route::get('/maintance-enable', [App\Http\Controllers\Staff\CommandController::class, 'maintanceEnable']); - Route::get('/maintance-disable', [App\Http\Controllers\Staff\CommandController::class, 'maintanceDisable']); - Route::get('/clear-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearCache']); - Route::get('/clear-view-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearView']); - Route::get('/clear-route-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearRoute']); - Route::get('/clear-config-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearConfig']); - Route::get('/clear-all-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearAllCache']); - Route::get('/set-all-cache', [App\Http\Controllers\Staff\CommandController::class, 'setAllCache']); - Route::get('/clear-compiled', [App\Http\Controllers\Staff\CommandController::class, 'clearCompiled']); - Route::get('/test-email', [App\Http\Controllers\Staff\CommandController::class, 'testEmail']); + Route::post('/maintance-enable', [App\Http\Controllers\Staff\CommandController::class, 'maintanceEnable']); + Route::post('/maintance-disable', [App\Http\Controllers\Staff\CommandController::class, 'maintanceDisable']); + Route::post('/clear-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearCache']); + Route::post('/clear-view-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearView']); + Route::post('/clear-route-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearRoute']); + Route::post('/clear-config-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearConfig']); + Route::post('/clear-all-cache', [App\Http\Controllers\Staff\CommandController::class, 'clearAllCache']); + Route::post('/set-all-cache', [App\Http\Controllers\Staff\CommandController::class, 'setAllCache']); + Route::post('/clear-compiled', [App\Http\Controllers\Staff\CommandController::class, 'clearCompiled']); + Route::post('/test-email', [App\Http\Controllers\Staff\CommandController::class, 'testEmail']); }); // Flush System