Unreleased [Not released yet]
Part 12 of 15. Previous part
Fixed (612)
wisp::worksays in its docs that a second call for one queue panics, so the server does not start.- While another process holds an
fsdata folder, the store calls of that folder wait once. They use the result of the first call. For the same time after a failed wait, a call fails at once with the same 503. A call on another folder does not wait. Before, one global lock held each call in turn, so k calls took k waits, and calls on a free folder waited too. - A list or a reap of
fsstops at the first two header lines of a file in the store folder that does not start with a Wisp header. Before, it read a file with no line end whole. - A list of the
memorydriver deletes the expired keys it finds, as a get does. Before, those keys stayed in memory until the process stopped. A store name with a\0no longer shares keys with another store. - An
upstashput with an expiry at or before now deletes the key, so the key reads as missing at once, as onmemoryandfs. Before, it sentEXATwith that past time. - The SigV4 signature of
s3makes each inner run of spaces in a header value one space. S3 may read a header value in this form (AWS docs, not checked in this repo). Before, the signature of a content type with two spaces may not match the signature that S3 makes. - Over libSQL, a
wisp::sqlinteger argument outside the range ofi64is a 500 that names the value. The 500 shows the first 20 characters of a longer value. Before, it went as an integer, which the server may refuse. - An
upstashSCAN cursor or key that is not UTF-8 is a 500 that names which one (a SCAN cursor that is not UTF-8). An unknown operation is a 500 that names the store (kv NAME (upstash): no such operation: X). - The summary of a refused form links a field only when an element has an
idattribute of its name. Before,data-id="q"orgrid="q"made a link to a field that does not exist. The summary goes into the first<main>tag. Before, an element such as<main-nav>took it. - The doc of
rt::Pwanames its three ETag fields. The doc ofcheck_originno longer says that browsers always sendOrigin. The doc ofrt::csr_offsays that the other head tags stay (the manifest link, the worker script). It also says that in a release build, only oneAppper process can use it. - When dev replaces a
.wisp/secretof fewer than 32 bytes with a new key, it writes a log line with the path and the length of the key. Before, dev replaced it with no log line. The internal SigV4 signer (s3and the Lambda WebSocket@connectionscalls) gives a 500 for a date that is notYYYYMMDDTHHMMSSZ. Before, a date under 8 bytes, or a multibyte character across byte 8, made a panic. No caller passed such a date:s3and the WebSocket calls usesigv4::date, which writes 16 bytes for the years 0 to 9999. So this change is hardening only. A year after 9999 now gives the 500. The docs now say these facts. UnderWISP_BASEover HTTPS the session cookie is__Secure-session. With a shared store, another native instance refuses a new session for up to 30 s after a sign-out everywhere.sign_in_pagepanics on a path with no leading/. The defaultsave_manymay leave rows in the store when its delete of them fails. - A REST filter (
?n.gte=3) and a sort compare a whole number written in digits (an optional-, no., noe) exactly. Its range is -(2^64 - 1) to 2^64 - 1. Before, they compared it as anf64, so two numbers past 2^53 that differ (twou64ids) were equal: a filter matched both rows, and the sort did not order them. Any other number still compares as anf64. A filter compares in the order of the sort: a number comes before text. - The
linkheader of a REST list writes each byte of the path and the query as%XX, exceptA-Z a-z 0-9 - . _ ~ % / ? & = + : @ ! $ ' ( ) *. Before, it copied the query as the client sent it, so a>or"in the query could end the link or add a parameter. #[remote(prerender)]with the inputi128::MINfails with the textthe number is not an integer within +-2^53. Before, the check overflowed, and a debug build stopped.- The docs of
WISP_USERsay that Wisp gives theWISP_DATAfolder to the user, not what is in it. - Critical CSS (static export, prerender) keeps the page as it was when a
<style>or a stylesheet<link>comes after the app's link in any case or quote form (<STYLE>,rel=stylesheet,rel='stylesheet',rel="alternate stylesheet"). A>in a quoted attribute value does not end the tag. Before, only<styleandrel="stylesheet"stopped it, so the moved sheet could change which rule wins. - Critical CSS keeps a string, a comment and an unquoted
url()in a declaration as text:content:"a;--x:1;b"stays whole. A string with no end stops at the line end. An escaped;or{(\;) does not start a declaration. Before, the cut of unused custom properties and transitions read--x:1;in the string as a declaration and deleted it. - Critical CSS keeps the page as it was when an
image-set()(also-webkit-image-set()) has a relative string address, or aurl()in any case (URL(x.png)) has a relative address. Before, it checked onlyurl(in lower case, so the inlined address resolved against the page, not the sheet. - Critical CSS keeps a
@keyframeswith a string name (@keyframes "fade") when a rule names it. Before, it looked for the name with its quotes and dropped the rule from the first paint. COMPRESSand embedded files read the media type alone (before any;), in any case. XML counts only as the subtypexmlor a+xmlsuffix (alsoimage/svg+xml). Before, any type withxmlorsvgin it counted, also a.docx(application/vnd.openxmlformats-..), which is a zip, and a parameter such as; name=a+xml.image/svgwithout+xmlno longer counts.TEXT/HTMLandAPPLICATION/XMLnow count. A media type over 255 bytes (RFC 6838 4.2) does not count.- A
COMPRESSanswer oftext/event-streamin any case (Text/Event-Stream) goes as it is. Before, only the lower case form was left as it is. A stream of that type in any case also ends cleanly when the server stops, as server-sent events do. Before, only the lower case form did. - A WebSocket on the edge build (a raw connection or a host's socket) closes with one close frame, code 1009, when the client sends more than the socket holds. The socket holds twice the message limit plus 64 KiB of what the handler did not read. Before, the socket closed with no close frame, and a raw client saw 1006. A handler that only sends gets this close in place of its next send, and that send fails with
Gone. A message over the limit gets 1009 on all servers already. - A WebSocket close on the built-in server ends a
recvthat another clone of the socket waits in. Then the drain after the close frame reads what the client still sends, forLINGER(2 s) andLINGER_BYTES(1 MiB) at most, and keeps none of it. Before, thatrecvkept the read side until the client sent data or left. The drain waited for it for up to 2 s and read nothing. The connection may then reset, and the client may lose the close code. - A WebSocket close on the edge build ends a
recvthat another clone of the socket waits in. This includes the 1009 close after a flood. Before, thatrecvwaited until the client sent data or left, or until its timer ran out. WithWISP_WS_IDLEset to 0 and no half-sent message, it had no timer. - A
wisp::cachehit copies only theArcunder the lock and runsT::cloneafter the unlock. A miss clones the answer before it takes the lock. Before, each hit and each kept miss ranT::cloneunder the one lock of the cache. - The
verifyjob of the release workflow cloneswisp-docsand setsWISP_SKIP_VSCODE=1, as the CI workflow does. Before,wisp-gate fastin that job failed in CI with "no docs checkout (WISP_DOCS_DIR), and CI needs one", so a tag run stopped before it published. - A re-run of the
releasejob of the release workflow deletes a release asset with the same name before it uploads the new one. Before, it sent each asset again. - The test of the Prettier plugin (
editors/prettier-plugin-wisp/test.mjs) has a page form thatwisp fmtchanges. Before,wisp fmtgave the page back unchanged, and the test read that as "wisp did not run". So it failed in CI withwisppresent. - The CI workflow and the
verifyjob of the release workflow install the tree-sitter CLI 0.25.10 from its release URL and check its sha256. Before, the workflows did not install it. In CI, thegrammar generatestep fails without it (tests/gate/src/main.rs:962). - A read of the store again (
wisp::sign_out_everywherewithwisp::store) skips a stored row that does not read, as the load does. The store keeps the row, and its id stays taken. Before, one such row made each later call fail with a 500. The read also puts no rows in a table that could not read its store again. It takes the last id given from the store, as the load does. - With
WISP_STORE_POLL, a poll skips a changed row that does not read and applies the other rows. The id stays taken and the cursor moves. A load and a read of the store again skip such a row in the same way. After such a skip, a read gives the old value of that row, or none when the table never read one (after a load). A write from this instance to that row is a 409 with the codeconflict, and the store keeps the newer row. Aclearof a table with a skipped row is a 409 and takes no row out. When the table kept the old value of a skipped row, some steps can come before the 409. Insetandupdate, they include a 422, a 500 for aPasswordnot hashed and the closure ofupdate. In REST, they include a 422, a 413 and a 412. They also include the 409 of a row that changed during the update, abefore_updateorbefore_deletehook and the hash of aPassword. The write saves nothing. In REST, a skipped row outside the view of the caller is a 404. On a route with a filter, a row that the load skipped is a 404 for every caller, the owner too. The write works again when a later load, read of the store again or poll reads the row. Before, one such row failed each poll, and the table stopped following the store. - The warning for a stored row that does not read names the table, the id and the type, and no longer quotes the read error, which can hold text of the row. The load, a read of the store again and a poll name each row once, and at most 32 rows of a table. Then one line says that the log names no more. Before, each load named each such row again.
- The log-file store skips a row that is not UTF-8 with one warning that names the table, the count and the lowest and highest id. The log keeps its line byte for byte, also after a compaction, and its id stays taken. Before, one such row made the load of the table fail and stopped the server.
- On AWS Lambda, a streamed reply that Wisp collects stops at 4 MB, also when one chunk passes it. Before, the last chunk could push the body past 4 MB, and the reply could become a 500.
- With
WISP_LAMBDA_STREAM=1, Wisp reads the status line of Lambda also when it comes in more than one read. Before, a short first read could give the errorLambda answered ...for a reply that Lambda took. - On AWS Lambda, an event that is not JSON gives the invocation error
the event is not JSON that Wisp can read. Before, the error saidthe event is not an HTTP request. cx.client_ip()reads an entry with a port (ip:port,[ip]:port) in the header thatWISP_CLIENT_IP_HEADERnames. An ALB writes that form with client port preservation on. Before, such an entry gave the peer, so each client had the address of the proxy.- The problems of a 422 hold at most 16 KiB of places and messages. Wisp cuts the problem that passes it to fit, at a char boundary, and it is the last. Before, one problem could pass the bound by any amount: a 100 KB key gave a 100 KB place.
- On the edge build, a reading of the host clock that is NaN, negative or too large no longer traps the instance. The clock keeps its last good time and never goes back. The clock of the rate limiter stops at the largest time when a wait is added. Before, each case panicked.
- On the edge build, a second
wisp_conn_openwith the id of an open connection changes nothing, and the first one of the instance writes one log line. Before, it replaced the first connection. - On Linux, when the reactor of tokio cannot watch the epoll any more, the epoll driver logs one line, closes each connection that it holds, and ends. Before, it turned again at once and could spin. A connection future whose
Droppanics after a panic of itspollno longer unwinds through the driver. wisp::localreturns/for a value with CR, LF or NUL anywhere, and for a path with a control byte (but tab) or DEL. Soredirect(wisp::local(next))never gives a 500. Before,local("/a\u{b}")returned/a\u{b}, andredirectrefused it with a 500.- A 422 problem of no field (
Error::invalid("", why), as the guarded forms give) has no:before it in the message. Before, the message was: why. - The doc of
WISP_SPOOL_LIMITsays that aWISP_UPLOAD_LIMITof0lets no file bytes go to disk, so the spool limit has nothing to cap then. - On the edge build, a saved table name with a tab or a line break fails at
savetoo, withnamecannot name a table. Before, only the read of the rows checked it, and a save put a broken line in the batch. - A cross-origin
WISP_ASSET_BASEhost joinsscript-src,style-srcand ascript-src-elemthat the app names, also next to an'unsafe-inline'that the app sets. Before,script-srcandscript-src-elemdid not get it next to'unsafe-inline', and a browser could block the built scripts. - A route param keeps its raw text when an escape forms a Windows drive prefix (
c%3Ax), as it does for an escape that forms/,\or a dot segment. The doc ofCx::paramnow says that raw text is the client's own text. - The docs of the cookie methods now say that a signed cookie gets its prefix where cookies get
Secure, not only over HTTPS. - The doc of
Cx::aftersays what the code does.cx.after(|| ..)starts its closure as a task at the call. On the built-in server the task runs after it yields once, so it can run while the handler works. It runs also when the handler returns anError panics. Before, the docs said that it runs after the reply. - The doc of
Cx::pathsays that the path can hold..or%2e%2e. A path to a file that you build from it needs a check:Response::file_inhas one.
Security (152)
#[validate(email)]andwisp::Emailrefuse controls, white space and eachDefault_Ignorable_Code_Pointof Unicode 18.0.0 past ASCII in the domain, except the joiners U+200C and U+200D. The list: U+00AD, U+034F, U+061C, U+115F, U+1160, U+17B4, U+17B5, U+180B to U+180F, U+200B, U+200E, U+200F, U+202A to U+202E, U+2060 to U+206F, U+3164, U+FE00 to U+FE0F, U+FEFF, U+FFA0, U+FFF0 to U+FFF8, U+1BCA0 to U+1BCA3, U+1D173 to U+1D17A and U+E0000 to U+E0FFF. IDNA2008 disallows each of them or leaves it unassigned. Real names past ASCII still pass. Before, the check took every byte past ASCII, so C1 controls (U+0085), U+2028 and bidi controls (U+202E) passed.wisp check --target <host>andwisp build --target <host>warn at the firstRateLimit,Backofforcx.limitof the app: each instance counts on its own, so a limit of N can pass N times the count of instances. They also warn at the first sign-in: the edge build has no limit of sign-in tries per account, and on Lambda each instance counts its own.wisp::untoken_oncefailswisp build --target lambdaandwisp check --target lambdaat its line, because each Lambda instance keeps its own used tokens. With thetowerfeature on,wisp checkandwisp buildwarn for each WebSocket route: throughwisp::towerit gets a 501, and the host framework must do the upgrade.- The JSON parser caps the room of each array and object by the bytes that it holds itself, not by the bytes of the arrays and objects in it. Before, each one got room for its own count of commas. So a 1 MB text that is not JSON (128 open
{"":, then the commas of each level) held 42 MB, 40 times its size. Now it holds 8.4 MB, 8 times its size. A parse holds at most 11 bytes for each byte of the text, plus 40 for each array or object. wisp::totp::check: a flood of valid codes of other accounts no longer refuses a right code. The set of used steps of a process holds 65,536 steps. Before, a full set of live steps refused each new code until those steps expired. Now a full set forgets the half nearest expiry and logswisp: the set of used totp steps is full. It forgot the half nearest expiry. Find the source of a flood of requests.at most once a minute. Save the step thatcheckreturns and compare-and-set it. Without it, a used code can be used again: after a restart, on another server, and while a flood fills the in-process set.- HTTP/2: a connection that starves a stream closes at the owe deadline, also while other streams run their handlers or stream with nothing to send. The client must take the answers at 1 KB/s or more after a 10 s grace (
WISP_BODY_TIMEOUT). Before, a slow handler or a cheap request every few seconds kept the starved answer in memory with no time limit. - HTTP/2: the
:pathof a WebSocket's extended CONNECT must be in origin form (start with/), or the server resets the stream with PROTOCOL_ERROR. Before, it took a:pathsuch ashttp://evil.example/wsor*. - A REST POST array makes at most 1000 rows. More is a 413 (
too_many). All its rows go in under one write lock of the table. Before, only the body limit capped them. - An
Svgthat Wisp reads from JSON (a REST body, a table row) takes at most 512 KB (wisp::MAX_SVG), as sent and as sanitized. More is a 422 (must be at most 512 KB). Before, only an upload had the cap. - The SVG sanitizer drops a value with
image(orcross-fade(in any case or spacing, as it does forimage-set(. This is a precaution: an SVG shown through<img>and its CSP load nothing. - On a native build, a form post or WebSocket upgrade with an
Originheader that is not UTF-8 is a 403. Before, Wisp read it as noOrigin, so a request with noSec-Fetch-Sitepassed. A request with noOriginheader passes only withSec-Fetch-Sitesame-origin or none, or with noSec-Fetch-Site, as before. /_imgdoes not serve a file ofstatic/when it cannot resolve the path of the file (a 404). Before, a failed check of a link to a hidden folder served the file.- A file in
static/with a dot segment in its path (.env,.git/config,a/.hidden/x) is not embedded, not served, not copied bywisp build --static,--spaor--target, and not served bywisp dev. Before,GET /.envsent the file. A symlink to such a path is hidden too./_imgand<img src>skip these files. The folderstatic/.well-knownstays public (/.well-known/security.txt). A dot segment below it is still hidden. The build prints one warning for each hidden entry (the first hidden name of a path, such as the folder.git), with its full path, in the formWisp does not serve <path>: its path has a dot segment.wisp build --staticshows it twice: the build prints it and the copy ofstatic/prints it. Wisp writes.nojekyllitself, so there is no knob. An earlierwisp build --staticmay have left a file such asdist/.env: it stays. Deletedist/once. - A page's own
SIGNED_IN,MIDDLEWARE,RATE_LIMITorCORSnow gates every method of the endpoints of its route (+server.rsormod server), also the member route/[id]. Before, it gated only aget, or apostof a page with actions, so aput, apatch, adelete, apostof a page with no action and each method of/[id]ran without the page's guard. An upload on such a route is also refused before the server reads the body. An endpoint that must stay public goes to another route.CORSruns once and before every guard of the route: the endpoint's, else the page's. Before, a page and an endpoint with aCORSeach sent anaccess-control-allow-originheader, and a refusal by a page guard had noCORSheaders. The OpenAPI operations of an endpoint under aSIGNED_INof its page or a layout name the session and the 401. The member route takes its guard from the+page.wispof its folder, also when a.mdpage sits beside it or the page is a rest page ([...p]). Aconst CORSinsrc/hooks.rsand one in a route stop the build, because both would send the header. A keptCACHE_PUBLICGET of an endpoint with aCORSsends no CDN header. Only routes with such a page guard run more code.