Skip to content

chore: fix audit:ci and harden dependency installs - #443

Merged
yahgwai merged 8 commits into
developfrom
chore/audit-ci-triage
Jul 30, 2026
Merged

chore: fix audit:ci and harden dependency installs#443
yahgwai merged 8 commits into
developfrom
chore/audit-ci-triage

Conversation

@yahgwai

@yahgwai yahgwai commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Makes audit:ci pass.

  • Refreshed yarn.lock within existing version ranges.
  • Added two resolutions: hardhat-deploy/axios to >=0.33.0 <1 (scoped, so eth-gas-reporter keeps its own axios; floating so future 0.x backports land on a refresh), and undici to ^6.27.0 (global, as hardhat and hardhat-verify share one hoisted copy).
  • Rewrote the audit-ci.jsonc allowlist: removed entries that no longer match anything, and added new ones.
  • Moved CI to node 24, setup-node to v4, audit matrix to [24]: the package lock refresh pulls @nomicfoundation/edr (engines >= 20, via hardhat 2.29.0) and brace-expansion 5.0.8 (engines "20 || >=22", via @types/minimatchminimatch@*), and yarn treats an engines mismatch as a hard error, so every job died at yarn install. 18 and 20 are both EOL, 24 is the active LTS, and setup-node@v3 was already being force-migrated to the node 24 runtime.

Closes #441, #442, #433.

yahgwai added 8 commits July 28, 2026 16:46
The lockfile had not been refreshed since 2026-01-10, so a large number of
transitive dependencies were pinned to versions that had since been patched
upstream. Refreshing resolves 40 of the 81 advisories blocking audit:ci,
including the only critical one (handlebars 4.7.8 -> 4.7.9, JavaScript
injection via AST type confusion).

No package.json changes: every version moved stays inside the semver ranges
already declared, so this is purely a lockfile catch-up.
Both are pinned by parents that will never widen their range on the Hardhat 2
line, so a lockfile refresh cannot reach the fixes:

  hardhat-deploy pins axios ^0.21.1 in every release through 1.0.4; axios is
  only dropped in hardhat-deploy 2.x, which requires Hardhat 3. The override is
  scoped to hardhat-deploy so eth-gas-reporter keeps its already-patched axios
  1.18.1, and uses a floating >=0.33.0 <1 range so future 0.x security
  backports arrive via a plain lockfile refresh rather than another pin bump.

  hardhat and @nomicfoundation/hardhat-verify both pin undici ^5.14.0 and share
  one hoisted copy; the fix needs hardhat-verify 3.x, which requires Hardhat 3.
  Overridden globally because scoping to one declarer leaves the other behind.

Clears 29 of the 41 advisories blocking audit:ci. Rationale and the conditions
for removing both overrides are recorded in audit-ci.jsonc.
…tries

Removes five allowlist entries that no longer match anything now that axios and
undici are patched (audit-ci reported them under "Consider not allowlisting").

Adds the twelve remaining advisories, all in dev tooling that cannot reach an
executed code path here. Each group records the specific condition that makes it
safe -- mocha not running in parallel, no WebSocketProvider anywhere, hardhat
calling only uuid v4, adm-zip used solely on checksum-verified solc downloads --
so the entry can be re-checked rather than taken on trust, and must be deleted
rather than re-justified if the condition stops holding.

Entries are per-advisory, not per-module, so a future advisory in any of these
packages still fails the build.
The six dependency installs ran as bare `yarn`/`yarn install`, which lets yarn 1
rewrite yarn.lock to satisfy package.json instead of failing. That silently
papers over a lockfile/manifest mismatch and loses the guarantee that CI tested
the tree that was committed and reviewed.

Also pins the six OffchainLabs/actions references from the mutable @main branch
to a commit hash. These run with a token that has write access, so a mutable ref
means anyone able to push to that branch can execute code in this repository's
pipeline.
The refreshed lockfile pulls two packages that refuse to install on node
18: @nomicfoundation/edr (engines >= 20, via hardhat 2.29.0) and
brace-expansion 5.0.8 (engines "20 || >=22", via @types/minimatch asking
for minimatch at "*"). Every job died at yarn install as a result.

Holding those back is not viable -- the dependency bumps in that refresh
are what clear the advisories audit:ci is meant to catch, so the refresh
and the audit fix are the same change. Node 24 is the active LTS
(supported to 2028-04-30); node 18 and 20 are both already end-of-life.

setup-node v3 is deprecated and was being force-migrated to the node 24
runtime anyway, so bump it on the same lines.
@yahgwai
yahgwai requested a review from a team July 29, 2026 10:03

@TucksonDev TucksonDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor flag (probably no need to change)

Comment thread package.json
},
"resolutions": {
"hardhat-deploy/axios": ">=0.33.0 <1",
"undici": "^6.27.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undici comes from hardhat-verify, which uses ^v5.14, and here we force ^v6. It should be fine, since it looks like it's only used for stable request/fetch APIs, but something to keep in mind.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeh, ci is passing so it should be fine

@yahgwai
yahgwai merged commit ad67c2f into develop Jul 30, 2026
14 checks passed
@yahgwai
yahgwai deleted the chore/audit-ci-triage branch July 30, 2026 10:46
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.

3 participants