Skip to content

fix(devcontainer-setup): pin fnm instead of installing its latest release - #346

Merged
kz-tob merged 7 commits into
trailofbits:mainfrom
sushant-me:fix/devcontainer-pin-unpinned-installs
Oct 15, 2026
Merged

kz-tob merged 7 commits into
trailofbits:mainfrom
sushant-me:fix/devcontainer-pin-unpinned-installs

Conversation

@sushant-me

Copy link
Copy Markdown
Contributor

Fixes one half of #330.

What changed

The generated Dockerfile pins and version-checks most of what it fetches — GIT_DELTA_VERSION, FZF_VERSION, ZSH_IN_DOCKER_VERSION — but fnm's installer defaults to RELEASE="latest", so every devcontainer built from this template took whatever the newest fnm release happened to be at build time.

The installer accepts --release, so this pins it the same way as the rest of the file:

ARG FNM_VERSION=1.39.0
ENV FNM_DIR="/home/vscode/.fnm"
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "$FNM_DIR" --skip-shell --release "v${FNM_VERSION}" && \

I confirmed the flag exists by reading the installer rather than assuming it — it parses -r | --release alongside --install-dir and --skip-shell.

What I did not change, and why

claude.ai/install.sh is still unpinned. I tried to establish whether it accepts a version pin and could not: fetching it returned zero bytes from this machine, so I have no evidence either way about its flags. I am not going to invent one. It needs someone who can read that script, or a documented pin from Anthropic.

The claude-yolo alias is untouched. Whether to document it or drop it is a judgement call about an implicit endorsement, which is the maintainer's to make, not a supply-chain fix.

So this is a partial fix and I would rather say so than let the PR look like it closes the issue. If you would prefer it to wait until both installs can be pinned in one change, say so and I will close it.

Verification

Built the image, which is the only thing that proves the pin takes effect:

#17 RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- ... --release "v1.39.0" ...
#17 0.686 Downloading https://github.com/Schniz/fnm/releases/download/v1.39.0/fnm-linux.zip...
#17 DONE 10.0s
#22 DONE 14.2s          -> exit 0

The URL shows download/v1.39.0/, so the release is pinned rather than resolved to latest, and the rest of the build (Node 22 install, zsh-in-docker, plugins) is unaffected.

docker build --build-arg TZ=UTC against the resources directory, with docker 29.7.2.

Diff is one file, +4/-1.

…ease

Fixes one half of trailofbits#330.

The generated Dockerfile pins and version-checks most of what it fetches
(GIT_DELTA_VERSION, FZF_VERSION, ZSH_IN_DOCKER_VERSION), but fnm's installer
defaults to RELEASE="latest", so every devcontainer built from the template
took whatever the newest release was at build time.

The installer accepts --release, so this pins it the same way as the rest of
the file, via an FNM_VERSION arg.

The other unpinned install, claude.ai/install.sh, is left alone deliberately:
I could not retrieve that script to establish whether it supports a version
pin, and I am not going to guess at a flag. Recording that in the PR instead
of changing it.

Verified by building the image: the run downloads
github.com/Schniz/fnm/releases/download/v1.39.0/fnm-linux.zip, so the pin takes
effect, and the build completes.

@claude claude Bot 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

DarkaMaul
DarkaMaul previously approved these changes Oct 4, 2026

@DarkaMaul DarkaMaul 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

@sushant-me

Copy link
Copy Markdown
Contributor Author

Flagging a mechanical blocker rather than a code one, since the diff itself is settled and the review is in.

Three required checks on this PR are parked in action_required:

  • Validate plugins and skills (validate.yml)
  • Lint (lint.yml)
  • Claude Review (claude-review.yml)

action_required is GitHub holding the workflow runs for a maintainer to approve, which is the normal gate for a fork PR. That is why this shows as approved yet blocked: the check-suites exist on the head commit (246a3d1f) with conclusion=action_required and zero runs, so they never report a status that branch protection can accept.

If someone with write access can hit Approve and run under the checks, those should complete and the merge gate should clear without any change to the branch. Not asking for a re-review — just making sure this is not sitting behind something only I can see, because from the outside it looks like the checks are simply missing.

(For what it is worth, the same three suites are awaiting approval on #311, #347, #348, #349 and #350 as well, so this may be a single fix across all six.)

@kz-tob

kz-tob commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

@claude review

@claude claude Bot 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, straightforward config change.

What was reviewed: the Dockerfile diff adding ARG FNM_VERSION=1.39.0 and passing --release "v${FNM_VERSION}" to the fnm installer. Confirmed this matches the existing versioned-install pattern already used for NODE_VERSION, GIT_DELTA_VERSION, etc. in the same file, and that the change is a minimal, self-contained pin with no other logic altered.

Extended reasoning...

Single-file, 4-line addition to a devcontainer resource Dockerfile that pins the fnm installer to a specific release instead of implicitly using "latest", consistent with sibling ARGs in the same file. No security-sensitive surface (no secrets, auth, or injection risk) and no CODEOWNERS or version-bump requirements apply to a resource Dockerfile change. The PR already has an independent approval and no unresolved CHANGES_REQUESTED or objections are evident in the timeline.

@kz-tob

kz-tob commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Just need the version bump, and we should be good to go

The validate job requires the plugin version to increase whenever a plugin file
changes, so clients pull the update. Version was 0.2.4 at the merge base.
@kz-tob

kz-tob commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Can you sync the marketplace version with plugin.json and update from main?

52eff21 bumped plugin.json to 0.2.5 but left the marketplace entry at 0.2.4, so
the two manifests disagreed. The validator requires them to match and the
client resolves the plugin through the marketplace entry.
@sushant-me

Copy link
Copy Markdown
Contributor Author

Done — ca35030, plus a refresh from main so the branch is no longer behind.

You were right that the two manifests disagreed, and the way it happened is worth recording: 52eff21 bumped plugin.json to 0.2.5 and left the marketplace entry at 0.2.4. That is the failure mode your check exists for — the plugin's own manifest advertised the new version while the marketplace, which is what a client actually resolves the plugin through, still advertised the old one, so the fix would not have reached anyone.

Both are now 0.2.5. make validate reports no errors.

I also checked the other four branches in this series for the same split rather than assuming they were fine, since they share the pattern. fix/gh-cli-dedupe-env-append, fix/gh-cli-heredoc-false-positive and fix/fpcheck-stop-hook-scope were in sync and are being bumped to 1.6.3 / 1.6.3 / 1.0.6 respectively. I found one more genuine mismatch while doing it, on a different PR — feat/vector-j-unbounded-tool-targets has plugin.json at 1.4.0 and the marketplace at 1.3.2 — and I am fixing that one too.

@kz-tob
kz-tob merged commit 5c99c03 into trailofbits:main Oct 15, 2026
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