Repository navigation
docs: request-safety limits and adapter fixes from core #117 - #23
Merged
Merged
Conversation
npm audit --audit-level=moderate, which CI gates on, failed on main with 3 high and 11 moderate advisories: http-cache-semantics (GHSA-ch52-4w7c-c8xp), sharp (GHSA-wq5f-xc86-pv6w), source-map-js (GHSA-68fv-2mgg-jv7q) and smol-toml (GHSA-r4xh-jqrq-34v2). `npm audit fix` resolves all four within the existing package.json ranges; astro moves to 7.3.3, starlight to 0.41.11 and sharp to 0.35.5. Lockfile only. Verified by building main and this commit and comparing dist/: all 27 pages are identical once asset hashes and the Starlight generator tag are ignored, and the banner still reads 26.9.0-beta.2. Still open: postcss-selector-parser <7.1.6 (GHSA-rj75-hqrm-r3gf, moderate), reached through @expressive-code/core 0.44.2 (latest) -> postcss-nested ^6. No 6.x release carries the fix, so clearing it takes a major bump of a transitive dependency and is left out of this commit. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Covers the behaviour core #117 shipped for #104-#108 and #116, as mapped in the FPRD-001 docs delivery card. Each claim was checked against the core code on develop (4d1639f) and its [Unreleased] changelog. - createApp reference: limits.maxWsMessageBytes (1 MiB) and maxWsQueue (16), their units, TypeError validation in createApp, close codes, and the streaming body-limit check. - Streaming: inbound limits, 1009/1013, per-consumer queues and early frames going to the first reader, the handler that never reads, the per-runtime refusal point, worst-case memory (about 15.6 GiB at the Node defaults) and the 1 MiB default as a breaking change. - Runtimes: replaces the stale "fetch reads the whole body first" paragraph, adds the per-runtime WebSocket size table (Bun closes 1006) and how ctx.ip is populated on Deno and Bun, including the trustProxy fallback to the peer and the cases that still answer ''. - Uploads: Content-Length refused up front, reading stops at the limit, and workerd refuses by the count. - HTML & views: symlink confinement, out-of-root and dangling links are a 404 through onError, and re-pointing the root needs a restart. - Errors and observability: Node's last-resort 500 with connection: close, which skips onError and emits no request:end. - Security: trustProxy fallback and a short list of the defaults. The breaking note reads "after 26.9.0-beta.2" instead of naming the next version. Exact pins, documentsCoreVersion included, belong to the RC.1 release cut. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Node 18 and 20 are end-of-life. From the release after 26.9.0-beta.2, @green-tea/core requires Node 22 (core #122). Getting started now says Node >= 22 and flags the change as breaking after 26.9.0-beta.2, the same way this PR marks the other post-beta.2 changes. The site itself builds on Astro 7, which requires Node >= 22.12.0, so the README says so and package.json declares it in engines. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
… advisory GHSA-rj75-hqrm-r3gf (postcss-selector-parser <7.1.6) reaches the site through @expressive-code/core@0.44.2, the latest release, which pins postcss-nested@^6; no 6.x release takes the fixed parser. `npm audit fix --force` would downgrade Starlight to 0.21.5. Override postcss-nested to ^7.0.2, which depends on postcss-selector-parser ^7 and resolves 7.1.6. Temporary: drop the override once expressive-code ships a release on postcss-nested 7. The built site is byte-identical to the build before the override (84 files, including the expressive-code stylesheet). Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Companion docs for core #117 (merged into core
developas4d1639f), which shipped issues #104–#108 and #116. Every claim was checked against the core code and its[Unreleased]CHANGELOG, and scoped to the FPRD-001 docs delivery map.reference/createapp.mdlimits.maxWsMessageBytes(1 MiB) andmaxWsQueue(16): units, defaults, close codes,TypeErrorvalidation increateApp, server-level only; streamingmaxBodyBytesnote;staticrow mentions symlink escapes are a 404guides/streaming.md@inbound()iterator has its own bounded queue, frames before the first reader go to it), a handler that never reads, per-runtime refusal point, worst-case memorymaxConnections × maxWsQueue × maxWsMessageBytes(≈ 15.6 GiB at Node defaults; no connection cap outside Node), and a Breaking after 26.9.0-beta.2 note for the 1 MiB / 16 defaultsguides/runtimes.md1006; Deno/edge after receipt); newctx.ipsection (Deno/Bun viaserveDeno/serveBun,trustProxyfalls back to the peer, address formats, cases that still answer'')guides/uploads.mdContent-Lengthrefused up front, reading stops at the crossing chunk, workerd refuses by the countguides/html.mdonError(not 403); re-pointing the root symlink needs a restart; the remaining check/read raceguides/errors.md500+connection: close: skipsonError, socket destroyed once output startedguides/observability.mdrequest:start/request:endpairing for that pathguides/security.mdtrustProxypeer fallback; short cross-link list of the four hardening defaultsCommits:
fix(deps): apply non-breaking npm audit fixes: lockfile only. Clears the high-severity advisories (http-cache-semantics, sharp, source-map-js) and smol-toml. astro 7.3.3, starlight 0.41.11, sharp 0.35.5. The builtdist/was diffed againstmain: all 27 pages are identical apart from asset hashes and the Starlight generator tag.docs: document request-safety limits and adapter fixes from core #117docs: require Node 22 for core and for building the siteNode 22 floor. Node 18 and 20 are end-of-life, so
@green-tea/corerequires Node 22 from the next release (RC.1), per core #122.getting-started.mdnow says Node ≥ 22 and carries a Breaking after 26.9.0-beta.2 note, like the other post-beta.2 changes here. No other page names a Node version. The site's own floor is Astro 7's>=22.12.0: the README now says Node 22.12+, andpackage.jsondeclares it inengines. Both workflows already use Node 22 only.npm run buildpasses (27 pages), and every internal link and anchor in the changed pages resolves.Open items
npm audit --audit-level=moderate. One moderate advisory remains,postcss-selector-parser <7.1.6(GHSA-rj75-hqrm-r3gf), and it was already failing onmain. It comes in through@astrojs/starlight→@expressive-code/core@0.44.2(latest) →postcss-nested@^6→postcss-selector-parser@6.1.4. No 6.x release has the fix, so clearing it needs a major-version override (or an upstream expressive-code release).npm audit fix --forcewould downgrade Starlight to 0.21.5. That decision is left to a maintainer.documentsCoreVersionandpackage.jsonstay at26.9.0-beta.2, and the breaking note says "after 26.9.0-beta.2". The RC.1 release cut should rename it and updatewhats-new.md.guides/mesh.mdframe-cap paragraph says mesh frames are capped at 4,000,000 characters, above the 1 MB body limit. In core, the teapot's control channel now also goes throughmaxWsMessageBytes/maxWsQueue, so with the defaults an inbound mesh frame over 1 MiB closes with1009before that check. The core CHANGELOG doesn't mention mesh, so this PR leavesmesh.mdalone. This needs a core-side decision.400/404/1008change (#104). Per the delivery map it gets a CHANGELOG entry only, with no docs page. Routing (#109) waits until it is accepted.Audit (update): the
postcss-selector-parseradvisory (GHSA-rj75-hqrm-r3gf) is cleared by a temporaryoverrides: { "postcss-nested": "^7.0.2" }in its own commit.npm auditnow reports 0. The built site is byte-identical to the build before the override. Drop the override once expressive-code ships on postcss-nested 7.