Conversation

AttestationServer will no longer be using request tokens as part of CSRF protection. It's far simpler to enforce the Origin header always being present and set to attestation.app for the entire API since we avoid using the GET method for anything:
1
11
Replying to
Removes significantly more code than it appears because there's temporary database migration code to get rid of the requestToken field from the Sessions table and SQLite makes that a bit verbose. Can remove the db migration code any time. Just makes upgrades take multiple steps.
1
2
Entire web API has strict checks for Origin being attestation.app, Content-Type being application/json and Sec-Fetch-Mode/Sec-Fetch-Site being same-origin and Sec-Fetch-Dest being none. Only having static HTML with strict Trusted Types also helps to rule out issues.
1
3
Each of those 3 checks is a full CSRF protection, although that Content-Type check isn't something you would want to rely on by itself. SameSite=Strict session cookie is close to a 4th and covers everything that actually matters but we don't want sessions for non-logged-in users.
3