Repository navigation
fix(api): refuse compressed request bodies instead of inflating them - #503
Conversation
body-parser 2.4 inflates gzip, deflate, brotli and zstd bodies, so any request could make Node decompress zstd with its bundled zstd 1.5.7, which CVE-2026-124851 affects. No client sends compressed bodies: every parser now answers 415 before reading one. Signed-off-by: samuel mbabhazi <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
@coderabbitai review |
Action not completed
|
|
@coderabbitai review |
Action not completed
|
…ed (closes #480) (#502) ## What changed The evidence #480 asks for, for the replacement release `v0.1.0-alpha.5`. - **`docs/security/image-triage-2026-11.md`, new section "Rescan of the published v0.1.0-alpha.5 image".** - Trivy 0.70.0, database of 2026-11-25 13:07 UTC, linux/amd64 and linux/arm64, without the release gate's filters: 121 distinct advisories, 1 critical, 11 high, none with a fix, no secret. - One disposition per high or critical advisory, based on what the image actually loads (checked in the published image): - every service runs `node` as `node`; - `node` links only glibc and libstdc++, and bundles zlib 1.3.1 and zstd 1.5.7; - argon2 is the only native addon, and links none of the flagged packages; - the `migrate` shim runs `readlink`, `uname` and `sed` on its own path; - Node's bundled copies are checked against the same advisories. Its zstd 1.5.7 is affected by CVE-2026-124851, and the API reached it in alpha.5 through compressed request bodies. #503 removes that path. Its zlib 1.3.1 is in CVE-2026-85091's range, but Node does not use the `gz*` file functions where the flaw is (after CodeRabbit's review). - alpha.4 is named for what it is: same code, no image. - **`docs/security/scans/control-plane-v0.1.0-alpha.5.json`.** The findings per platform: id, severity, package, installed and fixed versions. It also records the manifest digests, the scan command and the database date, so the counts can be reproduced. - **`docs/INSTALL.md`.** - Status line and "What has been tested" for alpha.5: single-machine install, deployment, logs and metrics, backup and restore, and the upgrade from alpha.3 with a separate server. - Fixes the tests found: - step 3 lists the first question, "Run applications on this machine too?", and the organization; - without a terminal, `--single-machine` and `--organization` are needed, and `--smtp-from` and `--smtp-user` with SMTP. The documented `--domain --email` form stopped at "Answer yes or no."; #499 makes the installer say what is missing; - **Upgrade:** take the backup after `docker compose pull`, with the new bundle's `backup.sh`. Before that, an alpha.3 installation has neither the `backup` service nor `backup.js` ("no such service: backup"); - **Upgrade:** agent upgrades exist now (#447, #448). An alpha.3 agent makes the rollout stop with "not supported by this agent", and nothing changes on its server; - **Restore:** a deployment made after the backup makes the next deployment fail once (#501). - The bundle's provenance attestation is no longer "not tested": `gh attestation verify` passed. ## Why #480 asks for a replacement release after its checks, a rescan of the exact new digests on every architecture with reproducible results, and verification of startup, migrations, backups, Caddy routing, metrics and logs, and the documented upgrade path. ## How it was tested Everything in "What has been tested" was run on 25 November 2026, in fresh Ubuntu 24.04 containers with systemd: - the alpha.5 bundle downloaded and verified as the page says; - the installer through a real terminal; - the API flows over HTTPS; - the upgrade from the published alpha.3 bundle, with an alpha.3 server enrolled through the command and token copied from the Servers page. The scan JSON comes from the published image by digest. ## Security considerations No change to code or behavior. The scan file lists package versions only, and no lab secret appears in any document. Closes #480. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Updated prerelease installation, deployment, backup, restore, and upgrade guidance for alpha.5, including installer options and requirements for noninteractive and SMTP-configured setups. * Clarified restore behavior for deployments created after a backup, agent upgrade procedures, and compatibility limitations. * Expanded alpha.5 security guidance with platform-specific scan results and details on compressed request handling. * Updated testing results and clarified which upgrade scenarios have been tested. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: samuel mbabhazi <[email protected]>
What changed
The four body parsers (default JSON, large JSON, webhook raw, urlencoded) run with
inflate: false. A request whose body has aContent-Encodingother thanidentitygets 415 problem details, before the body is read. SPEC 8.1 states the rule.Why
CodeRabbit's review of #502 asked whether Node's own zstd copy was affected by CVE-2026-124851, given that the triage relied on it. It is.
process.versions.zstdin the published image).Content-Encoding: zstdbodies withzlib.createZstdDecompress()when Node has it.v0.1.0-alpha.5installed in the lab: a project created with a zstd-compressed JSON body through the public HTTPS endpoint answered 201, with the decompressed fields stored and readable by the client.No client of the API sends compressed bodies: the web UI, the CLI and GitHub's webhooks send plain bodies, and agents use gRPC. Refusing them removes that input path for zstd, and for Node's zlib and brotli as well.
Node's
fetch(undici 6.29.1 in Node 22.23.5) does not decode zstd responses, checked against a local server. That was the other way zstd could be reached.How it was tested
app.http.spec.ts: zstd, gzip, deflate and brotli bodies to the login route, to a large-JSON route (secrets) and to the webhook route each answer 415 with problem details. The test failed first, with 400.api:lintandapi:typecheck.Security considerations
The released
v0.1.0-alpha.5has this exposure. Removing it from installations needs a new release with this change. Until then, a reverse proxy in front of the API can refuse compressed request bodies.