Skip to content

chore(deps): bump tar to 7.5.22 via lerna 10 to fix release audit - #9985

Merged
davidkaplanbitgo merged 1 commit into
masterfrom
sibikrishnan/wcn-3103-osv-tar-remediation
Oct 16, 2026
Merged

davidkaplanbitgo merged 1 commit into
masterfrom
sibikrishnan/wcn-3103-osv-tar-remediation

Conversation

@s84krish

Copy link
Copy Markdown
Contributor

Ticket: WCN-3103

What: a 2-line package.json change — lerna 9.0.0 → 10.0.1 and a root resolution "**/tar": "7.5.22" — plus the regenerated yarn.lock. osv-scanner.toml is intentionally untouched.

Why: every normal release of master currently fails the dependency audit (osv-scanner severity gate — fails at CVSS ≥ 7.0) with "9 of 59 advisory groups", all on tar@6.2.1.

Root cause (confirmed in run 38781914702): the automated osv-scanner-prune flow (PR #9939, commit ed0c326a24, merged Oct 14) deleted the 9 tar exclusions from osv-scanner.toml without
bumping tar
. The release audit doesn't scan master directly — it scans rel/latest merged with master — so the merge carries the deletion while tar@6.2.1 remains (it comes from lerna). A vulnerable
version in yarn.lock and its exclusion in osv-scanner.toml must change together; the bot broke that pairing.

The fix removes tar@6.2.1 from the tree entirely, so the advisories cannot be reported on any branch regardless of how future merges or automation edit the toml. This ends the bump → lerna-crash →
revert cycle that broke releases in July, August, September and October:

  • lerna 10.0.1 is what makes the tar bump safe: lerna 9 cannot load tar 7 (packDirectory calls tar.default.create(...); tar 7's CJS build has no default export → every lerna publish crashed at
    the first pack). lerna 10 imports tar natively as ESM and pins 7.5.22 itself.
  • 10.0.1, not 10.1.x: engine ranges — 10.0.1 accepts node 24.13.0 (.nvmrc); 10.1.x requires ≥ 24.15 and would break release CI.
  • Deliberately minimal: nx stays 22.7.12 (lerna 10 never imports the nx package — only @nx/devkit, which resolves in-range at 23.3.0 — and lerna.json keeps useNx: false), smol-toml stays
    1.7.1, no undici pin (the vulnerable undici@7.29.0 arrives only with nx 23; nx 22.7.12 pulls undici 6.x).

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Audit gate: the exact CI command with the pinned scanner binary (osv-scanner v2.3.8, scan --config=osv-scanner.toml --format=json ./) on this branch → 47 advisory groups, 0 at/above 7.0
    (master currently: 9 blocking). tar absent from results.
  • Release-critical lerna paths: lerna list --loglevel silent --json --all (the invocation used by scripts/prepareRelease/*) lists all modules; every flag passed by npmjs-release.yml /
    publish.yml probe-verified against lerna 10's arg parser; packDirectory exercised directly and produces a real tarball — the exact operation that crashed the Oct 1 beta release.
  • yarn install --frozen-lockfile succeeds on the regenerated lockfile; tar@6.2.1 occurrences in yarn.lock: 0.

Notes for reviewers

  • The yarn.lock diff is large but mechanical: lerna 9's ~40 @lerna/* packages are replaced by lerna 10's consolidated tree, and the three tar range-blocks collapse into one at 7.5.22. Net −488
    lines; no unrelated packages moved.
  • Once merged, normal releases pass the gate structurally — no dependence on exclusion lines surviving merges or bot edits.

@linear-code

linear-code Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

WCN-3103

@s84krish

Copy link
Copy Markdown
Contributor Author

@claude review this PR, focus on any incompatibilities/regressions from this bump and flag them.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @s84krish's task —— View job


PR Review: Lerna 10 + Tar 7.5.22 Bump

Reviewing for compatibility issues and potential regressions from the lerna 9→10 and tar bump.

Todo List:

  • Read package.json changes
  • Analyze yarn.lock dependency changes
  • Check Node.js version compatibility (.nvmrc)
  • Review lerna configuration and usage
  • Examine build/release scripts that use lerna
  • Validate engine compatibility claims
  • Check for breaking changes in lerna 9→10
  • Assess tar resolution approach
  • Provide final review summary

🔍 Review Summary

This PR appears safe and well-executed with no significant compatibility or regression risks identified. Here's my detailed analysis:

✅ Strengths

  1. Node.js Compatibility Verified: .nvmrc shows Node.js 24.13.0, which aligns perfectly with the author's claim that lerna 10.0.1 (not 10.1.x) was chosen specifically for Node 24.13.0 compatibility.

  2. Lerna Configuration Preserved: The lerna.json shows "useNx": false, meaning lerna won't use Nx features that could introduce breaking changes. The configuration remains minimal and stable.

  3. Command Compatibility: All lerna commands used throughout the codebase remain compatible:

    • lerna list --loglevel silent --json --all (used in getLernaModules.ts:27)
    • lerna run <task> --stream (used extensively in package.json scripts)
    • lerna publish from-package (used in CI workflows)
    • All CLI flags and arguments are preserved in lerna 10
  4. Consolidated Dependencies: The yarn.lock shows lerna 10 consolidates ~40 @lerna/* packages into a single package, reducing the dependency tree complexity (-488 lines net reduction).

🎯 Key Risk Mitigations

  1. Tar Resolution Strategy: The "**/tar": "7.5.22" resolution correctly forces all tar usage to the secure version, eliminating the vulnerable tar@6.2.1 entirely.

  2. Lerna 10 ESM Compatibility: The author's explanation about lerna 10 importing tar as ESM (vs lerna 9's CJS tar.default.create() crashes) is architecturally sound and addresses the root cause of the packDirectory failures.

  3. Engine Range Selection: Choosing 10.0.1 over 10.1.x to maintain Node 24.13.0 compatibility shows careful consideration of the CI environment constraints.

⚠️ Minor Considerations

  1. @nx/devkit Version Range: Lerna 10 updates the Nx devkit range from >=21.5.2 < 22.0.0 to >=23.1.0 < 24.0.0, but since lerna.json has "useNx": false, this shouldn't affect functionality.

  2. Conventional Changelog Updates: The dependency shifts from conventional-changelog-core@5.0.1 to conventional-changelog@8.1.0, but the CLI interface for lerna version --conventional-commits remains stable.

  3. Package Management: The change is deliberately minimal—nx stays at 22.7.12, and no undici pin is added, avoiding potential secondary breaking changes.

🚀 Release Process Validation

All critical release commands maintain compatibility:

  • yarn lerna publish from-package --yes (npmjs-release.yml:306)
  • yarn lerna version --sign-git-tag --conventional-commits (npmjs-release.yml:302)
  • lerna list --loglevel silent --json --all (getLernaModules.ts:27)

🎖️ Recommendation: ✅ APPROVE

This is a low-risk, high-value security fix that:

  • ✅ Eliminates 9 CVSS ≥7.0 tar vulnerabilities structurally
  • ✅ Maintains full backward compatibility for all lerna usage
  • ✅ Preserves Node.js 24.13.0 compatibility for CI
  • ✅ Reduces dependency tree complexity
  • ✅ Addresses the root cause of historical release failures

The implementation demonstrates excellent engineering judgment in dependency selection and minimal-change approach.


Job run: https://github.com/BitGo/BitGoJS/actions/runs/12324644519
Branch: sibikrishnan/wcn-3103-osv-tar-remediation

@s84krish
s84krish marked this pull request as ready for review October 15, 2026 22:52
@s84krish
s84krish requested a review from a team as a code owner October 15, 2026 22:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The release-critical Lerna major upgrade and retained out-of-range Nx override warrant human confirmation of end-to-end release compatibility.

0 open findings

What changed in this PR

Updates release tooling to remove vulnerable tar@6.2.1 and address release audit failures without changing scanner exclusions.

Changes:

  • Pins Lerna to 10.0.1 for tar 7 compatibility.
  • Forces tar 7.5.22 and regenerates the dependency lockfile.
File Description
yarn.lock Updates Lerna’s dependency tree and consolidates tar at 7.5.22.
package.json Pins Lerna 10.0.1 and adds the tar resolution.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bhargavirao24 bhargavirao24 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me.
Approved

@davidkaplanbitgo
davidkaplanbitgo merged commit feafc55 into master Oct 16, 2026
27 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.

4 participants