Skip to content

v0.31.0

Choose a tag to compare

@tannevaled tannevaled released this 15 Nov 09:45
· 8 commits to main since this release
44062f1

wasmcache hardening (#47, closes #45).

  • The recovery page reloads at most once. The "Updating…" page that replaces a playground page failing its hash check now reloads a single time, marked with ?wasmcache-reset=1. If the page still fails, it shows a static "clear this site's data" message instead of reloading, even when removing the service worker keeps failing. Before, that case reloaded without end. The marker is removed from the address bar once the page is healthy.
  • Cache names are restricted (breaking). -name now accepts only [A-Za-z0-9._:/-], and anything else is refused at generation time. Before, only | was refused, and a name containing </script> could break out of the generated recovery script. < is also escaped as < where the name is embedded, as defense in depth.
  • Tests. The test kit makes removing the service worker always fail, and asserts exactly one reload followed by the message. It also checks that the restored page matches its manifest hash. Each check was proven by mutation: removing the bound gave 240 page requests against an expected 2.

Upgrade: if your -name uses characters outside the allowed set, rename it. go-slides uses go-slides-playground, which is unaffected.