security: Host-Whitelist & Legacy-API-Key-Übergabe härten (H5, M11)
- trustHosts erlaubt nur die konfigurierten Domains (plus localhost/IP für Health-Checks) und verwirft fremde Host-Header, sodass X-Forwarded-Host keine URL-Generierung mehr vergiften kann (H5). - Legacy-API-Keys nur noch per Header (Bearer/X-ApiKey); die alte Query-/Body-Übergabe wird nicht mehr zur Auth akzeptiert, erhält aber weiterhin den 410-Migrationshinweis statt eines opaken 401 (M11). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
6250b0bab4
commit
39e13d6d84
9 changed files with 207 additions and 21 deletions
|
|
@ -20,6 +20,8 @@ class LegacyCompanyController extends Controller
|
|||
|
||||
public function store(Request $request): JsonResponse
|
||||
{
|
||||
abort_unless($request->user()->tokenCan('press-releases:write'), 403);
|
||||
|
||||
try {
|
||||
$validated = $request->validate([
|
||||
'company' => ['required', 'array'],
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ class LegacyContactController extends Controller
|
|||
|
||||
public function store(Request $request, int $company): JsonResponse
|
||||
{
|
||||
abort_unless($request->user()->tokenCan('press-releases:write'), 403);
|
||||
|
||||
$company = Company::withoutGlobalScopes()
|
||||
->whereKey($company)
|
||||
->accessibleBy($request->user())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue