Skip to content

security: pin the native fs-ext-extra-prebuilt dependency for consumer installs #69

Closed

Description

@abruption

What happened

The only runtime dependency, the native addon fs-ext-extra-prebuilt, is declared as ^2.2.14, and the published package does not include npm-shrinkwrap.json. package-lock.json is not applied to consumers, so npm i -g codex-unlock installs whatever 2.x is newest at install time.

Properties of that dependency (from npm registry metadata and its repository as of 2026-09-28):

  • It runs an install script (node ./install.js) that loads a prebuilt .node binary and falls back to node-gyp rebuild; nan is also a caret range.
  • It is published frequently by a single maintainer (2.2.8 → 2.2.14 between 2026-05 and 2026-09). Prebuilt binaries are committed by a scheduled workflow, and its publish provenance attests the committed blobs rather than how the .node files were built.
  • flockSync from it is loaded into the same process that sends SIGTERM, and it implements the OS lock probe that the safety invariants depend on.

CI and smoke:package validate only the locked 2.2.14 (package-smoke installs offline from the cache), so a later 2.x that users receive has never been tested against the lock-probe invariants.

What you expected

Users install the exact native dependency version that CI validated, and dependency updates go through the normal reviewed PR and test matrix.

Environment

  • codex-unlock 0.4.0 at 6227e6c
  • npm audit and npm audit signatures pass for the current tree; this is about future versions.

Source evidence

  • Caret range:
    "fs-ext-extra-prebuilt": "^2.2.14"
  • Published file list without a shrinkwrap:
    "files": [
    "dist/cli.js",
    "dist/coordination.js",
    "dist/doctor.js",
    "dist/inspection.js",
    "dist/json-types.d.ts",
    "dist/lock.js",
    "dist/options.js",
    "dist/policy.js",
    "dist/process.js",
    "dist/transcript.js",
    "dist/types.js",
    "dist/types.d.ts",
    "dist/unlock.js",
    "dist/update.js",
    "dist/util.js",
    "schemas/codex-unlock-v1.schema.json",
    "docs/cli-reference.md",
    "docs/json-v1.md",
    "docs/platform-support.md",
    "docs/safety-race-matrix.md",
    "docs/update-security.md",
    "docs/upstream-handoff-proposal.md",
    "docs/v0.2-migration.md",
    "README.md",
    "CHANGELOG.md",
    "LICENSE"
    ],
  • Native import sites:
    import { flockSync } from "fs-ext-extra-prebuilt";
    ,
    import { flockSync } from "fs-ext-extra-prebuilt";
    ,
    import { flockSync } from "fs-ext-extra-prebuilt";
  • Package smoke installs from the offline cache:

Acceptance criteria

  • The runtime dependency tree is pinned for consumers (publish npm-shrinkwrap.json, or pin exact versions of fs-ext-extra-prebuilt and nan).
  • Dependabot keeps proposing updates so they pass the full platform matrix before release.
  • The package smoke test asserts the installed dependency version matches the pinned version.

Scope and limitations

  • No malicious or broken version is known. This reduces exposure to upstream compromise or silent behavior/ABI changes in a dependency that runs install scripts and native code.

Checked

Activity

  1. added this to the v0.4.1 milestone on Sep 28, 2026
  2. added
    enhancement
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions