fix: bind package-manager exec approvals to inner commands [AI]#102035
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 8, 2026, 9:46 AM ET / 13:46 UTC. Summary PR surface: Source +390, Tests +1029. Total +1419 across 10 files. Reproducibility: Source-reproducible: current main only has package-manager unwrapping in node-host mutable operand binding, while the PR adds infra-level allowlist and persistence retargeting with regression tests for stale wrapper approval reuse. I did not execute the repro because this review is read-only. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land only after exact-head terminal/live proof demonstrates stale wrapper denial plus safe inner-executable reuse, and a security-boundary owner accepts the intentional re-prompt compatibility impact. Do we have a high-confidence way to reproduce the issue? Source-reproducible: current main only has package-manager unwrapping in node-host mutable operand binding, while the PR adds infra-level allowlist and persistence retargeting with regression tests for stale wrapper approval reuse. I did not execute the repro because this review is read-only. Is this the best way to solve the issue? Unclear as merge-ready, but the code location is plausible: sharing the package-manager parser between infra allowlist evaluation and node-host binding is better than keeping duplicate parsers. The remaining blocker is exact-head proof plus maintainer acceptance of the compatibility/security tradeoff. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 64015e71dd5a. Label changesLabel justifications:
Evidence reviewedPR surface: Source +390, Tests +1029. Total +1419 across 10 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (21 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
ClawSweeper proof for current head Behavior proved: package-manager Environment and production path: local PR checkout at the current head, exercising OpenClaw's production approval-flow adapter functions ( Command/artifact evidence:
Evidence:
Validation status for this head: GHSA dry-run passed with ACCEPT/SOLVES/BC PASS; review-pr passed with no blocker or important findings; Claude autoreview passed with no accepted/actionable findings; focused local validation passed including Compatibility/operator note: this intentionally tightens stale outer package-manager wrapper approvals for delegated exec forms. Existing stale wrapper entries may prompt again, but the stored approval schema is unchanged and the replacement durable approval is for the actual inner executable that will be reused. Script-runner forms such as npm/pnpm/yarn Live gaps: I did not run a full live Gateway WebSocket approval transcript because no approved live setup or credentialed user environment is available in this orchestrator session. I inspected available package scripts for e2e/live/docker/qa/gateway harnesses; there is no targeted approval-flow live harness for this boundary, so this proof uses the nearest production adapter and the PR's CI/local validation. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
ClawSweeper proof for current head Behavior proved: package-manager Security boundary and protected sink: durable Production path exercised: OpenClaw approval-flow adapter functions Dependency contract checked before relying on local proof: Positive controls:
Denied exploit controls:
Protected sink result: all denied exploit controls stop at the approval boundary and require a fresh user approval, so Exact local commands already run for this head:
Current-head proof output: {
"head": "aba88fec0e3fed801884b7d2cdfae9677c40ca25",
"protectedBoundary": "durable exec approval allowlist before node-host subprocess launch",
"positiveControls": [
{
"command": "pnpm exec -- tsx ./run.ts",
"persisted": "inner tsx",
"reused": true
},
{
"command": "pnpm -C ./package exec -- tsx ./run.ts",
"persisted": "inner tsx",
"reused": true
},
{
"command": "yarn exec -- tsx ./run.ts",
"reused": true
}
],
"deniedExploitControls": [
{
"command": "pnpm exec sh -c 'id > marker'",
"allowlistSatisfied": false,
"requiresFreshApproval": true
},
{
"command": "pnpm -C ./package eslint .",
"allowlistSatisfied": false,
"requiresFreshApproval": true
},
{
"command": "yarn run eslint .",
"allowlistSatisfied": false,
"requiresFreshApproval": true
},
{
"command": "yarn eslint .",
"allowlistSatisfied": false,
"requiresFreshApproval": true
}
],
"oneShotControls": [
{
"command": "pnpm exec -- npm x sh -c 'echo warmup-ok'",
"persistence": "one-shot"
}
],
"liveEnvironmentGaps": "No external provider/native client needed; proof uses production approval-flow adapters with real temporary executable files and stops before launching subprocesses."
} |
|
@clawsweeper re-review |
2 similar comments
|
@clawsweeper re-review |
|
@clawsweeper re-review |
…claw#102035) * fix: bind package-manager exec approvals to inner commands * fix: fail closed package manager exec approval gaps * chore: refresh pr branch metadata * fix: cover npm exec alias approvals * fix: fail closed hidden package manager exec aliases * fix: unwrap chained package manager approvals * fix: cover yarn package manager approvals * fix: preserve yarn run approval compatibility * fix: bind package manager script argv checks * test: fix package manager script argv type check * fix: fail closed pnpm shorthand approvals * fix: preserve pnpm built-in approvals * fix: preserve pnpm script shortcuts * fix: preserve npm cwd exec unwrapping * fix: fail closed cwd and yarn package shorthands
…claw#102035) * fix: bind package-manager exec approvals to inner commands * fix: fail closed package manager exec approval gaps * chore: refresh pr branch metadata * fix: cover npm exec alias approvals * fix: fail closed hidden package manager exec aliases * fix: unwrap chained package manager approvals * fix: cover yarn package manager approvals * fix: preserve yarn run approval compatibility * fix: bind package manager script argv checks * test: fix package manager script argv type check * fix: fail closed pnpm shorthand approvals * fix: preserve pnpm built-in approvals * fix: preserve pnpm script shortcuts * fix: preserve npm cwd exec unwrapping * fix: fail closed cwd and yarn package shorthands
…claw#102035) * fix: bind package-manager exec approvals to inner commands * fix: fail closed package manager exec approval gaps * chore: refresh pr branch metadata * fix: cover npm exec alias approvals * fix: fail closed hidden package manager exec aliases * fix: unwrap chained package manager approvals * fix: cover yarn package manager approvals * fix: preserve yarn run approval compatibility * fix: bind package manager script argv checks * test: fix package manager script argv type check * fix: fail closed pnpm shorthand approvals * fix: preserve pnpm built-in approvals * fix: preserve pnpm script shortcuts * fix: preserve npm cwd exec unwrapping * fix: fail closed cwd and yarn package shorthands (cherry picked from commit 534ace4)
What Problem This Solves
Fixes an issue where operators who approve a package-manager wrapped exec command as always allowed could have that durable approval apply to the wrapper command instead of the effective command being launched.
Why This Change Was Made
Package-manager exec wrappers now share the same dispatch-wrapper trust planning used by other command carriers, so supported direct forms bind approval policy to the inner command. Shell-call package-manager forms stay one-shot instead of creating reusable
allow-alwayspatterns.This change is AI-assisted.
User Impact
Operators can continue using common package-manager exec forms for direct local tools, while durable approvals no longer broaden trust to later wrapped shell payloads. Existing node-host mutable operand binding keeps the same behavior by reusing the shared package-manager wrapper parser.
Evidence
node scripts/run-vitest.mjs src/infra/exec-wrapper-trust-plan.test.ts src/infra/exec-allow-always-persistence.test.ts src/infra/exec-approvals-allow-always.test.ts src/node-host/invoke-system-run-plan.test.ts