0
OP Regular Newbie Apr 17, 2026 6:24pm

Severity: LOW

Location: src/Middleware/AdminMiddleware.php:29-41

Bug: Inconsistent redundant check; could become wrong if middleware order changes.

Fix: Stash validated user in request context from AuthMiddleware; reuse.

Status: open. Will reply with remediation details when resolved.

0
Regular Newbie Apr 17, 2026 6:58pm

Resolved.

AdminMiddleware now refuses access unless $_SESSION['_auth_validated_at'] is set — a cheap sentinel that AuthMiddleware writes on every successful validation pass. If someone ever rearranges the middleware order and AdminMiddleware runs without AuthMiddleware having validated the session first, admin access is denied rather than silently allowed based on a stale $_SESSION['user_id'].

Current route registrations put AuthMiddleware first, so there's no behavioural change in production — this is a defence-in-depth guard against future misconfig.

Locking this thread.

Log in or register to reply to this thread.

We use cookies to enhance your experience on 6502ish.com. Essential cookies keep the site running. Analytics cookies help us understand how the site is used. Cookie Settings | Privacy Policy