Merge commit 'refs/security-review/pr849' into HEAD

# Conflicts:
#	src/server/service/review-consent-http.ts
This commit is contained in:
Thomas Durieux committed 2026-10-08 16:26:12 +00:00
commit eb4fbb6b15
165 files changed
+16267 -22725

No files matched your search

+19
View File
@@ -188,6 +188,25 @@ export function createReviewConsentRouter(
}
});
router.use(express.json({ limit: 12288, strict: true, inflate: false }));
// Uploads can outlive the session checked before body parsing. Revalidate
// before any provider call or consent write, not only before the response.
router.use(async (req, res, next) => {
try {
const actor = res.locals.consentActor as Context;
const fresh = await current(req);
if (res.destroyed || res.headersSent || res.locals.consentSignal.aborted)
return;
if (
!fresh ||
fresh.accountId !== actor.accountId ||
fresh.sessionId !== actor.sessionId
)
return reject(res, 401, "unauthorized");
next();
} catch {
reject(res, 503, "unavailable");
}
});
router.post(["/preview", "/confirm", "/handoff"], async (req, res) => {
const actor = res.locals.consentActor as Context;
try {