You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(security): migrate bundled npm to tar 8 - #366
Replace the bundled npm tar 7.5.22 package with the official tar 8.1.2 archive, verified against the npm registry SHA-512 integrity value.
Apply a strict, version-specific patch to npm 11.21.3's archive call sites and dependency declarations. Pacote still reads through the complete input for integrity and cache handling, and node-gyp hashes the complete download before extracting it. The CLI continues to use the Node.js 24.23.0 bundle.
Exercise offline npm pack, npm install, npm diff, executable package bins, npm ls, and local node-gyp header extraction in the Docker workflow. Keep the existing tool and alias checks.
Validation
Applied the patch with zero fuzz to the npm files extracted from the official Node.js 24.23.0 archive. The hosted smoke script passed against that patched npm bundle on local Node.js 24.
Independently compared stock and patched npm diff output for ordinary local packages. Verified staged package download and node-gyp's complete-download checksum path with a loopback fixture server.
Workflow lint, shell syntax, and whitespace checks passed.
The hosted Docker build and archive smoke tests passed on 3af2220. GitHub Actions run
No actionable comments were generated in the recent review.
Walkthrough
The Docker build patches npm 11.21.3 to use tar 8.1.2. The patch updates npm archive operations, and an offline smoke test checks package packing, installation, diff output, and node-gyp header extraction.
Changes: npm tar compatibility
Layer / File(s)
Summary
Adapt archive clients to tar 8.1.2 patches/npm-11.21.3-tar-8.patch
Manifest reads, tarball inspection, diffs, node-gyp header extraction, and pacote archive creation and extraction now use tar 8.1.2 interfaces. Affected packages pin tar to version 8.1.2.
Install patched npm in the Docker image .dockerignore, Dockerfile
The build includes the npm patch, checks npm and tar versions, verifies the tar archive checksum, applies the patch, and replaces npm’s bundled tar package.
Validate and document patched npm .github/scripts/npm-archive-smoke.sh, .github/workflows/docker.yml, README.md
The offline smoke test checks package archive operations and node-gyp header extraction. The Docker workflow runs it without networking, and the README documents the patch and test command.
sequenceDiagram
participant Smoke as npm-archive-smoke.sh
participant npm
participant tar as tar 8.1.2
participant Consumer
participant node-gyp
Smoke->>npm: Pack local package offline
npm->>tar: Create package archive
Smoke->>npm: Install archive offline
npm->>Consumer: Install package
Smoke->>npm: Diff original and modified archives
npm->>tar: Read archive entries
Smoke->>node-gyp: Install local headers archive
node-gyp->>tar: Extract headers
Loading
Possibly related PRs
beevelop/docker-android-nodejs#360: PR #360 sets the Node.js base to 24.23.0 with bundled npm 11.21.3, the npm version targeted by this patch.
Merge Risk: Minimal · up to 3af22
This change patches the Docker image's bundled npm to use tar 8.1.2 and adds an offline archive smoke test. No concrete defect was found, and the Docker build fails loudly if the npm or tar version checks, checksum, or patch application fail. It is ready to merge, subject to the CI image build and smoke test passing.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(security): migrate bundled npm to tar 8" states the main change. The changeset replaces npm 11.21.3's bundled tar 7.5.22 with tar 8.1.2 through a version-specific patch, Dockerfile chan…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "fix(security): migrate bundled npm to tar 8" states the main change. The changeset replaces npm 11.21.3's bundled tar 7.5.22 with tar 8.1.2 through a version-specific patch, Dockerfile changes, and dependency pins. The title is concise, uses a conventional-commit style, and matches the PR objectives. It does not cover the smoke-test additions, but that is expected.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: e5b640bf-e0f9-4e73-aabb-e4ee260d9d14
Commits
Reviewing files that changed from the base of the PR and between 2c799bf and 3af2220.
Files selected for processing: 6
.dockerignore
.github/scripts/npm-archive-smoke.sh
.github/workflows/docker.yml
Dockerfile
README.md
patches/npm-11.21.3-tar-8.patch
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Summary
npm pack,npm install,npm diff, executable package bins,npm ls, and local node-gyp header extraction in the Docker workflow. Keep the existing tool and alias checks.Validation
npm diffoutput for ordinary local packages. Verified staged package download and node-gyp's complete-download checksum path with a loopback fixture server.3af2220. GitHub Actions runThe patch is specific to npm 11.21.3 and can be removed once the upstream bundle uses tar 8. Tar 8 migration guide · Pacote migration · Bundled tar advisory
Summary by CodeRabbit