reiern70 opened a new issue, #2008: URL: https://github.com/apache/wicket/issues/2008
## Summary [Device Bound Session Credentials](https://w3c.github.io/webappsec-dbsc/) (DBSC, a W3C WebAppSec editor's draft) lets a server bind a login session to a key pair that the browser keeps in hardware-backed storage. The session is carried by a short-lived cookie, and the browser only gets a new one after it signs a server challenge with that key. A session cookie stolen by infostealer malware then stops working on another machine within minutes. Chrome ships it (Windows first) and Edge is following. Wicket has nothing for this today. This issue proposes an experimental module, `wicket-experimental/wicket-dbsc`, that an application installs with one call and starts with one call after sign-in. ## Why a second cookie The servlet container owns `JSESSIONID`. It lives as long as the HTTP session and cannot be made to expire every few minutes. The module leaves it alone and adds a second, short-lived bound cookie. Once a session is registered, every request on it has to carry a valid bound cookie. A replayed `JSESSIONID` without one is rejected. ## Design - **Install**: one call mounts a registration endpoint and a refresh endpoint and registers a request cycle listener. - **Start**: called after sign-in, after `Session.replaceSession()`. It stores a challenge in the session and adds `Secure-Session-Registration: (ES256 RS256);path="…";challenge="…"` to the current response, whether that is a page, an Ajax response or the redirect after the sign-in form. - **Registration endpoint**: verifies the DBSC proof, a JWT with `typ` `dbsc+jwt`, signed with ES256 or RS256, whose `jti` is the challenge. `alg` `none` is refused. It stores the public key in the Wicket session, answers with the JSON session instructions and sets the bound cookie. - **Refresh endpoint**: checks `Sec-Secure-Session-Id`. A request without a valid proof gets 403 and a fresh `Secure-Session-Challenge`. A valid proof gets a new bound cookie. A session that no longer exists gets `{"continue": false}`, which ends the browser's session. - **Enforcement**: the listener rejects requests on a registered session that do not carry a valid bound cookie. The registration request races with the requests that follow sign-in, so enforcement starts when the browser first presents the cookie, and after a short grace period at the latest. - **No new dependency**: signatures are checked with the JDK (`SHA256withECDSAinP1363Format`, `SHA256withRSA`). - **Fallback**: browsers without DBSC ignore the header. Their sessions keep working, unbound. ## Open questions - The spec is still an editor's draft and has changed during the origin trial (header names among other things). Its own example puts the `jwk` in the JWT payload, while §9.10 puts it in the JWT header. The module accepts both. - What to do with a request that lacks the bound cookie: reject it (the default) or invalidate the session. - Whether browsers defer WebSocket handshakes until the cookie is refreshed, and which platforms support DBSC without a TPM. This needs testing in real browsers. - Clusters: the binding lives in the Wicket session and replicates with it. Races between nodes during cookie rotation are not handled. - Federated sessions (the `provider_*` parameters) and site-wide scope (`include_site`) are out of scope for a first version. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
