Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 1:36 PM ET / 17:36 UTC. ClawSweeper reviewWhat this changesExtends the skill source scanner so Merge readinessThis PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherOpenClaw scans skill and plugin source before presenting Skill Workshop proposals and during deep security audits. Source text enters the shared scanner, which emits critical findings that can fail a proposal or surface code-safety risks to operators. flowchart LR
A[Plugin or skill source] --> B[Security source scanner]
B --> C[Child process binding provenance]
C --> D[Dangerous execution rule]
D --> E[Critical scan findings]
E --> F[Workshop proposal result]
E --> G[Deep security audit]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +208, Tests +141. Total +349 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the provenance-scoped scanner repair once the final-head CI is green, retaining the focused positive and negative regression cases as the contract for this regex-based scanner. Do we have a high-confidence way to reproduce the issue? Yes — current main's literal-call pattern and source-wide context gate leave the reported alias and computed-member forms unmatched; the PR body also provides exact-head terminal results for the repaired cases. Is this the best way to solve the issue? Yes — collecting only direct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 603321a31569. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…mputed members
The advisory source scanner's dangerous-exec rule missed three
child_process invocation forms that each should produce a critical
finding, plus a fourth namespace-alias computed-exec form:
- ESM import alias: import { spawn as launch } from "node:child_process"; launch(...)
- CJS destructure alias: const { exec: run } = require("child_process"); run(...)
- computed member: import cp from "node:child_process"; cp["spawn"](...)
- namespace alias computed exec: const proc = require("child_process"); proc["exec"](...)
The rule pattern only matched bare command names and used a source-wide
child_process context gate with a literal receiver-name allowlist in
isBenignMemberExecMatch, so aliased bindings and computed calls on proven
namespace aliases escaped detection.
Add a provenance-aware collectChildProcessBindings pass that derives
renamed method bindings and whole-namespace bindings ONLY from actual
child_process imports/requires (so unrelated aliases such as a locally
imported launch() do not false-positive). Extend the dangerous-exec
pattern with a computed-member branch and make isBenignMemberExecMatch
consult namespace-alias provenance instead of a hard-coded receiver
allowlist, so computed exec on a proven child_process namespace alias
fires while the RegExp.exec exclusion is preserved.
Fixes openclaw#116255
Co-Authored-By: Maas <[email protected]>
Fixes CI oxfmt --check failure on PR openclaw#116304 (oxfmt wrapped a long if condition across multiple lines). No logic changes.
…ceiver The dangerous-exec scanner's computed-member matcher accepted any obj["spawn"]()/obj["execSync"]() call whenever child_process appeared anywhere in the file, while receiver provenance was checked only for exec. That turned unrelated APIs into critical findings, which could incorrectly fail Skill Workshop proposals and distort deep-audit output. Require a proven child_process namespace receiver for EVERY watched computed execution method (exec/execSync/spawn/spawnSync/execFile/ execFileSync), preserving the long-standing RegExp.exec exclusion only for the direct dot-member exec case. Add regression coverage for unrelated computed spawn/execSync calls and a proven computed execSync positive. Addresses ClawSweeper P1 on PR openclaw#116304.
…cted namespace aliases Address ClawSweeper P1/P2: consult provenance namespaceAliases for direct dot-member exec calls (e.g. proc.exec for const proc = require(...)) and collect ESM namespace imports (import * as proc from "node:child_process"). Co-Authored-By: Codex <[email protected]>
486b7b4 to
ee38574
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
ClawSweeper P1: the alias attribution path emitted only the first proven child_process alias call per source line, violating the scanner's per-occurrence reporting. Match all alias call positions and emit a finding for each (skipping positions the literal pattern already reported), with a regression test for two calls on one line. Co-Authored-By: Codex <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer review: merge as-is. This PR addresses the exact #116255 reproductions with appropriately scoped positive and negative coverage. Broader scanner provenance handling was considered during review, but that would materially expand this focused regex-based repair. No blocking findings remain. Reviewed HEAD: Required CI and local autoreview are clean. |
|
Merged via squash.
|
* origin/main: fix(onboard): keep referenced provider secrets out of plaintext (#118702) docs: show canonical agent roster configuration (#118722) fix(channels): generate catalog from package manifests (#118097) fix(zalouser): distinguish probe timeout from auth failure (#111336) improve(ui): cut E2E shard runtime by reusing the bundle (#118697) fix(cli): publish completion caches atomically (#118715) fix(whatsapp): honor disabled self-chat without widening group access (#118711) fix(voice-call): terminate carrier calls after realtime startup failures (#118699) fix(slack): isolate GovSlack media trust and delivery (#118695) fix(browser): wrap page-controlled action results (#118691) fix(security): sanitize JSON-escaped forged content boundaries (#118698) test(qa): prove real yielded-child completion and channel delivery (#118707) fix(doctor): honor explicit plugin-only migration authority (#118700) fix(security): detect child_process calls through aliases and computed members (#116304) test(gateway): avoid async facade mock race (#118708) fix(gateway): preserve final speech during transcription shutdown (#118693) fix(gateway): resume durable outbound delivery retries (#118694) fix(plugins): reject external public-artifact hardlinks (#118689)
* origin/main: (78 commits) fix(parallels): recover Windows poll transport failures (#118479) fix(channels): deny unauthorized Discord and Telegram binding access (#118704) fix(test): bound shared git inventory lookup (#111171) fix(onboard): keep referenced provider secrets out of plaintext (#118702) docs: show canonical agent roster configuration (#118722) fix(channels): generate catalog from package manifests (#118097) fix(zalouser): distinguish probe timeout from auth failure (#111336) improve(ui): cut E2E shard runtime by reusing the bundle (#118697) fix(cli): publish completion caches atomically (#118715) fix(whatsapp): honor disabled self-chat without widening group access (#118711) fix(voice-call): terminate carrier calls after realtime startup failures (#118699) fix(slack): isolate GovSlack media trust and delivery (#118695) fix(browser): wrap page-controlled action results (#118691) fix(security): sanitize JSON-escaped forged content boundaries (#118698) test(qa): prove real yielded-child completion and channel delivery (#118707) fix(doctor): honor explicit plugin-only migration authority (#118700) fix(security): detect child_process calls through aliases and computed members (#116304) test(gateway): avoid async facade mock race (#118708) fix(gateway): preserve final speech during transcription shutdown (#118693) fix(gateway): resume durable outbound delivery retries (#118694) ...
…d members (openclaw#116304) * [AI] fix(security): detect child_process calls through aliases and computed members The advisory source scanner's dangerous-exec rule missed three child_process invocation forms that each should produce a critical finding, plus a fourth namespace-alias computed-exec form: - ESM import alias: import { spawn as launch } from "node:child_process"; launch(...) - CJS destructure alias: const { exec: run } = require("child_process"); run(...) - computed member: import cp from "node:child_process"; cp["spawn"](...) - namespace alias computed exec: const proc = require("child_process"); proc["exec"](...) The rule pattern only matched bare command names and used a source-wide child_process context gate with a literal receiver-name allowlist in isBenignMemberExecMatch, so aliased bindings and computed calls on proven namespace aliases escaped detection. Add a provenance-aware collectChildProcessBindings pass that derives renamed method bindings and whole-namespace bindings ONLY from actual child_process imports/requires (so unrelated aliases such as a locally imported launch() do not false-positive). Extend the dangerous-exec pattern with a computed-member branch and make isBenignMemberExecMatch consult namespace-alias provenance instead of a hard-coded receiver allowlist, so computed exec on a proven child_process namespace alias fires while the RegExp.exec exclusion is preserved. Fixes openclaw#116255 Co-Authored-By: Maas <[email protected]> * style(security): apply oxfmt to scanner.ts Fixes CI oxfmt --check failure on PR openclaw#116304 (oxfmt wrapped a long if condition across multiple lines). No logic changes. * fix(security): scope computed exec methods to proven child_process receiver The dangerous-exec scanner's computed-member matcher accepted any obj["spawn"]()/obj["execSync"]() call whenever child_process appeared anywhere in the file, while receiver provenance was checked only for exec. That turned unrelated APIs into critical findings, which could incorrectly fail Skill Workshop proposals and distort deep-audit output. Require a proven child_process namespace receiver for EVERY watched computed execution method (exec/execSync/spawn/spawnSync/execFile/ execFileSync), preserving the long-standing RegExp.exec exclusion only for the direct dot-member exec case. Add regression coverage for unrelated computed spawn/execSync calls and a proven computed execSync positive. Addresses ClawSweeper P1 on PR openclaw#116304. * [AI] fix(security): recognize direct and computed calls through collected namespace aliases Address ClawSweeper P1/P2: consult provenance namespaceAliases for direct dot-member exec calls (e.g. proc.exec for const proc = require(...)) and collect ESM namespace imports (import * as proc from "node:child_process"). Co-Authored-By: Codex <[email protected]> * [AI] fix(security): report every proven alias execution call on a line ClawSweeper P1: the alias attribution path emitted only the first proven child_process alias call per source line, violating the scanner's per-occurrence reporting. Match all alias call positions and emit a finding for each (skipping positions the literal pattern already reported), with a regression test for two calls on one line. Co-Authored-By: Codex <[email protected]> --------- Co-authored-by: Maas <[email protected]>
* origin/main: fix(onboard): keep referenced provider secrets out of plaintext (openclaw#118702) docs: show canonical agent roster configuration (openclaw#118722) fix(channels): generate catalog from package manifests (openclaw#118097) fix(zalouser): distinguish probe timeout from auth failure (openclaw#111336) improve(ui): cut E2E shard runtime by reusing the bundle (openclaw#118697) fix(cli): publish completion caches atomically (openclaw#118715) fix(whatsapp): honor disabled self-chat without widening group access (openclaw#118711) fix(voice-call): terminate carrier calls after realtime startup failures (openclaw#118699) fix(slack): isolate GovSlack media trust and delivery (openclaw#118695) fix(browser): wrap page-controlled action results (openclaw#118691) fix(security): sanitize JSON-escaped forged content boundaries (openclaw#118698) test(qa): prove real yielded-child completion and channel delivery (openclaw#118707) fix(doctor): honor explicit plugin-only migration authority (openclaw#118700) fix(security): detect child_process calls through aliases and computed members (openclaw#116304) test(gateway): avoid async facade mock race (openclaw#118708) fix(gateway): preserve final speech during transcription shutdown (openclaw#118693) fix(gateway): resume durable outbound delivery retries (openclaw#118694) fix(plugins): reject external public-artifact hardlinks (openclaw#118689)
What Problem This Solves
The advisory source scanner's
dangerous-execrule missedchild_processexecution calls routed through renamed bindings or computed members, so a Skill Workshop proposal (or other scanned source) using one of these forms scanned ascleaninstead of emitting a critical finding.exec(,cp.spawn() and used a source-widechild_processcontext gate plus a hard-coded receiver-name allowlist inisBenignMemberExecMatch. It could not associate a renamed binding (launch,run) with itschild_processorigin, and it suppressed computedexecon any receiver not namedcp/childProcess/child_process.collectChildProcessBindingspass that derives renamed method bindings and whole-namespace bindings ONLY from actualchild_processimports/requires; extend thedangerous-execpattern with a computed-member branch; and makeisBenignMemberExecMatchconsult namespace-alias provenance instead of a hard-coded receiver allowlist.src/skills/security/scanner.ts(binding collection, computed-member pattern, provenance-aware benign filter, alias-call attribution in the scan loop);src/skills/security/scanner.test.ts(positive + negative regression cases, including the P1 follow-up below).LineRule/SourceRuletypes and exportedscanSourcesignature are unchanged; existing literal detections (exec(...),cp.spawn(...),cp.exec(...)) and theRegExp.execbenign exclusion are preserved.Follow-up: scope every computed execution method to a proven receiver (P1)
Review feedback (ClawSweeper, P1) flagged that the original computed-member matcher only provenance-checked
exec: an unrelatedworker["spawn"]()orbus["execSync"]()was classified as critical wheneverchild_processappeared anywhere in the file, which could incorrectly fail legitimate Skill Workshop proposals and distort deep-audit output.This push extends receiver provenance to every watched computed execution method (
exec,execSync,spawn,spawnSync,execFile,execFileSync). A computed call is attributed tochild_processonly when its receiver is a proven namespace alias (or a literalcp/childProcess/child_process); otherwise it stays benign. The long-standingRegExp.execexclusion is preserved for the direct dot-memberexeccase. New negative regression cases guard the unrelatedspawn/execSyncpaths.Change Type (select all)
Scope (select all)
Linked Issue/PR
Motivation
Operators relying on
openclaw security audit --deepcode-safety findings, and Skill Workshop proposal scanning, can miss a real shell-execution primitive when a source file bindschild_processthrough an alias (import { spawn as launch }), a destructured CommonJS alias (const { exec: run } = require("child_process")), or a computed member (cp["spawn"]()). Issue #116255 reports three deterministic false negatives onmain; a fourth form — a namespace alias used with computedexec(const proc = require("child_process"); proc["exec"](...)) — surfaced during verification as a closely related gap the existing rule still misses. This PR closes all four forms while preserving the scanner's deliberately narrow heuristic model and the existingRegExp.execexclusion. The P1 follow-up additionally ensures the computed-member matcher does not over-capture unrelatedspawn/execSync(and other) computed calls.Evidence
child_processinvocation forms (ESM import alias, CJS destructured alias, computed member, namespace-alias computedexec) now produce one criticaldangerous-execfinding; unrelated aliases, unrelated computedspawn/execSynccalls, andRegExp.exec-style computed calls still do not.fix/scanner-child-process-bindings-116255at60e9c982c96, based onorigin/mainb84e14f2225.Input-form behavior matrix (multi-input → output correspondence):
dangerous-execfinding on the call line.execform (proc["exec"]()), a remaining gap surfaced during verification, now also emits a finding.execSync(and other watched methods) on a proven namespace alias now emit a finding — method coverage is no longerexec-only.child_processmodule do NOT fire even when the source-widechild_processgate passes — proving the fix is provenance-scoped, not source-wide token correlation.spawn/execSynccalls on non-child_processreceivers do NOT fire even whenchild_processis present elsewhere — the P1 over-capture is closed.execon a non-child_processreceiver (e.g. aRegExp) stays suppressed — theRegExp.execexclusion is preserved.openclaw security audit --deepend-to-end run on a real plugin tree (the scanner path itself —scanSource()— is exercised directly, which is the exact code path the audit command invokes). Multi-line re-export chains (export { spawn as launch } from "child_process") were not covered; the binding collector handles direct imports/requires only, which matches the issue's "narrow fix" scope.Root Cause (if applicable)
The
dangerous-execrule was never binding-aware: its pattern matched only bare command names, itsrequiresContextgate only checked that the stringchild_processappeared somewhere in the full source, andisBenignMemberExecMatchused a hard-coded receiver allowlist (cp|childProcess|child_process) to excludeRegExp.exec. PR #116222 (merged) later widened per-occurrence reporting but did not touch binding attribution, so aliased and computed forms remained invisible. The original version of this PR then introduced computed-member matching but only provenance-checkedexec, leaving other watched methods (spawn,execSync, …) to over-capture any computed call whenchild_processwas merely present — the P1 follow-up in this push closes that by requiring a proven receiver for every watched computed method. Provenance: introduced by the originaldangerous-execrule; made visible by #116222's per-occurrence reporting widening the detection gap.Regression Test Plan (if applicable)
New cases added to
src/skills/security/scanner.test.ts:scanRuleCases): ESM import alias, CJS destructured alias, computed member, namespace-alias computedexec, namespace-alias computedexecSync(new method coverage).itblocks): alias not fromchild_process(provenance scoping); computedexecon a non-child_processobject (RegExp.execpreserved); unrelated computedspawn/execSynccalls whenchild_processis present (P1 fix); unrelated computedspawnon a literal-named non-alias receiver (P1 fix).User-visible / Behavior Changes
Scanned sources that previously scanned as
cleanwill now correctly emit a criticaldangerous-execfinding when they invokechild_processthrough an import/destructured alias or a computed member on a provenchild_processnamespace alias. Sources that use unrelated computedspawn/execSync(etc.) calls are NOT flagged. Sources that do not use these forms are unaffected.Security Impact (required)
Human Verification (required)
scanSource(); the negative forms (non-child_processalias,RegExp.exec-style computed call, unrelated computedspawn/execSyncon non-child_processreceivers) produce none; pre-existing unrelated test failures reproduce identically on plainorigin/main, confirming they are pre-existing and unrelated to this change.RegExp.execexclusion preserved; alias-call attribution suppresses member calls (obj.launch(is not flagged); computed receiver lookup correctly resolvesproc[slice; provenance applied to every watched computed method, not onlyexec.openclaw security audit --deepon a real plugin directory tree; multi-lineexport ... from "child_process"re-export chains.Compatibility / Migration
Best-fix Verdict
child_processimports/requires (avoiding source-wide token-correlation false positives), closes all four false-negative forms, and — per the P1 follow-up — requires a proven receiver for every watched computed execution method so unrelatedspawn/execSynccomputed calls do not over-capture.launch(+child_processanywhere) — rejected because it would flag unrelatedlaunch()functions wheneverchild_processappears elsewhere, the exact false-positive class the issue asks to avoid.AI Assistance
execreceiver lookup against the realscanSource()path; addressed ClawSweeper P1 by extending receiver provenance to all watched computed execution methods and adding negative regression coverage for unrelated computedspawn/execSync.Risks and Mitigations
collectChildProcessBindingsonly collects from import/require statements whose source string is literallychild_processornode:child_process, so an alias bound from another module is never attributed. A negative regression case (import { spawn as launch } from "./other-module") guards this.["exec"|"execSync"|"spawn"|... ](on any receiver, butisBenignMemberExecMatchsuppresses it unless the receiver is a proven namespace alias or a literalchild_processname — for EVERY watched method, not onlyexec. This preserves theRegExp.execexclusion and prevents unrelatedworker["spawn"]()/bus["execSync"]()from firing whenchild_processis merely present. Negative cases (re["exec"](value),worker["spawn"](task),bus["execSync"]("echo hi"),pool["spawn"](job)) guard this.