release: v0.12.0 (#520)

Forty-one commits since v0.11.0. See CHANGELOG.md for the full list and the upgrade notes.
This commit is contained in:
Ralksta
2026-08-23 23:18:14 +02:00
committed by GitHub
parent 2f546f440d
commit 10ec68f493
119 changed files with 6888 additions and 758 deletions

View File

@@ -78,8 +78,24 @@ export function createAdminToken(): string {
return `${data}.${sig}`;
}
/**
* Upper bound on a session token, well above the ~200 characters a real one
* needs. A token that long is not one we issued, so rejecting it early costs a
* legitimate visitor nothing.
*
* The work being avoided is modest and worth stating honestly: the base64url
* decode below only runs once the HMAC matches, which an attacker cannot
* produce — so the unbounded part is the HMAC over the token itself, and the
* server's own header limit already caps how much of it can arrive. This is
* hygiene at the boundary rather than a fix for a reachable exhaustion.
* Reported as #505.
*/
const MAX_TOKEN_LENGTH = 512;
/** Verify a session token. Returns true if valid. */
export function verifyAdminToken(token: string): boolean {
if (token.length > MAX_TOKEN_LENGTH) return false;
const parts = token.split('.');
if (parts.length !== 2) return false;