Supply chain: install, launcher, seed fetch and release workflows

The security audit's record for the distribution stage (issue #363). It says what was checked, how, what was found, and which test pins each answer. Base is main at 0d362c5; every file:line in the findings table refers to that commit.

Scope

File What was read
install.sh the whole script: nish_asset, nish_write_wrapper, nish_abspath, nish_version_of, the argument loop, --uninstall, the latest-version redirect, the download, the unpack, the version check, the swap and restore_backup
bin/nish, bin/launcher.js, bin/packaging.js nativeCompiler, handOver, refuse, assetFor, targetForAsset, platformPackageName, noCompilerMessage
scripts/postinstall.mjs swap, shellQuote, the shim it writes, skills and what it writes (nothing under .claude/)
scripts/link-skills.mjs, bin/nish-skills.js findSkills, readSkill, frontmatter, packageJson, readRecord, review, grantLines, linkSkills, clean, the argument parser and when it asks
scripts/platform-package.mjs the manifest it writes
scripts/fetch-seed.sh the short-circuit and the call into install.sh
.github/seed-matrix.sh the fields each seed row carries, and which of them a workflow reads
scripts/verify-binaries.sh, scripts/bootstrap.sh, scripts/build.sh, scripts/nish-compiler.sh every download, temp file, rm -rf and exec
.github/workflows/ ci.yml, release.yml, release-pr.yml, pr-title.yml, ct-timing.yml, rebuild.yml, fuzz.yml, soundness-fuzz.yml, interop.yml: triggers, permissions:, every uses:, every run: script, every secrets. and github.token, every npm ci and node-version:
.github/actions/apt-install/action.yml what the cache restores, what apt checks before it installs, and who can write the entries it reads
.github/CODEOWNERS, scripts/check-install-scripts.mjs, .claude/hooks/session-start.sh the paths an owner reviews; which lockfile entries may run code at install time; what the cloud development container's start-up hook installs and runs
scripts/sbom.mjs what it reads (the release's files, THIRD_PARTY_NOTICES.md, each tarball's toolchain record) and what it refuses
scripts/rebuild-compare.sh, scripts/ddc-chain.sh what each compares or builds, every temp file, worktree and rm -rf, and what decides the exit status
.github/seed-targets.json what reads it and what it can steer
runtime/nish.mjs, runtime/shim.mjs the globals installed, the nish/ resolve hook, spawnImpl, getRandomValues, every object used as a map
web/wasi.mjs, web/worker.mjs, web/compile.mjs, web/bytes-worker.mjs every WASI import, how guest pointers become host memory, MemoryFileSystem, the worker protocol

Threat model

