Skip to content

Bump tar to 8.1.2 - #39769

Merged
karanh37 merged 2 commits into
mainfrom
karanh37/ghsa-4pf9-5fpx-xmr6-vulnerability-fix
Dec 4, 2026
Merged

karanh37 merged 2 commits into
mainfrom
karanh37/ghsa-4pf9-5fpx-xmr6-vulnerability-fix

Conversation

@karanh37

@karanh37 karanh37 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

No linked issue: this is a dependency bump for advisory GHSA-4pf9-5fpx-xmr6. In tar >= 7.5.5 and < 8.0.0, an archive can create a symlink that escapes the extraction directory through a chain of symlinks inside the archive. 7.x has no patched release.

Both UI projects resolved [email protected]. It comes only through node-gyp@latest, which Yarn 4 adds to any package whose registry scripts mention node-gyp (fsevents, tree-sitter*, evp_bytestokey, node-addon-api, @swagger-api/apidom-parser-adapter-json).

This PR adds a resolutions entry, "tar": "^8.1.2", to:

  • openmetadata-ui/src/main/resources/ui/package.json
  • openmetadata-ui-core-components/src/main/resources/ui/package.json

The lockfiles were regenerated. tar's old 7.x deps (chownr, minizlib, @isaacs/fs-minipass) drop out.

Why forcing the major is safe here: tar 8 rewrote its API, and [email protected] (still on tar@^7.5.7; the upgrade is pending in nodejs/node-gyp#3396) cannot extract headers with it. But node-gyp never runs in our installs:

  • every native dependency ([email protected]/0.22.4, tree-sitter-json, @tree-sitter-grammars/tree-sitter-yaml, fsevents) loads ready-made N-API binaries for darwin, linux and win on x64 and arm64;
  • [email protected] and tree-sitter-json are already built: false;
  • the Maven UI build installs with --mode=skip-build.

Once node-gyp ships tar 8 support, this resolution can be dropped.

Type of change:

  • Bug fix

High-level design:

N/A — small dependency resolution change (2 package.json lines plus lockfiles).

Tests:

Which test layer and why

No new tests: this is a dependency resolution with no code change. Verification was a full build, plus running the app.

Use cases covered

  • Both UI projects install with yarn install --immutable and build scripts enabled; node_modules/tar is 8.1.2 and no native module compiles from source.
  • The app builds and runs with the new resolution.

Unit tests

Not applicable — no code changes.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI source changes). The full suite runs in the merge queue.

Manual testing performed

All on Node v22.23.5 (.nvmrc):

  1. Ran yarn install --immutable in both UI projects with build scripts enabled. Both passed. yarn why tar shows [email protected] → [email protected], and no tree-sitter* package produced a build/ folder.
  2. Ran mvn -DskipTests clean package. BUILD SUCCESS, all modules, 2:57, including both UI modules' yarn install --immutable and Vite builds.
  3. Ran ./docker/run_local_docker.sh -s true -i false. Server, MySQL and Elasticsearch are healthy, and /api/v1/system/version reports the built revision.
  4. Logged in as admin and opened Explore and /docs (the swagger/apidom page whose deps pull in node-gyp). Both rendered with 0 console errors.
  5. Loaded every native prebuild with node-gyp-build to confirm none falls back to node-gyp.

UI screen recording:

Not applicable — dependency resolution only; no UI behaviour change.

Checklist:

  • I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.
  • My PR title is Fixes <issue-number>: <short explanation> — no issue; dependency bump.
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above — no issue; dependency bump.
  • I have commented on my code, particularly in hard-to-understand areas. — N/A; package.json takes no comments, so the reasoning is above.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. — N/A
  • For a UI feature or feature task: … — N/A, not a UI feature.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above. — N/A, verification listed above.
  • Self-review: I reviewed the final diff against REVIEW.md and fixed every 🔴 finding, or answered it on the line below.
    Reviewed 7cce24fe707. REVIEW.md excludes yarn.lock and lockfile-only bumps from review. For "a dependency major" I checked Collate: its UI does not depend on tar, so no companion PR is needed. No 🔴 findings.
  • Decision check: N/A — no new contract or default; the resolution is temporary until node-gyp supports tar 8.

tar <8.0.0 lets an archive create a symlink that escapes the extraction
directory through an in-archive symlink chain. tar is only pulled in by
node-gyp@latest, which Yarn injects for packages whose scripts mention
node-gyp; node-gyp never runs in our installs because every native
dependency ships N-API prebuilds.
"serialize-javascript": "7.1.4",
"postcss-selector-parser": "7.1.7"
"postcss-selector-parser": "7.1.7",
"tar": "^8.1.2"

@gitar-bot gitar-bot Bot Dec 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Bug: tar 8 pin breaks node-gyp's header download, and node-gyp can run

This pull request contradicts the Accepted record ADR:2026-11-19-ui-yarn-resolutions-pin-only-what-a-fresh-resolve-gets-wrong, so it is blocking. That record says a resolution may cross a major its dependent did not declare only "after checking that what the dependent imports still exists in the forced major". tar has one requester in both lockfiles, [email protected], which declares tar: ^7.5.7. The description skips that check and argues that node-gyp never runs.

