← Back to issue list

NodeJS checksum not being verified after downloading via the npm plugin

View original Github issue

Metadata

Project
craft-parts
Number
#717
Type
issue
State
closed
Author
alnvdl-work
Labels
—
Created
Updated
Closed

Current evaluation

Node.js downloads now verify SHA256 checksums via SHASUMS256.txt; the NPM plugin refactor in canonical/craft-parts#719 merged as commit 96b33035.

Resolution: closed resolved

Reason: The override-build concern was resolved using craftctl default. The remaining checksum concern was fixed by merged PR #719, which downloads SHASUMS256.txt and verifies the Node.js archive with sha256sum.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description **Problem 1** (solved; see below) The `npm` plugin installs NodeJS during the build step: https://github.com/canonical/craft-parts/blob/2b16c15d81e9ed6ffef6a3d1074b6482953cd38c/craft_parts/plugins/npm_plugin.py#L179-L197 When building a ROCK, if we use `override-build` to customize the invocation of `npm install` as needed by our application, we don't get NodeJS installed. So we have to either download and install NodeJS ourselves, or resort to hacks like building the application during the stage step. For building this ROCK, we found a nice workaround using `overlay-script`, which is good enough for us for now to install NodeJS independently: > The overlay step provides the means to modify the base filesystem before the build step is applied See: https://canonical-rockcraft.readthedocs-hosted.com/en/latest/explanation/overlay-step/ --- **Problem 2** Somewhat related to this: the download of NodeJS should also ideally have its checksum verified to mitigate the impacts of any supply-chain-attacks and eliminate the problem of corrupted downloads, maybe doing something similar to what Docker does: https://github.com/nodejs/docker-node/blob/1fc16c3d1ea2be71fba69115f59d0e8f99876692/18/buster/Dockerfile ### To Reproduce Try to try to build any application whose `npm install` process needs to be customized to be different from the default dictated by the part. ### part yaml _No response_ ### Relevant log output ```shell - ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Node.js downloads now verify SHA256 checksums via SHASUMS256.txt; the NPM plugin refactor in canonical/craft-parts#719 merged as commit 96b33035.
stealth/space-bunny-alpha — closed resolved Node.js downloads now verify SHA-256 checksums during the pull phase; merged in craft-parts#719 (96b33035). The override-build concern was separately solved with craftctl default.
stealth/space-bunny-alpha — closed resolved Node.js downloads now have their SHA256 checksums verified during the pull phase. The NPM plugin refactor merged in PR #719 as commit 96b33035, fixing the issue.
qwen/qwen3.6-35b-a3b — — Checksum verification for NodeJS downloads was added to the npm plugin, resolving the security concern. The initial installation issue was resolved by the author using craftctl default. The fix was merged in PR #719.
qwen/qwen3.6-35b-a3b — — NodeJS checksum verification in the npm plugin was fixed by PR #719. The author resolved an initial build override workaround using craftctl default, but the unverified download security concern was addressed and the issue closed.
qwen/qwen3.6-35b-a3b — — Missing checksum verification for NodeJS downloads via the npm plugin was resolved. After an initial workaround for a related build step, the security enhancement was implemented and closed by PR #719.
qwen3.6-35b-a3b-mtp-q6 — — The npm plugin's NodeJS download lacked checksum verification. Following a workaround for the build override issue, the checksum validation gap was fixed and merged in PR #719.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-parts#719 (confidence 100%)

    Merged NPM plugin refactor commit 96b33035 added SHA256 verification for Node.js downloads and resolved #717.

Related issues

Issue Project State Summary Similarity
#719 feat(plugin): Refactor NPM plugin craft-parts merged Merged in canonical/craft-parts#719 as 96b33035, refactoring the NPM plugin and fixing #717 by verifying Node.js SHA256 checksums after pull-phase downloads.
74%