Skip to content

v4.12.0 — A security pass: the demo's sweep, the device's sign-in, the content policy and a clean Security tab

Choose a tag to compare

@Alexandr-Paleev Alexandr-Paleev released this 23 Oct 07:49
32d9072

The demo's sweep could erase a real account. Opening a demo also erases the demo accounts older than a day, and it took for a demo account any whose address began with demo-. Sign-up is open, by e-mail and through Google, so a person with such an address would have lost the account and every file in it a day after signing up. Production had none: 35 accounts, 3 of them demos. A demo is now recognised by the whole address the demo makes, on example.com, where no address can be confirmed and Google issues none.

The app on a device signs in with PKCE, and takes a code and nothing else from its callback. Sign in with Google comes back to the native shell through a custom scheme, which any app on the device can claim. The implicit flow sent the session itself, Google's refresh token among it, to whichever app answered, and the listener took the tokens any link to the scheme carried. Now the callback brings a code that becomes a session only beside the verifier the app stored when the sign-in began. Neither app is published, so this closes the hole before anyone could use it.

The content policy runs no inline script, names the hosts the app may talk to, and tells Sentry what it refuses. connect-src was https: wss:, which refuses no host; it lists the app's vendors now, with a wildcard where a fork's host differs. gtag.js and Hotjar were said to need inline script; walked through on production with the policy enforced, they run without. And since the policy holds in production only, where a refused PDF preview once went unnoticed for a month, the page reports each kind of refusal to Sentry, by directive and origin, through the SDK every deployment already runs under its own DSN. zod no longer asks whether it may compile, which drew a refusal on every page load.

The Security tab is clean. Twelve CodeQL alerts are closed: eleven came from the end-to-end fixtures parsing .env by hand, which Node now reads, and one from a loop that read past the end of its list. The 22 Dependabot alerts, all in development tools, have left the dependency graph: @vercel/node, installed for two type names and pinning an undici 5 that no release of it has left, is not installed any more, and two overrides reach the two versions nothing else could. Every action in the workflows is pinned to a commit, and no workflow's token is broader than its job.

What it costs: the first load is 375.3 kB gzipped, 0.3 kB over 4.11.3, for the listener that reports refusals. The build that ships was the same, byte for byte, under the old dependencies and the new. The end-to-end suite passed on each of the six merges, 44 of 44.