That argument does not hold. Yarn injects node-gyp@npm:latest into [email protected], @tree-sitter-grammars/[email protected], [email protected] and others. Only [email protected] and tree-sitter-json have built: false. The other packages install through node-gyp-build, and its install script falls back to node-gyp rebuild when no matching prebuild exists. The record already notes that linux arm64 is missing working prebuilds for some tree-sitter packages.

The import check fails. node-gyp's install.js downloads headers by using tar.extract({strip, filter, cwd}) as the destination of a stream pipeline. tar v8.0.0 removed Node stream support from its commands, and extract() now has to be given an input option or a file. On any machine where a build falls back to source, the header download breaks, and so does the install.

The bare tar key also leaves out the dependent's name. The record's consequences rely on each pin naming its dependent so that removing it later is a lookup.

Either supersede the record with a new ADR stating that the pin knowingly breaks node-gyp source builds (and add dependenciesMeta built: false for every remaining native package so node-gyp truly never runs), or keep tar within node-gyp's major and scope the pin to the dependent so it is removed when node-gyp ships tar 8 support (nodejs/node-gyp#3396). Note: this scoped pin is only valid if a patched 7.x exists; otherwise the ADR supersession is required.:

"node-gyp/tar": "^8.1.2"

Was this helpful? React with 👍 / 👎

@karanh37
karanh37 marked this pull request as ready for review December 4, 2026 10:25
@karanh37
karanh37 requested a review from a team as a code owner December 4, 2026 10:25
@karanh37
karanh37 requested review from a team and Rohit0301 and a balanced review from Copilot and removed request for a team December 4, 2026 10:25
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@karanh37 karanh37 added the To release Will cherry-pick this PR into the release branch label Dec 4, 2026

Copilot AI 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.

🔵 Needs a closer look

The override breaks node-gyp’s header-extraction API, making reliance on native prebuilds and loss of source-build fallback require cross-platform validation unavailable in this review.

No open issues 🎉

What changed in this PR

No blocking issues. This PR updates the transitive tar dependency in both UI projects to address GHSA-4pf9-5fpx-xmr6.

Changes:

  • Adds tar: ^8.1.2 resolutions to both manifests.
  • Regenerates lockfiles with tar 8.1.2 and removes unused dependencies.

Placement: Affects UI installation tooling, not application source. Reported build and installation checks were not independently verified.
Trade-off: none — no user-visible cost.
Recommendation: Approve based on the supplied changes.

File Description
openmetadata-ui/​src/​main/​resources/​ui/​yarn.lock Locks tar 8.1.2 and removes obsolete dependencies.
openmetadata-ui/​src/​main/​resources/​ui/​package.json Adds the UI application's tar resolution.
openmetadata-ui-core-components/​src/​main/​resources/​ui/​yarn.lock Locks tar 8.1.2 and removes obsolete dependencies.
openmetadata-ui-core-components/​src/​main/​resources/​ui/​package.json Adds the component library's tar resolution.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 4, 2026 10:49

Copilot AI 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.

🔵 Needs a closer look

The tar 8 override breaks node-gyp 13.1.0 header extraction, while native prebuild coverage and cross-platform source-build fallback remain unverified.

No open issues 🎉

Review effort: Balanced

@gitar-bot

gitar-bot Bot commented Dec 4, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 🟡 Medium risk 0 closed / 1 findings

Forcing tar 8 across both UI dependency trees changes archive-extraction tooling; incompatibility with node-gyp could disrupt installs or native builds.

Bumps tar to ^8.1.2 via resolutions in both UI package.json files to clear GHSA-4pf9-5fpx-xmr6, but the change has an open blocking finding. [email protected] still depends on tar@^7.5.7, and tar 8 removed the stream-based extract() API that node-gyp's header download uses, so any native build that falls back to source would fail during install.

  • Pin should name its dependent (node-gyp) and the import check required by the accepted resolutions ADR must be done before merge
  • Native packages fall back to node-gyp rebuild when no matching prebuild exists, so the "node-gyp never runs" justification does not hold
⚠️ Bug: tar 8 pin breaks node-gyp's header download, and node-gyp can run

📄 openmetadata-ui/src/main/resources/ui/package.json:346 📄 openmetadata-ui-core-components/src/main/resources/ui/package.json:201

This pull request contradicts the Accepted record ADR:2026-11-19-ui-yarn-resolutions-pin-only-what-a-fresh-resolve-gets-wrong, so it is blocking. That record says a resolution may cross a major its dependent did not declare only "after checking that what the dependent imports still exists in the forced major". tar has one requester in both lockfiles, [email protected], which declares tar: ^7.5.7. The description skips that check and argues that node-gyp never runs.

That argument does not hold. Yarn injects node-gyp@npm:latest into [email protected], @tree-sitter-grammars/[email protected], [email protected] and others. Only [email protected] and tree-sitter-json have built: false. The other packages install through node-gyp-build, and its install script falls back to node-gyp rebuild when no matching prebuild exists. The record already notes that linux arm64 is missing working prebuilds for some tree-sitter packages.

