Changelog

All versions and downloads Jump to Added | Changed | Fixed | Security

Unreleased [Not released yet]

Part 12 of 15. Previous part

Fixed (612)

  • wisp::work says in its docs that a second call for one queue panics, so the server does not start.
  • While another process holds an fs data 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 fs stops 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 memory driver 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 \0 no longer shares keys with another store.
  • An upstash put with an expiry at or before now deletes the key, so the key reads as missing at once, as on memory and fs. Before, it sent EXAT with that past time.
  • The SigV4 signature of s3 makes 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::sql integer argument outside the range of i64 is 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 upstash SCAN 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 id attribute of its name. Before, data-id="q" or grid="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::Pwa names its three ETag fields. The doc of check_origin no longer says that browsers always send Origin. The doc of rt::csr_off says that the other head tags stay (the manifest link, the worker script). It also says that in a release build, only one App per process can use it.
  • When dev replaces a .wisp/secret of 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 (s3 and the Lambda WebSocket @connections calls) gives a 500 for a date that is not YYYYMMDDTHHMMSSZ. Before, a date under 8 bytes, or a multibyte character across byte 8, made a panic. No caller passed such a date: s3 and the WebSocket calls use sigv4::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. Under WISP_BASE over 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_page panics on a path with no leading /. The default save_many may 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 ., no e) exactly. Its range is -(2^64 - 1) to 2^64 - 1. Before, they compared it as an f64, so two numbers past 2^53 that differ (two u64 ids) were equal: a filter matched both rows, and the sort did not order them. Any other number still compares as an f64. A filter compares in the order of the sort: a number comes before text.
  • The link header of a REST list writes each byte of the path and the query as %XX, except A-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 input i128::MIN fails with the text the number is not an integer within +-2^53. Before, the check overflowed, and a debug build stopped.
  • The docs of WISP_USER say that Wisp gives the WISP_DATA folder 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 <style and rel="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 a url() in any case (URL(x.png)) has a relative address. Before, it checked only url( in lower case, so the inlined address resolved against the page, not the sheet.
  • Critical CSS keeps a @keyframes with 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.
  • COMPRESS and embedded files read the media type alone (before any ;), in any case. XML counts only as the subtype xml or a +xml suffix (also image/svg+xml). Before, any type with xml or svg in it counted, also a .docx (application/vnd.openxmlformats-..), which is a zip, and a parameter such as ; name=a+xml. image/svg without +xml no longer counts. TEXT/HTML and APPLICATION/XML now count. A media type over 255 bytes (RFC 6838 4.2) does not count.
  • A COMPRESS answer of text/event-stream in 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 recv that another clone of the socket waits in. Then the drain after the close frame reads what the client still sends, for LINGER (2 s) and LINGER_BYTES (1 MiB) at most, and keeps none of it. Before, that recv kept 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 recv that another clone of the socket waits in. This includes the 1009 close after a flood. Before, that recv waited until the client sent data or left, or until its timer ran out. With WISP_WS_IDLE set to 0 and no half-sent message, it had no timer.
  • A wisp::cache hit copies only the Arc under the lock and runs T::clone after the unlock. A miss clones the answer before it takes the lock. Before, each hit and each kept miss ran T::clone under the one lock of the cache.
  • The verify job of the release workflow clones wisp-docs and sets WISP_SKIP_VSCODE=1, as the CI workflow does. Before, wisp-gate fast in 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 release job 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 that wisp fmt changes. Before, wisp fmt gave the page back unchanged, and the test read that as "wisp did not run". So it failed in CI with wisp present.
  • The CI workflow and the verify job 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, the grammar generate step fails without it (tests/gate/src/main.rs:962).
  • A read of the store again (wisp::sign_out_everywhere with wisp::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 code conflict, and the store keeps the newer row. A clear of 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. In set and update, they include a 422, a 500 for a Password not hashed and the closure of update. In REST, they include a 422, a 413 and a 412. They also include the 409 of a row that changed during the update, a before_update or before_delete hook and the hash of a Password. 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 error Lambda 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 said the event is not an HTTP request.
  • cx.client_ip() reads an entry with a port (ip:port, [ip]:port) in the header that WISP_CLIENT_IP_HEADER names. 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_open with 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 Drop panics after a panic of its poll no longer unwinds through the driver.
  • wisp::local returns / for a value with CR, LF or NUL anywhere, and for a path with a control byte (but tab) or DEL. So redirect(wisp::local(next)) never gives a 500. Before, local("/a\u{b}") returned /a\u{b}, and redirect refused 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_LIMIT says that a WISP_UPLOAD_LIMIT of 0 lets 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 save too, with name cannot 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_BASE host joins script-src, style-src and a script-src-elem that the app names, also next to an 'unsafe-inline' that the app sets. Before, script-src and script-src-elem did 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 of Cx::param now 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::after says 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 an Err or panics. Before, the docs said that it runs after the reply.
  • The doc of Cx::path says that the path can hold .. or %2e%2e. A path to a file that you build from it needs a check: Response::file_in has one.

Security (152)

  • #[validate(email)] and wisp::Email refuse controls, white space and each Default_Ignorable_Code_Point of 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> and wisp build --target <host> warn at the first RateLimit, Backoff or cx.limit of 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_once fails wisp build --target lambda and wisp check --target lambda at its line, because each Lambda instance keeps its own used tokens. With the tower feature on, wisp check and wisp build warn for each WebSocket route: through wisp::tower it 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 logs wisp: 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 that check returns 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 :path of 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 :path such as http://evil.example/ws or *.
  • 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 Svg that 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( or cross-fade( in any case or spacing, as it does for image-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 Origin header that is not UTF-8 is a 403. Before, Wisp read it as no Origin, so a request with no Sec-Fetch-Site passed. A request with no Origin header passes only with Sec-Fetch-Site same-origin or none, or with no Sec-Fetch-Site, as before.
  • /_img does not serve a file of static/ 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 by wisp build --static, --spa or --target, and not served by wisp dev. Before, GET /.env sent the file. A symlink to such a path is hidden too. /_img and <img src> skip these files. The folder static/.well-known stays 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 form Wisp does not serve <path>: its path has a dot segment. wisp build --static shows it twice: the build prints it and the copy of static/ prints it. Wisp writes .nojekyll itself, so there is no knob. An earlier wisp build --static may have left a file such as dist/.env: it stays. Delete dist/ once.
  • A page's own SIGNED_IN, MIDDLEWARE, RATE_LIMIT or CORS now gates every method of the endpoints of its route (+server.rs or mod server), also the member route /[id]. Before, it gated only a get, or a post of a page with actions, so a put, a patch, a delete, a post of 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. CORS runs once and before every guard of the route: the endpoint's, else the page's. Before, a page and an endpoint with a CORS each sent an access-control-allow-origin header, and a refusal by a page guard had no CORS headers. The OpenAPI operations of an endpoint under a SIGNED_IN of its page or a layout name the session and the 401. The member route takes its guard from the +page.wisp of its folder, also when a .md page sits beside it or the page is a rest page ([...p]). A const CORS in src/hooks.rs and one in a route stop the build, because both would send the header. A kept CACHE_PUBLIC GET of an endpoint with a CORS sends no CDN header. Only routes with such a page guard run more code.

Next part (13 of 15)

Source: CHANGELOG.md