Fix: clear the tar, shell-quote, @tootallnate/once and tmp advisories via npm overrides - #798
Open
AmaadMartin wants to merge 1 commit into
Open
Fix: clear the tar, shell-quote, @tootallnate/once and tmp advisories via npm overrides#798AmaadMartin wants to merge 1 commit into
AmaadMartin wants to merge 1 commit into
Conversation
…sories Four transitive packages carry 17 open advisories that no in-range bump can reach, so a root overrides block is the only mechanism that moves them. tar@6.2.1 is the last 6.x release and every one of its advisories is first patched on a 7.5.x version. concurrently pins shell-quote to an exact version. @mikro-orm/sqlite pins sqlite3 to exactly 5.1.7, and sqlite3@5.1.7 drags in node-gyp@8 -> make-fetch-happen@9 -> http-proxy-agent@4 -> @tootallnate/once@1.1.2. Overriding @tootallnate/once or http-proxy-agent directly does not work: that chain is optional, so npm drops the node instead of replacing it and leaves a dangling edge. Overriding sqlite3 to ^6.0.1 deletes the chain, because sqlite3@6 depends on tar ^7.5.10 and peers node-gyp 12, neither of which uses make-fetch-happen@9. It also removes the last tar 6-era consumers, so the forced tar 7 no longer sits under a package written against the tar 6 API. tmp@0.0.33 arrives through gts -> inquirer -> external-editor. gts@7, the latest release, still resolves the same chain. The tar and shell-quote entries were first written for fork PR #684, which this change supersedes. npm audit: 46 -> 32 (critical 3 -> 0, high 14 -> 8, low 7 -> 2). Lockfile: 1174 -> 1131 nodes, 0 unresolved required edges before and after.
AmaadMartin
force-pushed
the
fix/dependabot-tar-once-tmp-overrides
branch
from
August 8, 2026 07:31
387f06a to
bbfc38a
Compare
AmaadMartin
changed the base branch from
fix/dependabot-tar-shell-quote-overrides
to
main
August 8, 2026 07:32
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
Related: google#448
Problem: 17 of the 46 open Dependabot alerts sit on four transitive
packages that no in-range bump can reach.
tar@6.2.1is the last 6.x releaseand every one of its 12 advisories is first patched on a 7.5.x version.
concurrentlypinsshell-quoteto an exact version,@mikro-orm/sqlitepinssqlite3to exactly5.1.7, andgts@7, the latest release, still resolvesinquirer -> external-editor -> tmp ^0.0.33.sqlite3@5.1.7is the root causeof most of the cluster, because it drags in
node-gyp@8 -> make-fetch-happen@9 -> http-proxy-agent@4 -> @tootallnate/once@1.1.2.Solution: A root
overridesblock forces each package to the highestfirst-patched version in its cluster. I override
sqlite3rather than@tootallnate/onceorhttp-proxy-agent, because that chain is optional: npmdrops the node instead of replacing it and leaves a dangling edge.
sqlite3@6depends on
tar ^7.5.10and peersnode-gyp 12, so it deletes the legacy chainand takes the last
tar6-era consumers with it, which means the forcedtar7no longer sits under a package written against the
tar6 API. No source filechanges:
tarandsqlite3are install-time only,shell-quoteandtmparedev-only.
The 17 alerts, enumerated from
gh api repos/google/adk-js/dependabot/alertstarshell-quotetmp@tootallnate/once@tootallnate/oncehas no override entry because the package leaves the tree.The only copy left is
node_modules/teeny-request/node_modules/@tootallnate/once@2.0.1, already atthe patched floor.
Why each entry is load-bearing
shell-quoteconcurrently1.8.3exactsqlite3@mikro-orm/sqlite5.1.7exacttmpexternal-editor^0.0.33tarsqlite3@6.0.1/node-gyp@12.4.0^7.5.10/^7.5.4The
tarentry is the one that does no work today: after thesqlite3bump itstwo consumers float to 7.5.22 unaided. It stays as a security floor and becomes
load-bearing again the moment the
sqlite3override goes away.Collision check
I listed all 300 open pull requests on the working fork and diffed every
adjacent one. Fork PR #684 wrote the
tarandshell-quoteentries; it hasbeen open and untouched since 2026-08-05, so this change carries them forward
and supersedes it. Close #684 if this lands. #797 upgrades the
@mikro-ormfamily to v7, which removes
sqlite3from the tree entirely; when it lands,delete the
sqlite3override, because npm ignores an override for a packagethat is not in the tree. No other open pull request touches these four
packages.
Limits of this change
Consumers who install
@google/adk-devtoolsstill getsqlite3@5.1.7. npmoverridesare a workspace-local resolution directive and are not honoured forconsumers of a published package. This clears the alerts, because Dependabot
reads the committed
package-lock.json, and it fixes this repository's owninstalls and CI. It does not fix downstream installs; the durable fix is the
MikroORM v6 to v7 migration.
Testing Plan
Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.
Unit Tests:
This change adds no executable line, so there is no new code to cover and no
unit test for a lockfile would be meaningful. I ran the suites that reach the
overridden packages instead, plus the whole CI gate sequence, on Node v22.22.2,
linux-x64:
npm ci --registry=https://registry.npmjs.orgnpm run buildnpx vitest run --project unit:core core/test/sessions/database_session_service_test.ts core/test/sessions/db/operations_test.tsnpx vitest run --project integration tests/integration/lazy_load_db_drivers/... tests/integration/sessionsnpm run lintnpm run format:checknpm run docs:checknpx secretlint package.json package-lock.jsondatabase_session_service_test.tsdrives the realsqlite3driver against:memory:, so those 26 tests are thesqlite35 to 6 canary, not a mock.Control run (proving the overrides are what move the tree)
I ran the identical regeneration command against
main's manifest with theoverridesblock absent:Without the block the tree does not move:
tar@6.2.1,shell-quote@1.8.3,sqlite3@5.1.7,tmp@0.0.33,@tootallnate/once@1.1.2,http-proxy-agent@4.0.1, 1174 nodes. With it:tar@7.5.22,shell-quote@1.10.0,sqlite3@6.0.1,tmp@0.2.7, both vulnerable nodes gone,1131 nodes.
npm updatealone is not what produces the effect.Dangling-edge gate
A forced override can make npm silently drop an unsatisfiable optional node,
which is exactly how the
@tootallnate/onceandhttp-proxy-agentoverridesfail. I walked every
dependencies/optionalDependencies/peerDependencies/devDependenciesedge in the lockfile through thenode_moduleswalk-up, before and after.mainThe one new optional-peer edge is
node-fetch -> encoding@^0.1.0.node-fetch@2.7.0declarespeerDependenciesMeta.encoding.optional = true, andencoding@0.1.13was in the tree only as aminipass-fetch@1dependency, whichthis change removes. An optional peer is allowed to be absent, so I did not add
encodingback.npm audit
46 to 32, no new advisory. Cleared:
tar,shell-quote,concurrently,@mikro-orm/sqlite,sqlite3,node-gyp,cacache,make-fetch-happen,http-proxy-agent,@tootallnate/once,gts,inquirer,external-editor,tmp.mainCompatibility of the two majors
sqlite35 to 6 is the real risk, because it is a native addon and it overrulesan exact pin.
sqlite3@6.0.1loads and reports SQLite 3.52.0, and the 26real-driver session tests pass.
tmp0.0.33 to 0.2.7 crossesexternal-editor@3.1.0, whose only call istmp.tmpNameSync(); I constructedan
ExternalEditor, confirmed it wrote its temp file and confirmedcleanup()removed it. That path is dev-only and this repository never executes it:
external-editoris reached only byinquirer's editor prompt, which isreached only by
gts init, and this repository usesgtssolely fortsconfig.json'sextends.sqlite3@6.0.1publishes napi prebuilds forlinux-x64,linux-arm64,linuxmusl-x64,linuxmusl-arm64,darwin-x64,darwin-arm64andwin32-x64. I downloaded thewin32-x64anddarwin-arm64assets andconfirmed each contains
build/Release/node_sqlite3.node, soprebuild-installdoes not fall back to a source build on any runner. Therunners report Node v22.23.1 (ubuntu), v22.23.2 (windows) and v24.18.0 (macos),
all above
sqlite3@6.0.1's declaredengines: >=20.17.0andnode-gyp@12's^20.17.0 || >=22.9.0. The fullrun-testsmatrix passed on all three ofubuntu-latest,windows-latestandmacos-latest, so the native install isconfirmed rather than inferred.
Manual End-to-End (E2E) Tests
The lockfile holds exactly one
tar, oneshell-quote, onesqlite3and onetmpnode, with no nested duplicates. It was regenerated with npm 11, becausenpm 9 does not write the
licensefield and strips it from every entry itrewrites.
Checklist