Unreleased [Not released yet]
Part 15 of 15. Previous part
Security (152)
- A streamed page (
{#await}) is gzip only when its page saysconst COMPRESS: bool = true;, by the rule of a wholeCOMPRESSanswer. Acache-controlwithno-transformkeeps it as it is. Before, Wisp gzipped each streamed page for a client that took gzip, with or withoutCOMPRESS, and also withno-transform. A streamed page withoutCOMPRESSnow goes as it is, with novary: accept-encoding. An app that used the gzip of such a page must setCOMPRESSon it. A PPR page is never gzip now. ACOMPRESSanswer readsno-transformas a directive in a comma list, in any case.x-no-transformno longer counts. It also reads the headers thatcx.set_headerset: ano-transformor acontent-encodingthere keeps the answer as it is. Before, Wisp read only the headers of theResponse.afterinsrc/hooks.rsruns after this choice, so ano-transformthat it sets does not change it. - svg: limits on links and filter numbers. The
Svgsanitizer refuses (a 422) a document with more than 64<use>elements, a chain of more than 8 links, or a link loop. It also refuses links that add more than 20,000 elements. A link is a<use>, aurl(#id), or thehrefof a gradient, pattern, filter, text path or image. The count multiplies down a chain of links. Amarker-midcounts once for each vertex of the shapes below it. It refuses aurl(that it cannot read as a link to a fragment. It refuses anumOctaves,baseFrequency,order,stdDeviationorradiusnumber above 10, 10, 8, 100 or 100. It also refuses a value of one of them that is not a list of numbers. The 422 names the limit and the number found (or says that it is too large to count). The 422 of a link loop or of aurl(that Wisp cannot read says so. Before, a small document could grow to a large tree in the viewer, which may cost much CPU or memory. These limits are Wisp choices, not browser limits. Wisp also deletes astyledeclaration with an unclosed(. - A cookie whose name starts with
__Host-(in any case) always getsSecureandPath=/, also underWISP_BASE. A__Secure-cookie always getsSecure. A__Host-cookie with adomaindrops, with the log linewisp: dropped cookie "<name>": a __Host- cookie cannot have a Domainonce for each name. Before, only a__Host-cookie underWISP_BASEgotPath=/, so a browser could drop the others with no sign. wisp deploy initwrites a workflow that pins each action to a full commit SHA, with the tag in a comment. Fordtolnay/rust-toolchain, the SHA is a commit of itsstablebranch. Before,uses:named a tag or a branch, and the owner of the action could move it.wisp deploy initno longer runswrangler,vercelandnetlify-cliwithnpx --yes. The command writesdeploy/package.jsonwith the exact version (wrangler4.156.0,vercel65.8.0,netlify-cli27.16.1). The workflow runsnpm ciwith yourdeploy/package-lock.json, so the packages under the tool are locked too. Beforenpm ci, it sets Node.js 22 withactions/setup-node, aswrangler4.156.0 (node >=22.0.0) andnetlify-cli27.16.1 (node >=22.13.0) need Node.js 22.vercel65.8.0 asks fornode >= 20. The source is theenginesfield athttps://registry.npmjs.org/<package>/<version>(npm view, 2026-11-25).- The workflow of
wisp deploy initputs each secret and variable inenv:orwith:. Norun:command holds a${{ }}expression. Before, the Vercel token was also in the command line, and the Deno and Lambda steps put a variable in the command text. - The release workflow fails when the tagged commit is not on
main. Before, a tag on any commit ran the full publish. - Each
uses:line of the workflows names a full commit sha, with the tag as a comment. Before, a mutable tag (checkout@v4,upload-artifact@v3,download-artifact@v3) chose the code that ran on the runner.scripts/mirror-workflows.pyfails on an action without a pin. - The VS Code publish tokens (
VSCE_PAT,OVSX_PAT) are not in the environment of an npm install or of the repo tests. The same holds for the Cloudflare tokens of the docs deploy.scripts/npm-toolsholds@vscode/vsce,ovsxandwranglerwith apackage-lock.jsonthat has an integrity hash for each package, andnpm ci --ignore-scriptsinstalls it with no token. Before,npx --yesinstalled the tools and their unlocked dependencies with the tokens in the environment. Indocs-deploy.yml,DOCS_TOKENis only in the step that cloneswisp-docsand in the step that runsgit ls-remote. TheDeploystep no longer has it. - The
cratesjob builds the five crates withcargo packagein a step that has noCARGO_REGISTRY_TOKEN. Only the next step has the token, and it runs onlycargo infoandcargo publish --no-verify. Before, the build scripts and proc macros of the publish build ran with the token in the environment. - A
?page=Nfar past the end of a large table (Table::page) or a REST list with a largeoffsetskips rows by whole chunks. Before, each request walked every skipped row while it held the read lock of the table. wisp::sign_out_everywherefails with a 500 when the count of the visitor is at the top ofu64(a corrupt store), and keeps the row. Before, the count overflowed: a debug build panicked, and a release build wrapped to 0, which let a signed out session pass again.- The sessions docs say: check a password with
Password::check, never==. It compares in constant time (wisp::secure_eq). - On AWS Lambda behind an ALB, the client address is the last entry of the last
x-forwarded-forline, the address that the ALB appends in its defaultappendmode. An entry with a port also counts. Before, every ALB client had the address 127.0.0.1, soRATE_LIMITandcx.limitcounted all clients as one visitor. When that entry is not an address, the address stays 127.0.0.1, and Wisp logs one line once. A Function URL and API Gateway keepsourceIp, and Wisp does not read theirx-forwarded-for. When you setWISP_CLIENT_IP_HEADER, it still wins. - On AWS Lambda, an
.onionHostnever makes a request a Tor request (WISP_ONIONunset orauto). The peer comes from the event, and 127.0.0.1 is only its fallback. Before, an ALB client that sent an.onionHostgot the Tor rules: a ticket in place of its address. or_statuson anErrwith a 4xx status sets the message to the name of the status. Before, it set the text of theErr, and a visitor reads the message of a 4xx, so a database or file error text could leak. To show a text, writeError::new(status, text). With any other status, the message keeps the text, and only a dev build shows it.- On the edge build, a line of a
WISP_STOREread that Wisp cannot read gives the errorthe store sent a row Wisp cannot read (line N), which goes to the log. Before, the error held the whole line, with the JSON of the row (app data). - The log line for a
Securecookie on a request with no sign of HTTPS stops for good only when the server has TLS, the proxy thatWISP_CLIENT_IP_HEADERnames saysx-forwarded-proto, orORIGINishttps://. Before, anx-forwarded-protoheader from any client stopped the line for the process.