Skip to content

Ciphertext downloads buffer unlimited response data before size validation - #35

Closed
dipeshbabu wants to merge 1 commit into
fix/ci-bundle-smokefrom
fix/bounded-downloads
Closed

dipeshbabu wants to merge 1 commit into
fix/ci-bundle-smokefrom
fix/bounded-downloads

Conversation

@dipeshbabu

@dipeshbabu dipeshbabu commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Upstream replacement: subconscious-systems#34

This PR was created in the fork in error. The fix and its issue are now submitted to upstream.

getBytes buffers the entire response and only pullTarget checks its size afterward. A response exceeding the expected ciphertext size can consume unbounded memory before being rejected.

Enforce the expected size and the protocol cap while streaming, reject oversized Content-Length values before reading, cancel failed downloads, and release reader locks. Tests cover declared oversize, streamed oversize without a length header, exact-limit content, empty bodies, and invalid limits.

Validation: frozen-lockfile dependencies, typecheck, full tests, npm build, bundled CLI smoke checks, and Ubuntu/Windows CI on Node 20/22 before PR creation.

This PR is based on the CI foundation branch; merge that PR first.

Closes #33.

All branch CI checks passed on c78543f: https://github.com/dipeshbabu/vibi-cli/actions/runs/37263748462

@dipeshbabu dipeshbabu closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant