Skip to content

chore(deps): clear the Dependabot alerts — viem to 2.55.19 plus toolchain bumps - #4

Merged
Rinse12 merged 4 commits into
masterfrom
chore/upgrade-viem
Aug 21, 2026
Merged

chore(deps): clear the Dependabot alerts — viem to 2.55.19 plus toolchain bumps#4
Rinse12 merged 4 commits into
masterfrom
chore/upgrade-viem

Conversation

@Rinse12

@Rinse12 Rinse12 commented Aug 21, 2026

Copy link
Copy Markdown
Member

Closes #3.

Takes the 48 open Dependabot alerts down to 18. Runtime scope goes to zero, and every alert that remains is dev-scope and outside this repo's reach.

Before After
npm audit --omit=dev (what consumers get) 2 0
npm audit (full dev tree) 48 18

No overrides block, no source changes — the diff is dependency versions in package.json plus the lockfile.


1. Runtime: viem 2.47.0 → 2.55.19

viem is the only entry in dependencies and the only path to a runtime alert. It pins ws exactly (8.18.3), so neither alert could be cleared by a lockfile refresh; it had to be a viem bump. 2.55.19 depends on ws@8.21.0, clearing both.

Severity CVE Vulnerable Patched
High CVE-2026-48779 — memory-exhaustion DoS from tiny fragments/data chunks >= 8.0.0, < 8.21.0 8.21.0
Medium CVE-2026-45736 — uninitialized memory disclosure >= 8.0.0, < 8.20.1 8.20.1
$ npm ls ws --omit=dev
@bitsocial/evm-contract-challenge@0.1.4
└─┬ viem@2.55.19
  ├─┬ isows@1.0.7
  │ └── ws@8.21.0 deduped
  └── ws@8.21.0

$ npm audit --omit=dev
found 0 vulnerabilities

2.47 → 2.55 review

Every **Breaking** entry in the changelog across that range is scoped to viem/tempo (renamed Tempo Earn recovery param, removed portalAddresses, zone.waitForDepositStatuszone.waitForTempoBlock, Tempo token Amount objects) or to the ERC-20 token actions resolving symbols from the Client tokens array. None of that is used here.

Nothing touches the paths this challenge does use — http()/fallback() transports, verifyMessage, getEnsAddress/normalize, encodeFunctionData/decodeFunctionResult, readContract, call, or the viem/chains exports. Two changes in range are mild improvements to those paths rather than regressions: 2.50.0 fixed getEnsAddress decoding of offchain DNS address records when coinType is specified, and 2.55.1 added optional blockHash/requireCanonical params to verifyMessage.


2. Toolchain bumps

Most of the dev-scope alerts fall out of upgrading the direct devDependency that owns them:

Package Clears
vitest 4.0.18 → 4.1.11 both Vitest UI criticals, plus vite, esbuild, postcss, nanoid, defu, fast-uri
release-it 19.2.4 → 21.0.2 the handlebars critical, plus ip-address, basic-ftp
@release-it/conventional-changelog 10.0.5 → 12.0.0 peer requirement of release-it 21
@commitlint/cli 20.4.3 → 21.2.2 ajvfast-uri
@commitlint/config-conventional 20.4.3 → 21.2.2
commitizen 4.3.1 → 4.3.2

The three major bumps are all dev tooling, and both configs work unchanged:

  • release-it 21 runs the existing config/.release-it.json as-is — verified with --dry-run --ci: the @release-it/conventional-changelog plugin loads, the changelog renders correctly for v0.1.4...v0.1.5, and the before:git:release hook is unaffected. No files were touched by the dry run.
  • commitlint 21 accepts the existing one-line commitlint.config.cjs; echo "chore(deps): x" | npx commitlint exits 0.

Both now want node ^22.21.0/>=22.12.0. CI already pins node-version: 22, which resolves to the latest 22.x. engines.node is deliberately left at >=22.0.0 — that field is the consumer contract and the shipped code runs fine on 22.0; narrowing it for a dev-tool reason would be a needless breaking change for downstreams.

3. Lockfile refresh, no overrides

js-yaml (3 quadratic-DoS advisories) and brace-expansion (4 DoS advisories) looked like they needed pinning, but they did not. cosmiconfig asks for js-yaml@^4.1.0 and minimatch 3 for brace-expansion@^1.1.7 — the patched 4.3.1 and 1.1.18 both sit inside those ranges, and the old lockfile was just holding stale resolutions. npm update js-yaml brace-expansion picomatch moves them with no package.json change at all.

One subtlety worth flagging for whoever touches the lockfile next, because it is easy to trip over:

isows (viem → isows@1.0.7) declares ws: "*" as a peer dependency, so it binds to whichever ws gets hoisted to the tree root. On a from-scratch rm package-lock.json && npm install, @pkcprotocol/pkc-js's exact ws@8.20.0 wins that slot and viem's isows binds to it — putting a vulnerable ws back into the production tree and taking npm audit --omit=dev from 0 back to 1.

