Skip to content
This repository was archived by the owner on Aug 4, 2026. It is now read-only.

fix(security): clear Bucket-B (ADR-023 + auth/routing) - #47

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/bucket-b-adr023
May 26, 2026
Merged

rubenvdlinde merged 1 commit into
developmentfrom
fix/bucket-b-adr023

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

  • Gate-5 route-auth: MetricsController::index and SettingsController::load were missing auth attributes (admin-only endpoints with no annotation at all). Added #[AuthorizedAdminSetting(Application::APP_ID)] to both.
  • Gate-7 no-admin-idor (SettingsController::index): Old-style @NoAdminRequired docblock with no body guard. Converted to #[NoAdminRequired] attribute, injected IUserSession, added 401 guard (null-user check). Posture: any logged-in user may read settings — register/schema IDs, isAdmin flag, openregisters availability are non-sensitive SPA initialisation data.
  • Gate-7 no-admin-idor (SettingsController::create): False-positive — the comment text contained the literal string #[NoAdminRequired] which triggered the gate regex. Fixed comment text, added #[AuthorizedAdminSetting(Application::APP_ID)] (correct admin-only posture for a config write endpoint).
  • phpstan-baseline: Added 3 AuthorizedAdminSetting class-string false-positive suppressions (fleet-wide known issue — Application::APP_ID string passed where class-string<IDelegatedSettings> expected; same pattern as decidesk/scholiq).

Gate results

Gate Before After
gate-5 route-auth FAIL (2 findings) PASS
gate-7 no-admin-idor FAIL (2 findings) PASS
All other gates (1–4, 6, 8–18) PASS PASS

Auth posture per method

Controller::method Posture Rationale
MetricsController::index #[AuthorizedAdminSetting] Admin observability endpoint (ADR-006 mandates admin auth)
SettingsController::index #[NoAdminRequired] + 401 guard SPA init data read — non-sensitive, any logged-in user
SettingsController::create #[AuthorizedAdminSetting] Config write — admin only (ADR-005)
SettingsController::load #[AuthorizedAdminSetting] Force re-import config — admin only

Routes changed

None. All route URLs and HTTP verbs are preserved; only auth attributes on controller methods were added/corrected.

ADR-023 kit ported?

No — deskdesk has no user-facing action endpoints (no broadened-RBAC use case). All fixed endpoints are either admin-only (AuthorizedAdminSetting) or simple login-required reads (NoAdminRequired + 401 guard). The full kit (ActionAuthService + ActionMatrixController + ActionAuthMatrix.vue + seed) is not needed here.

Verification

  • All 18 Hydra gates green (post-fix scan)
  • php -l clean on all edited PHP files
  • composer install --ignore-platform-reqs + vendor/bin/phpstan analyse → no errors
  • npm install --legacy-peer-deps && npm run build exits 0 (warnings are pre-existing: floating-vue + bundle size)

Refs #46

Gate-5 route-auth: add #[AuthorizedAdminSetting(Application::APP_ID)] to
MetricsController::index and SettingsController::load (both admin-only
plumbing/config endpoints missing auth attributes).

Gate-7 no-admin-idor:
- SettingsController::index: convert @NoAdminRequired docblock to
  #[NoAdminRequired] attribute + inject IUserSession + add 401 guard;
  posture = any logged-in user may read settings (register/schema IDs,
  isAdmin flag, openregisters availability — non-sensitive SPA init data).
- SettingsController::create: was false-positive — comment text contained
  the literal string #[NoAdminRequired] triggering the gate regex. Fixed
  comment, added #[AuthorizedAdminSetting] (correct admin-only posture).

phpstan-baseline: add 3 AuthorizedAdminSetting class-string false-positives
(fleet-wide known issue; refs decidesk#242, scholiq#169 pattern).

Refs #46
@rubenvdlinde
rubenvdlinde merged commit c570414 into development May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant