Skip to content

Commit

Permalink
security: cross-site request forgery
Browse files Browse the repository at this point in the history
- huntr bounty
  • Loading branch information
HDVinnie committed Sep 23, 2021
1 parent 5b978cc commit 49cb0af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions resources/views/torrent/torrent.blade.php
Expand Up @@ -684,10 +684,12 @@ class="btn btn-primary btn-xs" role="button">
</a>

@if ($torrent->featured == 0)
<a href="{{ route('torrent_feature', ['id' => $torrent->id]) }}"
class="btn btn-default btn-xs" role="button">
<i class="{{ config('other.font-awesome') }} fa-certificate"></i> @lang('torrent.feature')
</a>
<form role="form" method="POST" action="{{ route('torrent_feature', ['id' => $torrent->id]) }}" style="display: inline-block;">
@csrf
<button type="submit" class="btn btn-xs btn-default">
<i class='{{ config('other.font-awesome') }} fa-certificate'></i> @lang('torrent.feature')
</button>
</form>
@else
<a href="{{ route('torrent_revokefeature', ['id' => $torrent->id]) }}"
class="btn btn-danger btn-xs" role="button">
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Expand Up @@ -272,7 +272,7 @@
Route::get('/{id}/torrent_doubleup', [App\Http\Controllers\TorrentController::class, 'grantDoubleUp'])->name('torrent_doubleup');
Route::get('/{id}/bumpTorrent', [App\Http\Controllers\TorrentController::class, 'bumpTorrent'])->name('bumpTorrent');
Route::get('/{id}/torrent_sticky', [App\Http\Controllers\TorrentController::class, 'sticky'])->name('torrent_sticky');
Route::get('/{id}/torrent_feature', [App\Http\Controllers\TorrentController::class, 'grantFeatured'])->name('torrent_feature');
Route::post('/{id}/torrent_feature', [App\Http\Controllers\TorrentController::class, 'grantFeatured'])->name('torrent_feature');
Route::get('/{id}/torrent_revokefeature', [App\Http\Controllers\TorrentController::class, 'revokeFeatured'])->name('torrent_revokefeature');
Route::get('/{id}/reseed', [App\Http\Controllers\TorrentController::class, 'reseedTorrent'])->name('reseed');
Route::post('/{id}/tip_uploader', [App\Http\Controllers\BonusController::class, 'tipUploader'])->name('tip_uploader');
Expand Down

0 comments on commit 49cb0af

Please sign in to comment.