Skip to content

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

Open
dipeshbabu wants to merge 3 commits into
subconscious-systems:mainfrom
dipeshbabu:fix/bounded-downloads
Open

dipeshbabu wants to merge 3 commits into
subconscious-systems:mainfrom
dipeshbabu:fix/bounded-downloads

Conversation

@dipeshbabu

Copy link
Copy Markdown

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, and bundled CLI version/help smoke checks. Ubuntu/Windows Node 20/22 CI passed before PR creation on this exact head commit (c78543f): https://github.com/dipeshbabu/vibi-cli/actions/runs/37263748462

This branch includes the CI foundation from #2; merging that PR first removes the common CI changes from this diff.

Closes #33.

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.

Ciphertext downloads buffer unlimited response data before size validation

1 participant