Remove download dependency to resolve transitive security findings (#373) - #374
Merged
Conversation
Replace the `download` package (and its `decompress`/`got`/ `http-cache-semantics` transitive tree) with a small built-in downloader over Node's `https` + `zlib` and `tar-stream` for extraction. This removes all five vulnerabilities reported in #373 and adds path-traversal ("zip slip") protection during extraction, which the previous `decompress`-based path lacked. Also moves `tmp` (test-only) to devDependencies and bumps it to 0.2.7, since it was mis-declared as a runtime dependency. `npm audit --omit=dev` now reports 0 vulnerabilities. The core-agent download/extract path is verified against real releases via the existing agent-downloaders e2e suite (9/9) and an end-to-end app run. Fixes #373 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jrothrock
added a commit
that referenced
this pull request
Aug 26, 2026
Patch release covering the removal of the `download` dependency and its vulnerable transitive tree (decompress/got/http-cache-semantics), plus moving the test-only `tmp` dependency out of production installs. Syncs the yarn.lock self-reference to 2.1.1 so the release workflow's `yarn install --frozen-lockfile` stays consistent. See #374. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
mitchh456
approved these changes
Aug 26, 2026
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.
Summary
Resolves the transitive-dependency vulnerabilities reported in #373 by removing the
downloadpackage entirely and replacing it with a small, dependency-light downloader.The core-agent downloader previously used
download, which is effectively unmaintained and pulls in a large transitive tree that accounts for all the reported findings:decompress— critical (Zip-Slip / arbitrary file write via archive extraction)got@8— high (SSRF via redirect to a UNIX socket)http-cache-semantics@3— high (ReDoS)tmp@0.2.6— high (path traversal / symlink write), which was mis-declared as a runtime dependency but is only used by testsChanges
lib/agent-downloaders/fetch-extract.ts— replacesdownload(url, dir, {extract})using Node built-ins (httpswith redirect handling,zlibgunzip) plustar-streamfor extraction. It:core-agentbinary stays executable), anddecompresspath did not have. So this fixes the CVE class rather than just swapping libraries.HTTPError(withstatusCode) on non-2xx responses.web.ts— bothdownload(...)call sites now usedownloadAndMaybeExtract(...); removed dead imports.package.json— droppeddownload+@types/download; addedtar-stream+@types/tar-stream; movedtmp→devDependenciesand bumped to0.2.7.yarn.lock(drops ~2,300 transitive packages).Verification
npm audit --omit=dev→ 0 vulnerabilities (was 5).download,decompress,got,http-cache-semanticsare gone from the tree.tscbuild clean, lint clean.ENABLE_BINARY_TESTS=true) — fresh download, cache populate/reuse, custom URL, and 404 handling.755) and a malicious../tar entry correctly rejected.scout.install()→ real download → extract → core-agent daemon launched → live HTTP request instrumented.Fixes #373
🤖 Generated with Claude Code