fix(admin-security): close the bearer-cookie ride; require session for admin gate (0.87.10)
Two follow-ups to 0.87.2 + 0.87.3 from the adversarial review: 1. **CSRF cookie-ride.** Bearer-bypass branch checked Authorization header presence only — an attacker page could mint `Authorization: Bearer junk` and ride the still-attached session cookie. Bypass now requires bearer AND no cookie. Drive the cookie-name comparison off `SESSION_COOKIE_NAME` and split on `=` (not prefix). 2. **`require_can_edit` admin path open to bearer.** Now reads admin authority off an `Option<CurrentSessionUser>` extractor — None on bearer-only requests. Owner-match path still accepts bearer; admin path is cookie-gated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mangalord"
|
||||
version = "0.87.9"
|
||||
version = "0.87.10"
|
||||
edition = "2021"
|
||||
default-run = "mangalord"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user