The import check fails. node-gyp's install.js downloads headers by using tar.extract({strip, filter, cwd}) as the destination of a stream pipeline. tar v8.0.0 removed Node stream support from its commands, and extract() now has to be given an input option or a file. On any machine where a build falls back to source, the header download breaks, and so does the install.

The bare tar key also leaves out the dependent's name. The record's consequences rely on each pin naming its dependent so that removing it later is a lookup.

Either supersede the record with a new ADR stating that the pin knowingly breaks node-gyp source builds (and add `dependenciesMeta` `built: false` for every remaining native package so node-gyp truly never runs), or keep tar within node-gyp's major and scope the pin to the dependent so it is removed when node-gyp ships tar 8 support (nodejs/node-gyp#3396). Note: this scoped pin is only valid if a patched 7.x exists; otherwise the ADR supersession is required.
"node-gyp/tar": "^8.1.2"
🤖 Prompt for agents
Code Review: Bumps `tar` to `^8.1.2` via `resolutions` in both UI `package.json` files to clear GHSA-4pf9-5fpx-xmr6, but the change has an open blocking finding. `[email protected]` still depends on `tar@^7.5.7`, and tar 8 removed the stream-based `extract()` API that node-gyp's header download uses, so any native build that falls back to source would fail during install.
  
  - Pin should name its dependent (`node-gyp`) and the import check required by the accepted resolutions ADR must be done before merge
  - Native packages fall back to `node-gyp rebuild` when no matching prebuild exists, so the "node-gyp never runs" justification does not hold

1. ⚠️ Bug: tar 8 pin breaks node-gyp's header download, and node-gyp can run
   Files: openmetadata-ui/src/main/resources/ui/package.json:346, openmetadata-ui-core-components/src/main/resources/ui/package.json:201

   This pull request contradicts the Accepted record ADR:2026-11-19-ui-yarn-resolutions-pin-only-what-a-fresh-resolve-gets-wrong, so it is blocking. That record says a resolution may cross a major its dependent did not declare only "after checking that what the dependent imports still exists in the forced major". `tar` has one requester in both lockfiles, `[email protected]`, which declares `tar: ^7.5.7`. The description skips that check and argues that node-gyp never runs.
   
   That argument does not hold. Yarn injects `node-gyp@npm:latest` into `[email protected]`, `@tree-sitter-grammars/[email protected]`, `[email protected]` and others. Only `[email protected]` and `tree-sitter-json` have `built: false`. The other packages install through `node-gyp-build`, and its [install script falls back](https://github.com/prebuild/node-gyp-build/blob/master/bin.js) to `node-gyp rebuild` when no matching prebuild exists. The record already notes that linux arm64 is missing working prebuilds for some tree-sitter packages.
   
   The import check fails. node-gyp's [install.js](https://github.com/nodejs/node-gyp/blob/v13.1.0/lib/install.js) downloads headers by using `tar.extract({strip, filter, cwd})` as the destination of a stream pipeline. [tar v8.0.0](https://github.com/isaacs/node-tar/releases/tag/v8.0.0) removed Node stream support from its commands, and `extract()` now has to be given an `input` option or a file. On any machine where a build falls back to source, the header download breaks, and so does the install.
   
   The bare `tar` key also leaves out the dependent's name. The record's consequences rely on each pin naming its dependent so that removing it later is a lookup.

   Fix (Either supersede the record with a new ADR stating that the pin knowingly breaks node-gyp source builds (and add `dependenciesMeta` `built: false` for every remaining native package so node-gyp truly never runs), or keep tar within node-gyp's major and scope the pin to the dependent so it is removed when node-gyp ships tar 8 support (nodejs/node-gyp#3396). Note: this scoped pin is only valid if a patched 7.x exists; otherwise the ADR supersession is required.):
   "node-gyp/tar": "^8.1.2"

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@karanh37
karanh37 merged commit daed271 into main Dec 4, 2026
35 of 36 checks passed
@karanh37
karanh37 deleted the karanh37/ghsa-4pf9-5fpx-xmr6-vulnerability-fix branch December 4, 2026 11:48
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.1 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown

🤖 Backport to 2.0 opened as #39822. Claude resolved a cherry-pick conflict to build it. It merges itself once the checks pass, so read the diff now if this change is a sensitive one.

@gh-bot-collate

gh-bot-collate Bot commented Dec 4, 2026

Copy link
Copy Markdown

🤖 Backport to 2.1 opened as #39823. Claude resolved a cherry-pick conflict to build it. It merges itself once the checks pass, so read the diff now if this change is a sensitive one.

karanh37 added a commit that referenced this pull request Dec 4, 2026
(cherry picked from commit daed271)

Co-authored-by: Karan Hotchandani <[email protected]>
karanh37 added a commit that referenced this pull request Dec 4, 2026
(cherry picked from commit daed271)

Co-authored-by: Karan Hotchandani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants