# proof: admin-gate (mutation check) date: 2026-11-07T23:28:12Z commit: a39b63bf1620862b8e145b537deede01fc8f48bf, with the planted change below in proxy.ts (not committed) command: npm run build && npm run proof:admin-gate expected: exit 1 on the forged POSTs the planted change lets past the proxy, and nothing else planted change (the proxy lets every POST to /admin through): diff --git a/proxy.ts b/proxy.ts index 3d81f2a..0fe1cf1 100644 --- a/proxy.ts +++ b/proxy.ts @@ -24,7 +24,7 @@ export default function proxy(request: NextRequest) { // The review page is private and English-only: password first, no locale. const { pathname } = request.nextUrl; if (pathname === "/admin" || pathname.startsWith("/admin/")) { - if (isAdmin(request.headers.get("authorization"))) return NextResponse.next(); + if (isAdmin(request.headers.get("authorization")) || request.method === "POST") return NextResponse.next(); return new NextResponse("Password required.", { status: 401, headers: { "WWW-Authenticate": ADMIN_REALM } }); } output: server: next start on http://localhost:3226 (local production build), DATABASE_URL at db.invalid node: v26.13.0 passwords: random per run, not printed (lengths 11 and 24) ## FORUM_ADMIN_PASSWORD blank (one space) GET /admin, no password -> 401 refused, ok GET /admin, a 24-char password -> 401 refused, ok POST /admin server action, no password -> 400 FAIL ## FORUM_ADMIN_PASSWORD 11 characters (under the 12 minimum) GET /admin, the right 11-char password -> 401 refused, ok POST /admin server action, right password -> 400 FAIL ## FORUM_ADMIN_PASSWORD 24 characters GET /admin, no Authorization header -> 401 refused, ok GET /admin, wrong password -> 401 refused, ok GET /admin, right password with one char dropped -> 401 refused, ok GET /admin, right password plus one char -> 401 refused, ok GET /admin, empty password -> 401 refused, ok GET /admin, not base64 -> 401 refused, ok GET /admin, Bearer scheme with the password -> 401 refused, ok GET /admin/anything, no password -> 401 refused, ok POST /admin server action, no password -> 400 FAIL POST /admin server action, wrong password -> 400 FAIL GET /admin, right password, user robert -> 500 past the gate, ok (the page ran; its database call failed, as expected) GET /admin, right password, any other user -> 500 past the gate, ok (the page ran; its database call failed, as expected) ## Result FAIL: 4 finding(s) POST /admin server action, no password: status 400, realm none, page text not shown POST /admin server action, right password: status 400, realm none, page text not shown POST /admin server action, no password: status 400, realm none, page text not shown POST /admin server action, wrong password: status 400, realm none, page text not shown exit: 1