Skip to content

fix(plugins): reject unverifiable pinned npm installs - #136725

Merged
eleqtrizit merged 3 commits into
openclaw:mainfrom
eleqtrizit:1008
Sep 3, 2026
Merged

eleqtrizit merged 3 commits into
openclaw:mainfrom
eleqtrizit:1008

Conversation

@eleqtrizit

Copy link
Copy Markdown
Contributor

Summary

Make pinned npm plugin installs stop when package metadata cannot provide the integrity value needed to validate the pin.

Changes

  • distinguish unpinned installs from pinned installs with missing integrity metadata
  • preserve the existing explicit consent flow for present integrity mismatches
  • cover the policy with unit, mocked-installer, and real-registry tests

Validation

  • node scripts/run-vitest.mjs run src/infra/npm-integrity.test.ts --reporter=dot
  • node scripts/run-vitest.mjs run src/plugins/install.npm-spec.test.ts --reporter=dot
  • node scripts/run-vitest.mjs run src/plugins/install.npm-spec.e2e.test.ts -t 'rejects a trusted pin when a real registry omits dist.integrity' --reporter=dot
  • node scripts/check-changed.mjs -- src/infra/npm-integrity.ts src/infra/npm-integrity.test.ts src/plugins/install.npm-spec.test.ts src/plugins/install.npm-spec.e2e.test.ts src/plugins/test-helpers/npm-registry-fixtures.ts

Notes

  • No configuration, schema, migration, CLI, protocol, or plugin SDK changes.
  • Unpinned npm plugin installs retain their existing behavior.
  • Production code is net 44 lines smaller.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 2, 2026, 7:31 PM ET / 23:31 UTC.

ClawSweeper review

What this changes

The PR aborts a pinned npm plugin install before npm runs when registry metadata lacks the integrity value needed to validate its expected artifact pin.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open. This is a focused, correct repair for a documented pinned-install verification bypass; it is not already on current main. The only material merge consideration is the intentional fail-closed behavior for registries that omit integrity metadata.

Priority: P2
Reviewed head: 012d9459c4c6490e41d8f83b2e7936d340cba1f6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with strong source and dependency-contract support; the remaining compatibility effect is intentional and documented.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies this as a member-maintained, maintainer-labeled PR, so the external-contributor proof gate does not apply; the added loopback registry test remains relevant supplemental coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies this as a member-maintained, maintainer-labeled PR, so the external-contributor proof gate does not apply; the added loopback registry test remains relevant supplemental coverage.
Evidence reviewed 6 items Current-main bypass: The metadata reader requests npm integrity but accepts name-and-version-only metadata; the current-main integrity helper then permits a missing resolved integrity, so an expected catalog pin is never compared.
npm view contract: Installed npm 11.17.0 identifies npm/cli as its source repository; requested view fields are omitted when unavailable, while dot-separated child fields and JSON output are supported.
Introduced owner-boundary repair: The PR normalizes the expected pin, preserves unpinned behavior, and aborts when a pin exists but resolved metadata has no integrity.
Findings None None.
Security None None.

How this fits together

Plugin onboarding and management resolve npm metadata before installing an external plugin into OpenClaw’s managed npm root. The integrity gate decides whether a catalog pin can be verified before installation and capability review proceed.

flowchart LR
  A[Plugin install request] --> B[npm registry metadata]
  B --> C[Integrity gate]
  C -->|pin verified| D[Managed npm install]
  C -->|pin missing or different| E[Visible abort]
  D --> F[Installed plugin]
Loading

Before merge

  • Resolve merge risk (P1) - Pinned plugin installs served by a registry that omits dist.integrity will now visibly abort instead of installing bytes that cannot be checked against the catalog pin.
Agent review details

Security

None.

PR surface

Source -44, Tests +93. Total +49 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 30 74 -44
Tests 4 96 3 +93
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 126 77 +49

Review metrics

Metric Value Why it matters
Production versus test delta production -44; tests and test support +93 net The repair removes duplicated integrity-resolution plumbing while adding focused unit, installer, and loopback-registry coverage.

Merge-risk options

Maintainer options:

  1. Retain the documented fail-closed behavior (recommended)
    Accept the targeted compatibility change so a registry lacking integrity metadata cannot install an artifact claimed to be pinned.

Technical review