What an attacker controls, by channel:

  • The network and the release. Downloads go over HTTPS to github.com, so a network attacker alone is out of scope. Release assets are not: a GitHub release is mutable (every release of this repository reported immutable: false when this stage ran), so anyone who holds write access, or a token with it, can delete an asset and upload another under the same name. The question is whether that replacement then runs on a user's machine or in CI. Since SC-16: v0.16.0 and later are immutable, and releases after 0.21.0 carry a build provenance attestation.
  • Pull request text and forks. Anyone can open a pull request from a fork with any title, body and branch name. The question is whether any of that reaches a shell, a secret or a write token.
  • The npm registry. Packages are installed by npm against the lockfile's integrity hashes. The question is what an install executes.
  • A program run under the JS hosts. The program itself is trusted (it is the user's own code); its inputs are not. For web/wasi.mjs the guest is a compiled module, and the host must not answer a call with less than it promises.

Severity follows the plan, with this stage's reading: code execution on a user's machine or in CI through a tampered download or a workflow injection is Critical; a secret or write token reachable from a fork is High; denial of service is Medium; hardening and drift are Low.

Method

  • Read. Every file in the scope, line by line, with the questions the plan names: any curl | sh, any download that is run without a pinned checksum, any ${{ }} inside run:, any pull_request_target or workflow_run, any action pinned by tag, any job with more permissions than it uses, and in the JS hosts any eval, new Function, shell: true, or object used as a map with keys from outside.
  • Traced every download to what runs it. install.sh (the curl | sh path), scripts/fetch-seed.sh (the session hook, ci.yml's test, runner and ct-timing jobs, release.yml's binaries job, scripts/bootstrap.sh with no seed), and ci.yml's bootstrap and nish-cmp jobs, which downloaded with gh release download on their own.
  • Measured the release assets. The GitHub API's digest for every nish-<version>-<asset>.tar.gz from 0.1.1 to 0.15.0 (47 files) was read on 2026-10-02, and all 47 were then downloaded and hashed locally: every one matched the digest now pinned in install.sh. No release attaches a checksum file.
  • Ran install.sh against a stand-in release. A curl first on PATH serves fixture files and logs every URL; the fixture compiler records that it ran. That is how every install.sh test below observes whether an unverified binary was executed.
  • Linted the workflows. actionlint 1.7.7 (its tarball checked against its own checksums.txt) over all six files, before and after, with and without its shellcheck integration: no errors either side, and the only shellcheck notes are info-level (SC2016 on deliberate single quotes, SC2153 on variables set in env:). shellcheck -S warning over every script CI lints is clean.
  • Exercised the WASI host directly. WasiHost over a bare ArrayBuffer, with globalThis.crypto removed, with a request longer than one Web Crypto call can fill, and with a range past the end of memory.

Findings

Id Severity Where (at 0d362c5) Finding Disposition
SC-1 Critical install.sh:228, :237, :261 install.sh downloaded the release tarball, unpacked it and ran its bin/nish --version with no checksum at all. A replaced release asset ran on every machine that installed it through curl | sh, and through scripts/fetch-seed.sh in the session hook, in ci.yml's test and runner jobs, in ct-timing, and in release.yml's binaries job, where the seed builds the next release. Fixed. Nothing is unpacked or run before its SHA-256 matches: the 47 tarballs up to 0.15.0 are pinned in install.sh (nish_pinned_sha256), and a later release is checked against the SHA256SUMS it attaches (SC-2). No digest, no install. Tests: install.sh refuses a release with no SHA256SUMS and no pinned digest, without running it, … whose SHA-256 is not the one SHA256SUMS gives …, … SHA256SUMS has no line for …, install.sh holds a pinned release to its pinned digest, over a SHA256SUMS swapped with the tarball, install.sh's 47 pinned digests are well formed and cover every 0.15.0 seed.
SC-2 Critical .github/workflows/release.yml:559 No release published a checksum, so nothing could verify one. Fixed. The release job writes SHA256SUMS over every attached file and attaches it. Test: release.yml computes a SHA256SUMS over the release's files and attaches it.
SC-3 Critical .github/workflows/ci.yml:470, :584 The bootstrap and nish-cmp jobs fetched the seed with gh release download, untarred it and ran it, on every push and pull request, outside the one download path. Fixed. Both take the seed through scripts/fetch-seed.sh, so through SC-1's check. Test: ci.yml takes every seed through scripts/fetch-seed.sh, never a bare download.
SC-4 Medium web/wasi.mjs:497 random_get filled the buffer from Math.random and answered success when the host has no crypto.getRandomValues. This is the call crypto.getRandomValues in a program compiled for --profile wasi reaches, so keys and nonces would have come from a non-cryptographic generator, silently. Unreachable on the hosts this project supports (Node 22, current browsers), which is why it is not High. Fixed. It answers ENOSYS; getentropy then fails and nish_random_fill (runtime/runtime-host.c) exits 1 with its entropy message. Test: wasi random_get with no CSPRNG on the host answers ENOSYS and writes nothing.
SC-5 Low web/wasi.mjs:498 random_get passed the whole request to one getRandomValues call, which throws QuotaExceededError above 65,536 bytes, out of the import and through the guest as a trap. The Nish runtime asks for at most 256 bytes a call (getentropy), so this reached only another guest of the same host. And it took memory with subarray, which clamps: a range past the end filled fewer bytes than asked and still reported success. Fixed. Filled in 64 KiB pieces; a range outside memory is EFAULT. Tests: wasi random_get fills a request longer than 65,536 bytes to its last byte, wasi random_get refuses a range past the end of memory with EFAULT, writing nothing.
SC-6 Low install.sh:284 with the trap at :224 Installing into a directory that exists and is not an install (--dir ~/projects) moved it aside as the "backup", and the exit trap deleted it once the install succeeded. Fixed. A non-empty directory without a bin/nish is refused before anything is downloaded. Test: install.sh refuses to install over a non-empty directory that is not an install, and leaves it whole.
SC-7 Low install.sh:170 --uninstall ran rm -rf on whatever --dir or NISH_INSTALL named. Fixed. It refuses a directory with no bin/nish. Test: install.sh --uninstall refuses a directory with no bin/nish in it, and leaves it whole.
SC-8 Low install.sh:109 The wrapper spliced the install path between single quotes unescaped, so a ' in it ended the string and the rest ran as shell. scripts/postinstall.mjs already quoted the same thing correctly. Fixed with nish_shell_quote. Test: install.sh's wrapper execs a path with quotes, $() and backticks in it as that path, running none of it.
SC-9 Low install.sh:199 The version, from the command line, NISH_VERSION or the latest-release redirect, was put into the URL unchecked; the redirect's answer when there is no tag to land on is a whole URL. Fixed. nish_valid_version refuses anything but a dotted version before a request is made. Test: install.sh refuses a version that is not one, before it requests anything.
SC-10 Low scripts/fetch-seed.sh:51 The version went to install.sh unquoted, so fetch-seed.sh "0.4.0 --dir /elsewhere" became extra options. Fixed. Test: a version is passed to the installer as one word, never split into options.
SC-11 Low release.yml:310, :311, :313, :346, :347, :560, :824; release-pr.yml:81, :92, :196, :234; ci.yml:281; ct-timing.yml:97 Expressions spliced into run: scripts. None carries pull request text: they are step outputs derived from a tag that the targets job has already matched against package.json, the version on main, a static matrix and the github context. But each is one edit away from carrying something that is, and the rule pr-title.yml and pr-body.yml state is the safe one. Fixed. Every one goes through env:. Test: no workflow splices a ${{ }} expression into a run: script (6 files).
SC-12 Low every uses: in .github/workflows/ Every action was pinned by a movable tag (@v4). All four are GitHub's own (actions/checkout, setup-node, upload-artifact, download-artifact), so this is hardening rather than a third-party risk. Fixed. Each is pinned to the commit its v4 tag named on 2026-10-02, the tag kept in a comment. Test: every action a workflow uses is pinned to a full commit SHA.
SC-13 Low release.yml:419 The release job holds contents: write, and its checkout left the token in .git/config while npm ci ran install scripts. Every dependency is pinned by integrity and only the root has an install script, so this is hardening. Fixed. persist-credentials: false; the job never pushes with git. Test: release.yml's release job checks out without persisting its write token.
SC-14 Low release.yml:601 The npm job, which holds id-token: write, installed npm@^11.5.1: whatever 11.x the registry served on release day, able to mint a publish credential. Fixed. First pinned to npm@11.21.0; since SC-30 the job downloads no npm at all and publishes with the npm that the pinned Node release ships (Node 26.13.1, npm 11.20.0), which a step checks is at least 11.5.1, the first with trusted publishing. Test: release.yml's npm job publishes in the npm environment with the npm its pinned Node ships.
SC-15 Low web/wasi.mjs:116, web/compile.mjs:37 Plain objects used as maps: a file named __proto__ was dropped from toText(), and a module named constructor looked already collected. No pollution (the assignment only touches the object's own prototype), but a silent loss. Fixed with Object.create(null). Test: wasi MemoryFileSystem.toText returns a file named __proto__ as a key, not a prototype.
SC-18 Low release.yml:604-609, :679-683 The npm job downloaded the packages back from the release and published them with --provenance under id-token: write, checking nothing. A package replaced on the release between the two jobs would have been published with a valid provenance statement. Fixed. The release job hands its SHA256SUMS to the npm job as a job output, which no edit to the release reaches, and every package is checked against it before the first publish. Test: release.yml's npm job checks every package against the release job's SHA256SUMS before publishing.
SC-19 Medium ci.yml bootstrap and nish-cmp, "Download the seed" (as SC-3 left them) Once the seed came through scripts/fetch-seed.sh, install.sh chose the asset from the runner's own uname, and nothing compared it with the row's matrix.seed.asset. The bare download SC-3 replaced fetched the row's named tarball, so a runner that had drifted to other hardware failed on an exec format error; after SC-3 it would silently bootstrap with another platform's seed and go green under the old row's name. macos-13 and macos-latest have both drifted this way. Fixed. install.sh --expect-tarball <name> refuses unless the tarball it resolves from nish_asset is <name>: before requesting anything when the version was given, or when anything but the version differs or the version part is not dotted integers (SC-26), and otherwise after the one latest-release lookup and before anything is downloaded (SC-22); fetch-seed.sh passes the option through, and both rows pass matrix.seed.tarball. This is the CI counterpart of release.yml's uname-against-host check in binaries. Tests: install.sh --expect-tarball refuses when this machine resolves another asset, before requesting anything, install.sh --expect-tarball installs the tarball this machine resolves when it is the one expected, --expect-tarball is passed to the installer as one option and its one value, --expect-tarball with no version still asks the installer, over a seed that runs, ci.yml's bootstrap and nish-cmp rows refuse a seed that is not their matrix.seed.tarball.
SC-20 Low .github/seed-matrix.sh:136 seed-matrix.sh still gave every row a tarball, but after SC-3 no workflow read it. Fixed. SC-19's guard reads it, so the field is the name each row holds its seed to. The field stays because tests/run.js's seed-matrix checks pin it.
SC-21 Low install.sh:357, scripts/fetch-seed.sh:61 (at 35af0ab) --expect-tarball "" failed open. install.sh's guard tested -n, so an explicitly empty name parsed and skipped the platform check; fetch-seed.sh accepted the empty value and dropped it through ${expect:+…}. No caller produced one. Fixed. Both parsers refuse a missing or empty value with --expect-tarball needs a file name, before anything else runs. Tests: install.sh refuses ["--expect-tarball",""] before requesting anything, install.sh refuses ["--expect-tarball"] …, fetch-seed refuses ["--expect-tarball",""] without calling the installer, fetch-seed refuses ["--expect-tarball"] ….
SC-22 Low install.sh:338-342, :354-355; this file's SC-19 (at 35af0ab) With no version, install.sh asked GitHub for the latest tag before the guard, while the comment and SC-19 said the refusal came before any request. Fixed. Everything in the expected name but the version is compared before the lookup, so a drifted runner is refused with nothing requested; the whole name is compared once the version is known, which is before any request when it was given and before any download when it was looked up. The comment and SC-19 now say exactly that. (SC-25 made the first comparison exact; SC-26 holds its version part to dotted integers, ^[0-9]+(\.[0-9]+)*$.) Tests: install.sh --expect-tarball with no version refuses another asset before the latest-release lookup, … refuses another version after the lookup, downloading nothing, … installs the latest when it is the tarball expected.
SC-23 Low tests/fetch-seed.js:246-254 (at 35af0ab) The only --expect-tarball-without-a-version test ran against the stand-in installer, so nothing pinned the real install.sh's ordering. Fixed. SC-22's three tests drive the real install.sh in the sandbox whose curl logs every request.
SC-24 Low .github/workflows/release-pr.yml:196 (at 35af0ab) The env key next, introduced by SC-11, was the one lower-case key among those this stage introduced, spelt like the script's own locals. Fixed. Renamed NEXT, with its uses in that step. Test: every env: key a workflow sets is upper case (6 files).
SC-25 Low install.sh:343-347, docs/security/supply-chain.md SC-22, tests/fetch-seed.js:485-515 (at 681efeb) SC-22's early check was a suffix glob, nish-*-"$asset".tar.gz, and * matches - and /. With no version, nish-9.9.9-aarch64-darwin-x86_64-linux.tar.gz on an x86_64 Linux host, nish-9.9/9-<asset>.tar.gz and nish--<asset>.tar.gz all passed it, so the latest-release lookup ran before the exact check refused them, and SC-22's "refused with nothing requested" was not true of them. No caller produced one. Fixed. nish_expect_version takes the name apart: it must start nish- and end -<asset>.tar.gz, and what is between them must pass nish_valid_version and name no platform (x86_64, aarch64, linux, darwin), since that rule allows - for a pre-release. Anything else is refused before any request. (SC-26 replaced the platform deny-list, which was lower-case only, with a dotted-integer allow-list.) Tests: install.sh --expect-tarball with no version refuses <name> before the latest-release lookup, one each for an extra platform segment, a / in the version, an empty version, a .. in the version, a missing nish- prefix and a version of latest.
SC-26 Low install.sh:349-357 (nish_expect_version), tests/fetch-seed.js:516-540 (at 4357b92) SC-25's version check was nish_valid_version, which accepts [0-9A-Za-z.+-], plus a deny-list of the lower-case words x86_64, aarch64, linux and darwin. Any other spelling passed: with no version, nish-9.9.9-AARCH64-DARWIN-x86_64-linux.tar.gz and nish-9.9.9-Linux-x86_64-linux.tar.gz on an x86_64 Linux host got past the early check, so the latest-release lookup ran before the exact compare refused them. No caller produced one. This was the second patch to the same check, so the deny-list was the wrong shape. Fixed. The version between nish- and -<asset>.tar.gz is now held to an allow-list: dotted integers, ^[0-9]+(\.[0-9]+)*$ -- one or more components, each one or more digits, no empty component, no letters, - or +. That is the scheme .github/seed-due.sh enforces for every release and the only one seed-matrix.sh can emit, so no row a workflow produces is refused. It is a POSIX case ("" | .* | *. | *..* | *[!0-9.]* refuses). nish_valid_version is unchanged: it still checks the positional version and NISH_VERSION, which the exact compare then holds to the expected name. Tests: install.sh --expect-tarball with no version refuses <name> before the latest-release lookup, one each for an upper-case extra platform segment, a capitalised platform word, a pre-release version, an empty, leading-empty and trailing-empty component and a build-metadata version; … lets nish-<version>-<asset>.tar.gz past the early check to the lookup for 9.9.9, 10.0.2.1 and 7.
SC-16 Low GitHub repository setting; release.yml release Releases are mutable. For a release after 0.15.0 the check is the release's own SHA256SUMS, which catches corruption and an asset replaced alone, but not a tarball and its SHA256SUMS replaced together. Fixed, in two steps. Immutable releases are on, from v0.16.0: the v0.16.0 release reports immutable: true (GET /repos/amritk/nish/releases/tags/v0.16.0), so its assets and SHA256SUMS cannot be replaced once published; releases up to 0.15.0 stay mutable, and install.sh pins their digests. Every release after 0.21.0 carries a signed build provenance attestation (#389): the release job runs actions/attest-build-provenance over SHA256SUMS, so one statement covers every file it lists, between writing it and gh release create. Only that job holds id-token: write and attestations: write (npm keeps its own id-token: write for the registry); the top level grants neither. install.sh, and so scripts/fetch-seed.sh, runs gh attestation verify <tarball> --repo amritk/nish --signer-workflow amritk/nish/.github/workflows/release.yml --source-ref refs/tags/v<version> --deny-self-hosted-runners before unpacking a release after 0.21.0 (0.21.0 was tagged before the attestation step landed in #898 and carries none; an earlier threshold of 0.20.0 refused it, which failed the v0.22.0 release in every binaries row, seeded by 0.21.0), refuses when it fails, and says it skipped the check when gh is missing, signed out or lacks one of those options; the check is in addition to SHA-256, never instead of it. docs/INSTALL.md and the user guide give the command. Tests: release.yml grants attestations: write and id-token: write at the job level only, to release (and id-token to npm), release.yml attests the build provenance of every file in SHA256SUMS before it creates the release, install.sh checks a release's attestation with gh, pinned to release.yml at its tag, and installs it, install.sh refuses a release whose attestation gh rejects, without running it, install.sh skips the attestation with a note when gh is <signed-out, old>, and installs on the SHA-256, install.sh asks for no attestation from 0.21.0, which predates them.
SC-17 Low install.sh:4 curl … | sh runs install.sh itself unverified. It comes over HTTPS from raw.githubusercontent.com at main, which is the repository's own branch protection, and there is nothing in front of it to check it with. Accepted, and the reason recorded. sh install.sh from a checkout, or from a downloaded copy read first, is the alternative, and install.sh --help already documents running it that way.
SC-27 Low release.yml release A release said what it was made of only in prose: the npm package's dependencies in its lockfile, the LLVM that linked each compiler nowhere, and the code it vendors in THIRD_PARTY_NOTICES.md. A user checking whether a release is affected by a flaw in one of those had nothing machine-readable to check. Fixed. Each release attaches nish-<version>.spdx.json, an SPDX 2.3 document written by scripts/sbom.mjs: every attached file with its SHA-256, the vendored code parsed from THIRD_PARTY_NOTICES.md with the upstream version or commit it records, and, per compiler, the toolchain its binaries row recorded (runner image, clang and so LLVM, linker, Node, seed) as BUILD_TOOL_OF. It is listed in SHA256SUMS, so the attestation covers it. Tests: sbom.mjs refuses a tarball with no record of the toolchain that built it, sbom.mjs describes the release: each file with its own SHA-256, each shipped vendored component, and the toolchain that built each tarball, release.yml writes the SBOM before SHA256SUMS and lists it there, and every binaries row records its toolchain.
SC-28 Medium .github/workflows/rebuild.yml (new) Nothing checked that a published compiler is what its tag builds. The attestation (SC-16) says which run built it, not that the run built it from nothing but the tag, and bootstrap.sh --verify checks only that stage2 and stage3 of one run agree. Fixed for the Linux rows, reported for the macOS rows. rebuild.yml rebuilds the latest release every Monday from its tag, on a clean runner of each row's label, seeded by the release before it, and scripts/rebuild-compare.sh compares the result with the attached tarball (checked against the release's SHA256SUMS first): every published file but the compiler must be byte-identical to its source at the tag, and the compiler must pass scripts/verify-binaries.sh once both copies lose the ELF .comment section. That section holds the linker's and the C runtime's version strings, which come from the runner image's GCC: a rebuild of v0.20.0 on 2026-10-24 matched the published x86_64-linux tarball in all 82 tree files and in every byte of the compiler but five, all in .comment. The whole-byte comparison is reported beside the gate. A macOS row reports and does not fail, because Homebrew's llvm@18 can move a patch release between the release and the rebuild; making it gate would mean pinning that formula. Tests: rebuild-compare.sh passes an identical rebuild, … passes a compiler that differs only in .comment, … fails a compiler that differs in code, … fails a published file the tag has no source for, … --report-only reports a difference and exits 0, rebuild.yml reads only, gates Linux and reports macOS.
SC-29 Medium .github/workflows/rebuild.yml ddc (new) Diverse double-compiling ended with stage0 (wp19 G6): since 0.7.0 every release is built only by the release before it, so a compiler that hid something in its own output could pass it down the line with no trace in any source file, and SC-28's rebuild, seeded by the previous release, would inherit it. Fixed. scripts/ddc-chain.sh builds the line again from the ddc-0.6.0 tag, whose compiler TypeScript builds: npm ci --ignore-scripts, tsc, the tag's own tests/self/bootstrap.js (G6's check), then every release tag after it, each seeded by the compiler the step before produced. rebuild.yml's ddc job runs it on the ninth of each month, and on a dispatch that asks for it, and holds the end of the chain to the latest release's x86_64-linux tarball with rebuild-compare.sh. On 2026-10-24 the chain from ddc-0.6.0 to v0.20.0 (fifteen builds, about twenty minutes) matched the published compiler with .comment removed. What it does not reach: the root's trust is Node's, tsc's (pinned by the tag's lockfile) and LLVM's, so a trick living in all of those and in the published line would pass; it runs on x86_64 Linux only; and its runner's GCC differs from the release's in .comment, which is why that section is removed here too. Test: rebuild.yml runs ddc-chain.sh monthly and on request, and compares through rebuild-compare.sh.
SC-30 Low release.yml release (npm ci); every npm ci in ci.yml, fuzz.yml, ct-timing.yml, soundness-fuzz.yml; .claude/hooks/session-start.sh Every install ran dependencies' lifecycle scripts, including in the release job, which holds contents: write, id-token: write and attestations: write, where nothing needed node_modules at all: sbom.mjs, changelog-gen.mjs and the packaging scripts import only node: modules and bin/packaging.js. The lockfile pins every package by integrity and only the root has an install script, so a malicious script would need a lockfile change to arrive, which is why this is Low; but a worm that publishes a poisoned patch release (the 2025 npm account takeovers) arrives through exactly such a change. Fixed. The release job installs nothing. Every npm ci in a workflow, and the session hook's, passes --ignore-scripts, and the root's own postinstall does nothing in a checkout. scripts/check-install-scripts.mjs, run by npm run lint, fails when any lockfile entry but the root has hasInstallScript, so a dependency that gains one is a red lint job in the pull request that brings it. Tests: every \npm ci` a workflow runs passes --ignore-scripts, release.yml installs no npm package in any job, and restores no npm or apt cache another run saved, every other workflow pins one exact Node release (26.13.1), rebuild.yml's ddc job alone pins an older Node, exactly (22.23.4)`; the lint step itself.
SC-31 Low release.yml npm; repository settings npm trusted publishing named only the repository and release.yml, so any job in that file that a future edit gave id-token: write could publish, and nothing asked a second person to look at an edit to a workflow, the installer or the lockfile. Fixed in the repository, with two steps left to its settings. The npm job runs in the npm environment, the only job that names one, so the trust can be bound with npm trust github <package> --repo amritk/nish --file release.yml --environment npm, and the environment can require a reviewer or be held to v* tags. .github/CODEOWNERS names an owner for .github/, .claude/, CLAUDE.md, AGENTS.md, install.sh, bin/, scripts/fetch-seed.sh, scripts/postinstall.mjs, package.json and package-lock.json. Each binds only once the repository's settings say so: the trust re-run with --environment npm for every package, and a ruleset on main that requires code-owner review. Test: release.yml's npm job publishes in the npm environment with the npm its pinned Node ships.
SC-32 Medium every CI step that runs scripts/fetch-seed.sh (ten in ci.yml, one each in fuzz.yml, soundness-fuzz.yml, ct-timing.yml, interop.yml, rebuild.yml) SC-16's attestation check was skipped in CI. No fetch step gave gh a token, and no workflow but rebuild.yml granted attestations: read, so install.sh found gh signed out, printed its note and installed on the SHA-256 alone. The binaries job, which seeds the next release, did check (it set GH_TOKEN), but skipped too if gh was ever unusable. The SHA-256 and immutable releases still held, which is why this is not High. Fixed. NISH_REQUIRE_ATTESTATION=1 makes install.sh refuse, rather than skip, when the check cannot run, and refuse a release too old to carry an attestation. Every CI fetch step sets it with GH_TOKEN, and every workflow that fetches a seed grants attestations: read (in release.yml, on the ci and interop jobs that call the reusable workflows, which can be granted no more than their caller). On a person's machine the check still skips with a note. Tests: install.sh with NISH_REQUIRE_ATTESTATION=1 refuses when gh is <signed-out, old>, without running it, … installs a release whose attestation gh accepts, … refuses 0.21.0, which predates attestations, every workflow step that fetches the seed requires its attestation, with a token that may read it (7 files).
SC-33 Low release.yml binaries; .github/actions/apt-install/action.yml The binaries job, which builds the compilers the release attaches, restored apt's index and .debs, and npm's cache, from the Actions cache. On an exact hit apt installs offline from an index it does not verify again, so the toolchain that linked a release was whatever a run on main had saved. The writer of that scope already runs code in main's CI, so this is hardening. Fixed. apt-install takes cache: "false", which skips both the restore and the save, so apt verifies a fresh index and downloads every package; binaries passes it and no longer sets cache: npm. Test: release.yml installs no npm package in any job, and restores no npm or apt cache another run saved.
SC-34 Low package-lock.json npm audit reported two advisories in development dependencies, neither in anything a release ships: zod 4.6.5 (through knip), whose constrained collections can exhaust memory on oversized input (GHSA-mrhx-c7xc-m3w5, High), and minimatch 10.2.6 (through typedoc), whose brace expansion of a crafted pattern is slow (GHSA-g3hv-75wg-m249, Moderate). Each sees only input this repository writes: knip's own configuration, and the glob patterns scripts/gen-reference.mjs hands typedoc. zod fixed: the lockfile takes 4.6.7. minimatch accepted: every fixed release is 11.x, which removes the matchOne that typedoc 0.28.20, the latest, calls (node scripts/gen-reference.mjs fails with mini.matchOne is not a function under an override), and the patterns it matches are this repository's. It moves when typedoc takes minimatch 11.
SC-35 Medium scripts/postinstall.mjs skills, scripts/link-skills.mjs linkSkills (at aa04eeb) Installing Nish linked every skill of every installed Nish package into .claude/skills/, and npx nish-skills did the same with no question asked. A skill is instructions a coding agent follows, and its frontmatter can grant the agent tools (allowed-tools: Bash), so any package with a nish condition in the dependency tree could hand the project's agent a shell on install. A link also followed every later upgrade, so a skill reviewed once could change under it. Fixed. Postinstall writes nothing under .claude/ and prints one line pointing at npx nish-skills. The command links a skill only once the user accepts it at its current hash, a SHA-256 over every entry of its directory, recorded in .claude/skills/.nish-skills.json: by answering y on a terminal after seeing its description and grant, by naming it, or with --yes, which takes only a skill that grants nothing. The SKILL.md that is parsed is the same bytes that were hashed. Discovery reads with lstat and never follows a link to a skill: a linked skills/, a linked skill directory and a linked SKILL.md are no skill. A link, a special file or an unreadable entry inside a skill directory, or a tree deeper than 32 directories or holding more than 10,000 entries or 64 MiB of files, which the walk stops reading (by design, and not pinned by a test, it reads a directory one entry at a time and checks a file's size before reading it; a test pins that it reads no further than the bound, and a file is opened without blocking and checked to be a regular file again once open, so a FIFO swapped in cannot hang it), is content the hash cannot pin, so it counts as a grant and mixes 32 random bytes into the hash: naming such a skill links it for that run only, and the next run unlinks it. What a skill grants fails closed: frontmatter is read against an allowlist of keys known to be inert, and allowed-tools (even empty), hooks, context, agent, background, any other key, a load-time shell command and a missing, unclosed or unreadable block each count as a grant; the reader takes only what no YAML reader reads differently, and calls anything else unreadable: the opener and closer are --- exactly, and a block holding a lone CR, a vertical tab, a form feed, a NEL, U+2028 or U+2029, a looser --- or a ... marker, indented or not, a line that is not blank and is led by any whitespace but a space (a tab, a no-break space, another Unicode space or a byte-order mark; a blank line of spaces and tabs is skipped), or a key separated from its value by anything but a space or a tab, is unreadable, so a key hidden behind a character a YAML reader breaks a line at or reads as indentation is never inert. A load-time shell command is !` after anything but a letter, digit or _, or a fence of three or more backticks or tildes followed on the same line by blanks (a tab or a no-break space included) and !, wherever it sits on the line, so a fence after a list or quote marker counts. A skill directory whose name is not [a-z0-9][a-z0-9._-]{0,63} is never offered, so no package-chosen name reaches a suggested command. A changed skill, or another package's skill under an accepted name, is unlinked until accepted again, and every other link the linker owns that is not accepted at a skill found now is removed, so a package that stops qualifying stops serving its skill. Every package-controlled string is passed through clean before it reaches the terminal, which replaces every control, format, private-use, unassigned, surrogate and line or paragraph separator code point (Unicode Cc, Cf, Co, Cn, Cs, Zl, Zp), plus the combining grapheme joiner, the Hangul fillers, the Braille blank, the variation selectors (Mongolian ones included) and the Khmer inherent vowels. What a skill grants is shown one grant to a line, those that act (allowed-tools, hooks, a load-time shell command, a link, an unreadable entry) first, and the command that accepts it, npx nish-skills <name>, on a line of its own. No display cap may remove a distinct grant: an allowed-tools list with more than one entry shows its entry and distinct counts and then each distinct tool on a line of its own, tools that run, write or reach out (Bash, PowerShell, Write, Edit, MultiEdit, NotebookEdit, WebFetch, WebSearch, Task, Agent, Skill, KillShell, mcp__…) first, an entry of a block or flow list split on commas and blanks as the inline form is, and the unknown keys come last the same way. Only one tool's or key's own text is cut, at 80 code points; how many are shown never is, so neither padding keys nor a list padded with repeats can push a grant or the command out of what the user reads. Every grant line was checked against this rule: the tools list, an empty allowed-tools, the four named granting keys, an unknown key, a load-time shell command, unreadable frontmatter, an unreadable SKILL.md, a link, a special file, an unreadable entry and a tree too large to read. A package.json or record that is not a regular file is read as none, so a FIFO cannot hang the run, and what sits at the record's temporary name and cannot be removed, a directory, is left alone for a fresh random name; a temporary file the write opened is removed if the write or rename fails. Each question opens the terminal afresh after discarding whatever was typed before it, and closes it once answered, so type-ahead, a second pasted line included, cannot answer a later question. A link still serves a package's new content between npm update and the next npx nish-skills; the guide tells users to run it after upgrading. Tests: the skills section of tests/run.js ("--yes links a skill that grants nothing and none that grants tools, an empty or unreadable grant counting as one", "--yes links no skill with hooks, a shell command run at load (a fence after a list or quote marker, a tab or a no-break space included), or an unknown frontmatter key", "--yes links a skill with no link in it, and none with an inner link, a linked SKILL.md, a linked skill directory or under a linked skills/", "a linked SKILL.md, a linked skill directory and a linked skills/ are no skill: naming one exits 2", "naming a skill with a link inside links it for that run only: the next run, naming nothing, unlinks it", "a skill directory with a shell-unsafe name is never linked, and naming it is an unknown skill", "another package's skill under an accepted name is not linked without consent, and is asked about", "a linked skill whose package drops its nish condition is unlinked on the next run", "a skill whose SKILL.md changed is unlinked without consent, and an unchanged one stays linked", "a package name, version and description holding ESC, BEL, a C1 CSI and invisible characters reach stdout with none of them", "a skill with many long unknown keys before allowed-tools shows allowed-tools before it asks, and the exact command that accepts it", "an allowed-tools list padded with forty Read entries shows its count and Bash, before Read, before it asks", "a skill with thirty long unknown keys shows each of them", "--yes links no skill whose frontmatter holds a NEL, a line separator or a paragraph separator", "--yes links no skill whose frontmatter hides a key behind a CR, a vertical tab, a form feed, a tab, a Unicode space, a mid-block BOM or a loose marker", "--yes still links a skill with CRLF line ends or a space-indented description", "a block or flow allowed-tools entry with two tools shows each, PowerShell, Task, Agent, Skill and KillShell first", "--yes links a skill of 10,000 entries and refuses one of 10,001, naming why", "--yes links a skill of 64 MiB of files and refuses one a byte larger, naming why", "--yes links no skill nested deeper than the walk reads, and names why", "a link naming an accepted skill by its real path is kept, not rewritten", "clean replaces a private-use, unassigned, line-separator, grapheme-joiner, Hangul-filler, variation-selector and Khmer-vowel character, and keeps the rest", "a link planted at the record's temporary name leaves its target untouched, and the record is still written", "a directory at the record's temporary name is left untouched, and the record is still written", "a record write whose rename fails throws and leaves no temporary file", "--yes links nish's own skills/writing-nish, which grants nothing", "--yes links no skill holding a FIFO", "a package whose package.json is a FIFO is no Nish package, and the run finishes", "postinstall in a project's node_modules/nish, beside a Nish library with a skill, exits 0, creates no .claude, and points at nish-skills once").

Properties verified

Property Evidence
No workflow runs a fork's pull request with secrets or a write token: there is no pull_request_target or workflow_run, every file declares permissions:, and the only secret (RELEASE_PR_TOKEN) is read in release-pr.yml and release.yml, which run on pushes to main, v* tags and dispatch only. ci.yml and pr-title.yml run on pull_request with contents: read. Test no workflow runs on pull_request_target or workflow_run, and every one declares its token's permissions; reading every on: and secrets.
Pull request title and body reach a shell only through env:. pr-title.yml (unchanged), and the no-splice test above, which now covers every workflow.
Every job's token is the narrowest it uses: contents: read at the top of ci.yml, pr-*.yml and ct-timing.yml; release.yml's write scope only on release (creates the release); id-token: write only on npm and release, attestations: write only on release, attestations: read wherever a seed is fetched (SC-32); rebuild.yml reads only; issues: write only on ct-timing's report. Reading every permissions: block. release-pr.yml's actions: write is used by gh workflow run release.yml.
The npm channel executes nothing it downloads: npm checks every tarball against the lockfile's integrity, a platform package declares no lifecycle scripts and no bin, and postinstall.mjs imports no process or network module. Tests a generated platform package declares no lifecycle scripts and no bin, so installing it runs nothing and scripts/postinstall.mjs fetches nothing and spawns nothing.
bin/launcher.js hands over with an argument vector, never a shell, to the binary inside the platform package Node resolves from its own package, and refuses with exit 3 when there is none; it downloads nothing. Reading handOver and nativeCompiler; tests/run.js's pack-and-install round trip drives it end to end.
postinstall.mjs quotes the path it bakes into the shim correctly for POSIX sh, and never fails an install. Reading shellQuote; the postinstall checks in tests/run.js.
scripts/verify-binaries.sh, build.sh, bootstrap.sh and nish-compiler.sh download nothing; bootstrap.sh reaches the network only through scripts/fetch-seed.sh, and so through SC-1's check. verify-binaries.sh announces its one override (NISH_UNAME_S) on stderr. Reading each; grep for curl, wget, gh , mktemp and eval finds nothing else.
release.yml cannot publish from a ref that is not a v* tag equal to package.json's version, so a crafted tag name never reaches the steps that use it. Reading the targets and release jobs' first step.
The JS hosts evaluate no strings: no eval, new Function or shell: true in runtime/*.mjs or web/*.mjs, and spawnSync takes an argument vector. grep over the four files; reading spawnImpl.
The WASI host's other memory accesses (fd_read, fd_write, fd_pread, path arguments) cannot over-report: an iovec past the end of memory is clamped by subarray, and the count each call writes back is the clamped length, so the guest sees a short read or write, which POSIX and WASI both allow. Only random_get reports success without a count, which is why it alone needed EFAULT. Reading #iovs, #writeStream, #writeFile and #readInto.
runtime/nish.mjs's nish/ resolve hook maps a specifier to std/<name>.ts beside itself; the specifier comes from the program's own source, which this threat model trusts. Reading the hook.

Doc corrections for the security-policy stage

None in std/README.md. For SECURITY.md's threat model: the installers now refuse any download without a published or pinned SHA-256, and SC-16 is the repository setting that makes that check as strong for future releases as it is for the pinned ones. SC-16 is now fixed: immutable from v0.16.0, attested after 0.21.0.