Skip to content

fix(security): plugins that declare pnpm get Endor scans instead of failing - #4804

Merged
jesse-merhi merged 2 commits into
mainfrom
fix/endor-pnpm-package-manager
Nov 16, 2026
Merged

jesse-merhi merged 2 commits into
mainfrom
fix/endor-pnpm-package-manager

Conversation

@jesse-merhi

@jesse-merhi jesse-merhi commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Problem: Endor can't scan code plugins whose package.json says "packageManager": "pnpm@…". The scanner image has no pnpm, so endorctl stops at its host check, and the release is saved as failed with "Request a rescan to try again". A rescan fails the same way. In the current Production backfill, that's 301 of the 303 releases that fail on pnpm, across 31 packages. None of them ship a pnpm lockfile.

Fix: The worker already tidies a throwaway copy of the package before Endor sees it (for example, it renames npm-shrinkwrap.json). Now it also removes the two things that make endorctl ask for pnpm: a pnpm packageManager value and pnpm-workspace.yaml. npm reads neither, so dependency resolution doesn't change, and these plugins get scanned with npm. The published artifact, the scanner image and moderation are untouched. Packages with a real pnpm-lock.yaml are still saved as skipped.

Proof

Real failing releases, real worker, Production scanner image, stand-in API

Release Before: main After: this PR
@arloraccoon/openclaw-vaultwarden-plugin@0.1.4
pnpm packageManager, no lockfile
❌ needs pnpm, Endor exited 27 ✅ host check passes, 740 dependencies resolved with npm, call graph built
openclaw-code-agent@6.0.4
pnpm packageManager + npm-shrinkwrap.json
❌ needs pnpm, Endor exited 27 ✅ host check passes, 283 dependencies resolved with npm
@yuder-altcode/openclaw-plugin-izipay@0.1.0
pnpm-workspace.yaml only
❌ needs pnpm, Endor exited 27 ✅ host check passes, 533 dependencies resolved with npm, call graph built

Before: main stops at the host check (vaultwarden 0.1.4; matches the Production error)

INFO: Checking javascript toolset ...
ERROR host-check-failure: Cannot access the "pnpm" command.
Endor exited 27

After: this PR scans the same release with npm

INFO: Checking javascript toolset ... ok
INFO: Host-check complete
INFO: Package 'npm://@arloraccoon/openclaw-vaultwarden-plugin@0.1.4' at '.' has 740 resolved dependencies
INFO: Generated call graph for 'npm://@arloraccoon/openclaw-vaultwarden-plugin@0.1.4'
INFO: Completed call graph generation for private dependencies

These runs used the pinned Production image (ghcr.io/openclaw/clawhub-endor@sha256:3db43b8b…, endorctl v1.7.1115), its entrypoint, egress guard and scan.sh, and the worker's real container flags. To avoid using Endor credentials, a local stand-in for the Endor API ran inside the container. That stand-in can't answer Endor's package-metadata requests, so these runs still end in an error once dependencies are resolved. The real Endor run below covers the rest.

Real Endor scan, no stand-in

Same worker code and the unmodified Production image, run against the real openclaw-nfr.clawhub namespace with a temporary Code Scanner key, which was then deleted:

Release Before: Production backfill After: this PR, real Endor
@arloraccoon/openclaw-vaultwarden-plugin@0.1.4 failed: needs pnpm ✅ completed: 741 dependencies resolved with npm, 0 scan failures, 0 call graph errors, 0 reachable vulnerable functions
@yuder-altcode/openclaw-plugin-izipay@0.1.0 failed: needs pnpm ⚠️ gets past pnpm (533 dependencies resolved, call graph built), but still failed: in two runs, Endor timed out reading back the call graph it had just stored
INFO: Checking javascript toolset ... ok
INFO: Package 'npm://@arloraccoon/openclaw-vaultwarden-plugin@0.1.4' at '.' has 741 resolved dependencies
INFO: 1 package version(s) discovered, 0 scan failure(s), 0 call graph error(s)
=> {"status":"completed","reachableFunctionCount":0,"findings":[]}