The lockfile here was therefore refreshed incrementally rather than regenerated, which keeps viem's own 8.21.0 at the root. npm ci reproduces that tree exactly, so CI and Dependabot resolve the same thing.


4. What's left (18 alerts) and why it isn't fixable here

All 18 trace to @pkcprotocol/pkc-js — verified by walking npm why over every advisory in the audit output; nothing else in the tree is implicated. It is a devDependency, so none of it reaches npm install @bitsocial/evm-contract-challenge.

It splits into three groups, none of which this repo can move:

  • ws@8.20.0, undici@7.24.7, uuid@13.0.0 — pkc-js pins all three exactly, the same way viem pins its own ws. No range in this repo can resolve past them; only a pkc-js release can.
  • react-native / metro / metro-config / metro-transform-worker / image-size / @react-native/* — a React Native bundler toolchain reached via helia@libp2p/webrtcreact-native-webrtc. Never loaded by anything here.
  • protobufjs 6.11.6 / ipfs-unixfs / ipfs-unixfs-importer / ipld-dag-pb / @protobufjs/utf8 — under typestub-ipfs-only-hash, which pkc-js also pins exactly. Clearing these needs protobufjs 6 → 7/8, a two-major jump forced onto packages written against 6.x.

npm's own suggested fix for the whole group is a downgrade to @pkcprotocol/pkc-js@0.0.46, which is not an option: this challenge is written against 0.0.85 (see eca4c20), and pkc-js is the reference dependency for the package. 0.0.85 is the current latest, so there is nothing newer to move to either. The fix belongs upstream in pkc-js's own dependency pins.


Verification

  • npm run typecheck — clean
  • npm run build — clean
  • npm test98/98 passing across all 3 files, on vitest 4.1.11
  • npm ci from a clean tree — exits 0, root ws resolves to 8.21.0
  • npm audit --omit=dev — 0 vulnerabilities
  • npx release-it --dry-run --ci — config loads, changelog correct, no files touched
  • npx commitlint — exits 0 on a conventional message

test/viem-client.test.ts deliberately does not mock viem, so its 19 tests exercise real transport construction and would have caught a transport regression from the 2.47 → 2.55 bump.

viem pins ws exactly, so the two runtime-scope Dependabot alerts
(CVE-2026-48779 memory-exhaustion DoS, CVE-2026-45736 uninitialized
memory disclosure) could not be resolved by a lockfile refresh.
2.55.19 depends on ws@8.21.0, which patches both, so no overrides
entry is needed.

npm audit --omit=dev now reports 0 vulnerabilities. The remaining
Dependabot alerts are all dev-scope (vitest/vite/esbuild, release-it,
@pkcprotocol/pkc-js) and do not ship to consumers.

Every breaking change between 2.47 and 2.55 is scoped to viem/tempo or
to the ERC-20 token actions; none touch the transports, verifyMessage,
getEnsAddress, decodeFunctionResult or encodeFunctionData paths this
challenge uses. test/viem-client.test.ts exercises the real viem
unmocked and still passes.

Refs #3
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 326503c4-9e99-43c4-ad8a-28414c4100f2

📥 Commits

Reviewing files that changed from the base of the PR and between e636339 and 3cd826c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change updates runtime and development dependency versions in package.json. It also adds overrides for selected direct and transitive dependencies.

Changes

Dependency Version Alignment

Layer / File(s) Summary
Package versions and overrides
package.json
Updates viem, commit tooling, release tooling, commitizen, release-it, and vitest. Adds overrides for js-yaml, brace-expansion, and selected @pkcprotocol/pkc-js dependencies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 3cd82

The dependency updates and scoped overrides preserve valid runtime resolution and supported Node requirements; no actionable merge-blocking risk remains after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the dependency upgrades and the primary viem update described in the pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/upgrade-viem

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Bumps the toolchain to the versions that carry the fixes:

  vitest                             4.0.18 -> 4.1.11  (vite/esbuild/
                                     picomatch/postcss/nanoid/defu/fast-uri,
                                     incl. both Vitest UI criticals)
  release-it                         19.2.4 -> 21.0.2  (handlebars critical,
                                     js-yaml, brace-expansion, ip-address,
                                     basic-ftp)
  @release-it/conventional-changelog 10.0.5 -> 12.0.0  (peer of release-it 21)
  @commitlint/cli                    20.4.3 -> 21.2.2  (ajv -> fast-uri)
  @commitlint/config-conventional    20.4.3 -> 21.2.2
  commitizen                          4.3.1 -> 4.3.2

Two transitives have no fixed dependent to upgrade to, so they need
scoped overrides. Both stay inside their current major:

  js-yaml@^4          -> 4.3.1    (cosmiconfig 9 pins ^4.1.0)
  brace-expansion@^1  -> 1.1.18   (commitizen -> glob 7 -> minimatch 3)

The rest all sit under @pkcprotocol/pkc-js, whose only npm-offered fix
is a downgrade to 0.0.46 — not an option, the challenge is written
against 0.0.85. Overriding the leaves that have a clean same-major
patch, scoped to that subtree so viem's exact ws pin is left alone:

  ws 8.20.0 -> 8.21.3, uuid 13.0.0 -> 13.0.1, undici 7.24.7 -> 7.29.0

Total goes 48 -> 13. What remains is the react-native/metro/image-size
subtree pulled in by helia -> @libp2p/webrtc -> react-native-webrtc,
and protobufjs 6.x under typestub-ipfs-only-hash. Both would need
cross-major overrides on transitive internals to silence, neither ever
executes here, and pkc-js is a devDependency so none of it ships.

release-it 21 runs the existing config/.release-it.json unchanged
(verified by --dry-run: plugin loads, changelog and hooks unaffected)
and commitlint 21 accepts the existing commitlint.config.cjs. Both now
want node ^22.21.0; CI already uses node 22 latest. engines.node is
left at >=22.0.0 since that is the consumer contract and the shipped
code is unaffected.

Refs #3
@Rinse12 Rinse12 changed the title chore(deps): upgrade viem to 2.55.19 to clear the runtime ws alerts chore(deps): clear the Dependabot alerts — viem to 2.55.19, toolchain bumps, scoped overrides Aug 21, 2026
The bare "ws" / "uuid" / "undici" keys applied to every consumer in the
@pkcprotocol/pkc-js subtree, including ones declaring an older major:
react-native and metro ask for ws@^7, so the lockfile ended up recording
ws@8.21.3 against a ^7 range. npm install tolerates that and writes the
lock anyway; npm ci correctly refuses it, which broke CI.

Adding the range selector confines each override to the major that
actually has the advisory, leaving the older consumers alone:

  ws@^8 -> 8.21.3      (ws@7.5.13 stays; the CVEs are >= 8.0.0 only)
  uuid@^13 -> 13.0.1   (uuid@11.1.1 stays)
  undici@^7 -> 7.29.0  (undici@8.10.0 stays)

Verified against a clean tree: rm -rf node_modules && npm ci exits 0,
npm audit is unchanged at 13 (all dev-scope, all under pkc-js),
npm audit --omit=dev is still 0, viem's own ws pin is still 8.21.0,
and typecheck, build and all 98 tests pass.
The overrides were not pulling their weight, and two of them were
covering for a stale lockfile rather than a real constraint.

js-yaml and brace-expansion needed nothing: cosmiconfig asks for
js-yaml@^4.1.0 and minimatch 3 for brace-expansion@^1.1.7, and the
patched 4.3.1 and 1.1.18 both sit inside those ranges. The old lock
was simply pinning stale resolutions. `npm update js-yaml
brace-expansion picomatch` moves them with no package.json change.

The three nested under @pkcprotocol/pkc-js could not be replaced the
same way — pkc-js pins ws, undici and uuid exactly (8.20.0, 7.24.7,
13.0.0), so nothing this repo does short of an override can move them.
That makes them upstream's to fix, in a pkc-js release, rather than
something to paper over here. Dropping them puts the count at 18
instead of 13.

Worth recording why the lockfile was refreshed surgically rather than
regenerated: isows declares `ws: "*"` as a peer, so it binds to
whichever ws is hoisted to the root. On a from-scratch `rm
package-lock.json && npm install`, pkc-js's exact 8.20.0 wins that slot
and viem's isows binds to it, putting a vulnerable ws back in the
production tree — `npm audit --omit=dev` goes from 0 to 1. Rebuilding
incrementally keeps viem's 8.21.0 at the root. `npm ci` reproduces that
tree, so CI and Dependabot see the same thing.

All 18 remaining alerts trace to @pkcprotocol/pkc-js (verified by
walking `npm why` over every advisory); it is a devDependency, so none
of them ship. npm audit --omit=dev is 0, npm ci exits 0, typecheck,
build, commitlint and release-it --dry-run are clean, and all 98 tests
pass.
@Rinse12 Rinse12 changed the title chore(deps): clear the Dependabot alerts — viem to 2.55.19, toolchain bumps, scoped overrides chore(deps): clear the Dependabot alerts — viem to 2.55.19 plus toolchain bumps Aug 21, 2026
@Rinse12
Rinse12 merged commit d4ffba5 into master Aug 21, 2026
3 checks passed
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.

chore(deps): triage the 48 Dependabot alerts on master — only ws, via viem, reaches consumers

1 participant