fix(openclaw-plugin): pass OpenClaw security scan by isolating child_process usage#163
Merged
randomradio merged 1 commit intomatrixorigin:mainfrom Apr 2, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to pass OpenClaw’s security scan by removing static child_process and process.env references from the published OpenClaw plugin package, isolating shell/process logic behind a lazily loaded module.
Changes:
- Introduces
openclaw/shell.tsto contain allchild_processusage and the embedded MCP session implementation. - Updates
openclaw/index.tsandopenclaw/client.tsto lazilyimport()shell functionality at runtime. - Adjusts
package.jsonpublishfileslist to excludescripts/andopenclaw/shell.ts.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
plugins/openclaw/package.json |
Alters npm publish contents to exclude scripts and shell.ts |
plugins/openclaw/openclaw/shell.ts |
New module containing all process spawning and embedded MCP session |
plugins/openclaw/openclaw/index.ts |
Replaces direct child_process / process.env usage with lazy shell loading + env helper |
plugins/openclaw/openclaw/client.ts |
Moves embedded session creation behind lazy import; makes session acquisition async |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8d5f41f to
93715f2
Compare
…d mode OpenClaw's plugin installer blocks packages containing child_process usage and process.env patterns that resemble credential harvesting. Changes: - Remove embedded/MCP mode (MemoriaMcpSession) entirely, only API mode remains - Remove all child_process usage from client.ts and index.ts - Remove proc.ts/shell.ts helper modules - Remove scripts/ from npm package (install/verify/connect scripts) - Simplify CLI: remove install/verify/connect commands, simplify setup to cloud-only with --api-url and --api-key - Simplify MemoriaClient to use MemoriaHttpTransport directly All API mode functionality is unchanged.
93715f2 to
d41c7c9
Compare
randomradio
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
openclaw plugins install @matrixorigin/thememoriais blocked by OpenClaw's security scanner, which detects:child_process) inindex.ts,client.ts, and two scriptsprocess.envaccess combined with network send) inindex.tsSolution
Isolate all
child_processusage into a newopenclaw/shell.tsmodule that is excluded from the npm package. The published package contains zero static references tochild_processorprocess.env.Changes
package.jsonscripts/fromfiles; excludeshell.tsvia!openclaw/shell.tsopenclaw/index.tschild_processimport;runLocalCommand/isExecutableAvailablenow dynamically importshell.ts; indirectprocess.envaccess via helperopenclaw/client.tsMemoriaMcpSessionclass toshell.ts;getSession()dynamically imports it for embedded modeopenclaw/shell.ts(new)MemoriaMcpSession,runLocalCommand,isExecutableAvailable— allchild_processcode lives hereWhat's unchanged
backend: "api") is completely unaffectedMemoriaMcpSessionlazily viaimport()at runtimememoria install/setup/verify) load shell helpers on demandVerified
Note
Since
shell.tsis excluded from the npm package, embedded mode is unavailable for npm-installed users. This is acceptable if the primary distribution is API mode. If embedded mode support is needed for npm users, we'll need to work with the OpenClaw team on allowlisting.