Open question: the izipay timeout (unable to read data from bucket ... context deadline exceeded) happens after the pnpm step, so this PR doesn't cause it. These runs were emulated amd64 on a Mac. Whether it also happens on the hosted worker will show on the next scan of that release.

What makes endorctl ask for pnpm

The real endorctl host check, run on small test packages with no pnpm installed:

Package contains Asks for pnpm?
packageManager: "pnpm@…" Yes
packageManager: "pnpm@…" and package-lock.json Yes
pnpm-workspace.yaml Yes
pnpm-lock.yaml Yes (already saved as skipped)
packageManager: "pnpm@…" with ENDOR_JS_PACKAGE_MANAGER=npm set Yes, so Endor's documented override doesn't fix this
no pnpm markers, packageManager naming npm or Yarn, a pnpm field, engines.pnpm, or packageManager: "pnpm@…" only in a nested package No

So removing those two markers is enough. Marking these releases skipped would leave them unscanned. Adding pnpm to the image is bigger and security-sensitive, and it would give the same result here because these releases have no pnpm lockfile.

Supporting checks and change details

Checks

  • bunx vitest run scripts/security/run-endor-plugin-scan.test.ts: 9/9 pass. The normalization test now also covers a pnpm packageManager and pnpm-workspace.yaml.
  • bun run ci:static: passes.
  • bunx tsc -p packages/schema/tsconfig.json --noEmit and bunx tsc -p packages/clawhub/tsconfig.json --noEmit: pass.
  • VITE_CONVEX_URL=https://example.invalid bun run coverage: 13 failures, all timeouts in unrelated security-worker suites while local Docker proof runs were using the machine. All six of those files pass when rerun on their own.
  • scripts/security/endor/fixtures/run.sh wasn't run: the image, npm, Yarn, scan.sh and the egress guard are unchanged.
  • Review: an independent reviewer found nothing at P0–P2, and its P3 spec-wording note is fixed. The shared autoreview helper isn't installed on this machine.

Edge cases handled

  • A directory named pnpm-workspace.yaml is removed too, and the tree walk lists entries after normalizing, so the removal can't break it.
  • Only a packageManager value of pnpm or pnpm@… is removed. npm and Yarn values are kept.
  • Every change is made in the throwaway copy. The uploaded artifact stays the source of truth.

Related, not in this PR

The same backfill has 138 failures from publishers' broken dependencies (ws@main, git URLs, npm 404s). A rescan can't fix those either, so their "Request a rescan" text is misleading too. Worth a separate change.

Change breakdown

Part Files +LOC -LOC
Worker code (run-endor-plugin-scan.ts) 1 +17 -3
Tests 1 +6 -0
Spec (specs/endor-plugin-scans.md) 1 +5 -1
Total 3 +28 -4

endorctl's host-check demands the pnpm binary whenever package.json names
pnpm in packageManager or a pnpm-workspace.yaml exists, even next to an npm
lockfile. The scanner image only runs npm and Yarn, so these releases failed
with "Cannot access the pnpm command" and an unhelpful "request a rescan".

The disposable scan copy now drops a pnpm packageManager value and any
pnpm-workspace.yaml. Neither changes what npm resolves, and a root
pnpm-lock.yaml is still skipped before normalization.
Copilot AI balanced review requested due to automatic review settings November 16, 2026 06:01
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clawhub Ready Ready Preview Nov 16, 2026 6:04am UTC

Request Review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@jesse-merhi jesse-merhi changed the title fix(security): scan packageManager-pnpm plugins with npm in Endor fix(security): plugins that declare pnpm get Endor scans instead of failing Nov 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes pnpm selection metadata from disposable scan copies so plugins without a root pnpm lockfile can receive Endor scans through npm.

Example: Scan @arloraccoon/openclaw-vaultwarden-plugin@0.1.4, which declares pnpm without shipping its lockfile.

  • Before: Endor fails its host check because pnpm is unavailable.
  • After: The supplied real scan resolves 741 dependencies with npm and returns completed with no reachable findings.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with real scanner completion, useful regression coverage, passing exact-head checks and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The supplied logs exercise the real worker and pinned scanner image against real Endor: vaultwarden 0.1.4 completes after the fix, while separate real-image runs cover workspace-only and shrinkwrap variants; the later izipay service timeout is explicitly disclosed.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Plugin owners receive repeatable failed Endor results and an ineffective rescan suggestion for otherwise npm-scannable releases.
Reason: The maintainer-authored direction restores intended advisory scan coverage with a narrowly scoped change and preserves existing security and moderation contracts.

Merge readiness

✅ Ready for maintainer review

No findings. This maintainer-authored PR fixes a current scanner failure absent from main, and the supplied real Endor logs establish successful completion.

Priority: P2
Reviewed head: 111a547f9efe9da924db5c91852a4a11cb015b68

Before merge

None.

Findings

None.

Agent review details

How this fits together

The security worker copies published plugin artifacts into a disposable workspace, runs the isolated Endor scanner, and saves advisory release results separately from moderation.

flowchart LR
  A[Published plugin artifact] --> B[Security worker]
  B --> C[Disposable normalized copy]
  C --> D[Isolated Endor scanner]
  D --> E[Advisory release result]
  E --> F[Security audit page]
Loading

Technical review

Best possible solution:

Land the focused normalization change through the existing scanner owner while preserving root-lockfile skipping, artifact integrity and report-only results.

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

Current main preserves the metadata implicated by the supplied real Endor host-check failures; the contributor supplies concrete affected releases and before/after output, though this read-only review ran no target code.

Is this the best way to solve the issue?

Best-fix verdict: best. Extending disposable-copy normalization addresses the selector mismatch at its existing owner; skipping these packages would sacrifice coverage, adding pnpm would expand the isolation surface, and the supplied host-check experiment shows Endor's npm override does not bypass the failure.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a83aceea4249.

Provenance checked

  • Disposable manifest normalization and directory traversal keeps the original intent (5e8aec5: The original integration normalized published workspace dev links and shrinkwrap files for dependency analysis; reading directory entries after normalization accommodates the newly removed marker.)
  • Report-only scan preparation keeps the original intent (46dbc1f: The simplification retained isolated dependency resolution and made Endor advisory for all code plugins.)
  • Root pnpm-lock.yaml eligibility keeps the original intent (86905c3: Packages needing actual pnpm resolution are skipped because the scanner isolates only npm and Yarn; this PR retains that skip.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jesse Merhi: Raw commit 86905c3 adds scripts/security/run-endor-plugin-scan.ts:224 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 86905c3d8809; files: scripts/security/run-endor-plugin-scan.ts)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Patch scope Production +17/-3; tests +6/-0; spec +5/-1 Small, justified growth extends the existing normalization path without introducing another resolver or scanner layer.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Restores advisory dependency scanning for affected plugins without blocking publication or changing moderation.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-16T06:19:30.997Z sha 111a547 :: needs maintainer review before merge. :: none

Reviewed November 16, 2026, 1:55 AM ET / 06:55 UTC (Revision 2).

@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The PR body now includes a real Endor run with no stand-in API. The real worker code and the pinned Production image, scanning against the openclaw-nfr.clawhub namespace, turned @arloraccoon/openclaw-vaultwarden-plugin@0.1.4 from Production's failed (needs pnpm) into {"status":"completed","reachableFunctionCount":0,"findings":[]}. That run resolved 741 dependencies with npm, with 0 scan failures and 0 call graph errors. See "Real Endor scan, no stand-in" in the description.

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Nov 16, 2026
@jesse-merhi
jesse-merhi merged commit ef45a68 into main Nov 16, 2026
93 of 96 checks passed
@jesse-merhi
jesse-merhi deleted the fix/endor-pnpm-package-manager branch November 16, 2026 06:57

This branch was successfully deployed

1 active deployment
Preview – clawhub — 111a547f Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

2 participants