Best possible solution:

Keep the shared pre-install gate: permit unpinned installs, but reject a pinned registry install when its required integrity proof is absent.

Do we have a high-confidence way to reproduce the issue?

Yes, source evidence is high-confidence: npm can omit an unavailable requested view field, OpenClaw accepts that metadata, and current main then proceeds without comparing the expected pin. The PR’s loopback-registry test exercises this path, but it was not run in this read-only review.

Is this the best way to solve the issue?

Yes. Enforcing the invariant at the shared pre-install integrity owner is the narrowest maintainable repair; downstream lockfile verification cannot validate an expected pin when the registry resolution supplied no integrity.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2b08972def7e.

Labels

Label changes:

  • add P2: This repairs a bounded but meaningful plugin-install verification gap without evidence of an active emergency.
  • add merge-risk: 🚨 compatibility: Existing pinned installs using a registry that omits dist.integrity will change from proceeding to a visible fail-closed error.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies this as a member-maintained, maintainer-labeled PR, so the external-contributor proof gate does not apply; the added loopback registry test remains relevant supplemental coverage.

Label justifications:

  • P2: This repairs a bounded but meaningful plugin-install verification gap without evidence of an active emergency.
  • merge-risk: 🚨 compatibility: Existing pinned installs using a registry that omits dist.integrity will change from proceeding to a visible fail-closed error.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies this as a member-maintained, maintainer-labeled PR, so the external-contributor proof gate does not apply; the added loopback registry test remains relevant supplemental coverage.

Evidence

What I checked:

  • Current-main bypass: The metadata reader requests npm integrity but accepts name-and-version-only metadata; the current-main integrity helper then permits a missing resolved integrity, so an expected catalog pin is never compared. (src/infra/install-source-utils.ts:158, 2b08972def7e)
  • npm view contract: Installed npm 11.17.0 identifies npm/cli as its source repository; requested view fields are omitted when unavailable, while dot-separated child fields and JSON output are supported. (lib/commands/view.js:431)
  • Introduced owner-boundary repair: The PR normalizes the expected pin, preserves unpinned behavior, and aborts when a pin exists but resolved metadata has no integrity. (src/infra/npm-integrity.ts:32, 012d9459c4c6)
  • Install ordering and downstream verification: The registry-install caller invokes the integrity gate before managed installation; downstream lockfile verification only compares integrity when registry metadata itself contained one, so it cannot repair the current bypass. (src/plugins/install-npm.ts:175, 012d9459c4c6)
  • Focused boundary coverage: The new unit test, managed-installer test, and loopback static-registry test cover missing integrity, verify npm installation is not invoked, and assert no managed project is created. (src/plugins/install.npm-spec.e2e.test.ts:959, 012d9459c4c6)
  • History and current-main status: The first branch commit introduced the missing-pin rejection; current main was later updated only in unrelated scripts and still contains the old helper behavior. (src/infra/npm-integrity.ts:39, 08351be78b66)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@eleqtrizit
eleqtrizit merged commit 8f2f551 into openclaw:main Sep 3, 2026
231 checks passed
vincentkoc added a commit that referenced this pull request Sep 3, 2026
* refs/remotes/origin/main:
  fix(plugins): reject unverifiable pinned npm installs (#136725)
  improve(ui): lift sidebar section headers on hover and mark online owners (#136985)
  test(cron): reuse isolated run suite hooks (#137341)
  test(channels): reuse shared indexed call guards (#137350)
  fix(ui): sidebar header controls read misaligned after the + button lost its border (#137317)
  fix(qa-channel): preserve conversation kind for implicit actions (#137343)
  fix: target the source checkout in Control UI repair commands (#137354)
  chore: reduce CI job count and database test overhead (#137352)
  fix(ios): preserve chat live edge across keyboard transitions (#136660)
  refactor(control-ui): consolidate mention inbox requests (#137375)
  fix(openai): preserve ChatGPT HTTP status for retry pacing (#137146)
  fix(mcp): hide policy-denied plugin tools from ACP sessions [AI] (#136546)
  test(queue): reuse shared deferred fixtures (#137338)
  fix(gateway): repair the Gateway E2E shard (browser suite project, skill resource argv, Codex diagnostic) (#137358)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
@eleqtrizit eleqtrizit self-assigned this Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant