Skip to content

fix(exec): require approval for legacy arithmetic arguments - #187653

Merged
pgondhi987 merged 4 commits into
openclaw:mainfrom
pgondhi987:fix/fix-1148
Oct 30, 2026
Merged

pgondhi987 merged 4 commits into
openclaw:mainfrom
pgondhi987:fix/fix-1148

Conversation

@pgondhi987

@pgondhi987 pgondhi987 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: exec allowlist evaluation could automatically accept legacy Bash arithmetic arguments even though equivalent modern arithmetic already requires approval.

User Impact

User impact: $[...] arguments now follow the existing approval policy for dynamic shell arguments. Ordinary literal builtin commands continue to run under the same settings.

Why This Change Was Made

The command explainer already identifies these arguments as dynamic. This adds the missing arithmetic form to the authorization planner's existing expansion check. No new policy owner or configuration is introduced.

Evidence

  • Reviewed head: e9fe4f14b4c8a88531446c9fbfe5716fae85ab80.
  • Linux/Bash gateway execution proof uses the production exec tool, authorization planner, shell preparation, and real process supervisor with synthetic policy and isolated temporary state. The literal control : benign; pwd completes with one process launch. Encoded legacy and modern arithmetic commands are rejected before process launch, with zero launches and no marker-file side effect.
  • The new gateway regression fails on the original base because the legacy arithmetic command completes instead of requiring approval; it passes with the fix. The new legacy-arithmetic policy cases also fail on base and pass with the fix.
  • Focused command: pnpm test src/infra/exec-safe-builtins.test.ts src/infra/exec-authorization-plan.test.ts src/infra/exec-authorization-render.test.ts src/infra/exec-authorization-allowlist.test.ts src/infra/exec-allow-always-persistence.test.ts src/infra/exec-approvals-safe-bins.test.ts src/node-host/invoke-system-run-allowlist.test.ts src/agents/bash-tools.exec-authorization.integration.test.ts --maxWorkers=1.
  • Eight files passed: 113 tests passed and 3 platform/optional-shell tests skipped; total focused command wall time 96.61 seconds.
  • Focused formatting, repository-supported focused lint, and git diff --check pass. Test-line and line-cap ratchets pass against the original branch base.
  • The separate local typecheck could not run: its declaration wrapper refuses the borrowed dependency installation. Canonical PR CI check-prod-types, check-test-types, and all five check-test-types-core-* jobs passed at this head. Tests and formatting/lint ran without modifying the shared installation.
  • Proof is local and isolated; no live external Gateway, channel, or model was used. The gateway boundary suite initially completed in 34.14 seconds wall time (23.84 seconds test-run duration); CI groups these files into broader shards, so isolated per-file CI timing is not available.
  • Simplification retained a single expansion check and existing test fixtures: production +3/-1 lines, regression tests +36 lines. The separate test-line allocation covers exactly those 36 new regression lines, with the shared baseline unchanged.

Standalone execution receipt

Command: repository-pinned bun .local/gateway-runtime-proof.ts, using Bun revision 1.4.4-canary.1+191755ec1 (the Node-compatible API reports v26.12.1); exit status 0. This standalone local harness runs outside Vitest. It seeds synthetic approval policy through the production maintenance API, calls the production createExecTool, and counts supervisor launches while delegating to the real process supervisor. It uses no Gateway or process mock. Only the observed scalar results below are captured; no inherited environment or credentials are logged.

OPENCLAW_RUNTIME_PROOF {
  "head": "e9fe4f14b4c8a88531446c9fbfe5716fae85ab80",
  "runtime": {
    "os": "linux",
    "node": "v26.12.1",
    "shell": "bash"
  },
  "route": "gateway exec tool -> authorization -> shell preparation -> real process supervisor",
  "policy": {
    "security": "allowlist",
    "ask": "off",
    "askFallback": "deny",
    "allowlistEntries": 0
  },
  "literalControl": {
    "status": "completed",
    "exitCode": 0,
    "expectedWorkingDirectory": true,
    "processLaunches": 1
  },
  "legacyArithmetic": {
    "status": "denied",
    "error": "exec denied: allowlist miss",
    "processLaunches": 0,
    "markerExists": false
  },
  "modernArithmetic": {
    "status": "denied",
    "error": "exec denied: allowlist miss",
    "processLaunches": 0,
    "markerExists": false
  }
}

Node-host system.run entry-point receipt

Command: repository-pinned bun .local/node-host-runtime-proof.ts; exit status 0. This invokes the shipped handleSystemRunInvoke entry point with a prepared synthetic runtime config and an empty executable allowlist. Its command-runner callback delegates to the production runCommand, so the allowed control executes real Bash. The two denied requests never call that runner. The receipt captures actual responses and marker checks; transport callbacks collect replies locally. No live external Gateway or model is used.

OPENCLAW_NODE_RUNTIME_PROOF {
  "head": "e9fe4f14b4c8a88531446c9fbfe5716fae85ab80",
  "route": "shipped node-host system.run handler -> authorization -> production command runner -> Bash",
  "runtime": {
    "os": "linux",
    "bun": "1.4.4",
    "nodeApi": "v26.12.1"
  },
  "policy": {
    "security": "allowlist",
    "ask": "on-miss",
    "askFallback": "deny",
    "allowlistEntries": 0
  },
  "literalControl": {
    "ok": true,
    "exitCode": 0,
    "expectedWorkingDirectory": true,
    "commandRunnerCalls": 1
  },
  "legacyArithmetic": {
    "ok": false,
    "error": {
      "code": "SYSTEM_RUN_DENIED",
      "message": "SYSTEM_RUN_DENIED: approval required"
    },
    "commandRunnerCalls": 0,
    "markerExists": false
  },
  "modernArithmetic": {
    "ok": false,
    "error": {
      "code": "SYSTEM_RUN_DENIED",
      "message": "SYSTEM_RUN_DENIED: approval required"
    },
    "commandRunnerCalls": 0,
    "markerExists": false
  }
}

Main CI run 40875371853 completed successfully for this exact head, including production/test types, lint, changed-path tests, and baseline checks.

Bash re-evaluates the text of a `$[...]` arithmetic expansion, so an array
subscript rebuilt from ANSI-C numeric escapes can run command substitution
even though no literal `$(` appears in the source. The shell authorization
plan already blocked `$((...))` dynamic arguments but its expansion pattern
missed the legacy `$[` form, so quoted `"$[...]"` operands on safe builtins
such as `:` and `cd` were auto-allowed and executed unchanged.

Treat `$[` like the other runtime shell expansions so these commands fall
back to approval.
@clawsweeper

clawsweeper Bot commented Oct 29, 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 agents Agent runtime and tooling size: XS labels Oct 29, 2026
@pgondhi987

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Require legacy Bash arithmetic arguments to follow the existing approval policy for dynamic shell arguments.

Example: Run : "$[1+1]" with allowlist security, approvals disabled, and an empty executable allowlist.

  • Before: The arithmetic operand can pass through automatic safe-builtin authorization.
  • After: Execution is denied as an allowlist miss, matching modern arithmetic handling.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with production-path execution receipts and passing exact-head CI; proof uses isolated in-process entry points.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Exact-head standalone Linux/Bash receipts exercise the production exec tool and shipped node-host handler with synthetic policy and real process runners: literal builtins complete, while encoded legacy and modern arithmetic are denied before runner invocation with no marker side effect; the change creates no retained authority and leaves existing launch-time revalidation intact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An unapproved shell command can gain side effects through legacy arithmetic operands on automatically trusted builtins.
Reason: The patch restores the existing approval contract for a concrete bypass while preserving ordinary literal builtins and adding no configuration or public API.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current approval bypass with a minimal change at the shared authorization owner; no actionable introduced defects remain.

Priority: P1
Reviewed head: e9fe4f14b4c8a88531446c9fbfe5716fae85ab80

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway exec and node-host system.run pass shell commands through the command explainer and shared authorization planner before approval evaluation and process launch.

flowchart LR
A[Shell command] --> B[Command explainer]
B --> C[Authorization planner]
C --> D[Host approval policy]
D --> E[Denied before launch]
D --> F[Authorized process execution]
Loading

Technical review

Best possible solution:

Land the existing shared-planner repair with its policy and pre-launch regressions.

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

Current-main source shows arithmetic risks reaching a matcher that misses legacy syntax, and the contributor reports the new gateway regression failing on the original base because the command executes; this read-only review ran no target code.

Is this the best way to solve the issue?

The defect is missing legacy-expansion recognition, the invariant is that runtime shell expansion cannot inherit harmless-builtin trust, and extending the existing classifier is the smallest complete repair.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Dynamic shell argument authorization keeps the original intent (c9707ab: Use one Tree-sitter-backed command plan for authorization, persistence, and rewriting while retaining approval gates for dynamic payloads.)
  • Automatic safe-builtin authorization keeps the original intent (fix(exec): allow known safe shell builtins in allowlist mode #79363: Avoid prompts for harmless builtin segments without granting unrestricted trust to executable shell behavior.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jesse Merhi: Raw commit c9707ab adds src/infra/exec-authorization-plan.ts:220 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c9707ab635b9; files: src/infra/exec-authorization-plan.ts)
  • Peter Steinberger: Raw commit 70fe5d7 adds src/agents/bash-tools.exec-authorization.integration.test.ts:114 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 70fe5d707523; files: src/agents/bash-tools.exec-authorization.integration.test.ts)
  • Pavan Kumar Gondhi: Raw commit 2628fae adds src/infra/exec-authorization-plan.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 2628fae0da46; files: src/infra/exec-authorization-plan.ts)

PR surface

Source +2, Tests +36, Other +2. Total +40 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 2 36 0 +36
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 4 41 1 +40

Review metrics

Metric Value Why it matters
Production versus regression growth Production +3/-1 lines; tests +36 lines Growth is justified by the existing classifier repair, policy coverage, and a distinct real-process pre-launch boundary regression.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Encoded legacy arithmetic can execute shell side effects without the approval required by allowlist policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • 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 (3 earlier review cycles)
  • reviewed 2026-10-29T12:52:59.842Z sha e9fe4f1 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-29T13:04:26.302Z sha e9fe4f1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-29T13:16:17.052Z sha e9fe4f1 :: needs maintainer review before merge. :: none

Reviewed October 29, 2026, 10:21 AM ET / 14:21 UTC (Revision 4).

@pgondhi987

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 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. labels Oct 29, 2026
@pgondhi987

pgondhi987 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper review

Reviewed October 29, 2026, 1:14 PM UTC.

What this changes

This PR makes legacy Bash $[...] arithmetic arguments use the existing dynamic-argument approval gate and adds policy and pre-launch regressions.

PR surface: Source +2, Tests +36, Config +2. Total +40 across 4 files.

Merge readiness

Result: ready for maintainer review.

Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster

Reviewed head: e9fe4f14b4c8

Review scores

  • Overall: 🦞 diamond lobster
  • Proof: 🦞 diamond lobster (sufficient)
  • Patch quality: 🦞 diamond lobster
  • Security: cleared

Verification

Status: sufficient

How this fits together

The command explainer emits dynamic-argument risks, and the shared authorization planner turns them into decisions consumed by Gateway exec and node-host system.run before process launch.

flowchart LR
A[Shell command] --> B[Command explainer]
B --> C[Dynamic argument risk]
C --> D[Authorization planner]
D --> E[Approval policy]
E -->|denied| F[No process launch]
E -->|allowed| G[Process supervisor]
Loading

Before merge

  • None from local ClawSweeper.
Review details

Best possible solution:

Merge the one-owner planner check with its policy and real-process pre-launch regressions after ordinary exact-head checks complete.

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

Yes: current main omits $[ from the classifier, the parser supplies the original dynamic argument text to that classifier, and the reported base regressions launch the crafted command before the fix.

Is this the best way to solve the issue?

Yes: extending the existing expansion classifier is the smallest complete fix and preserves the planner as the sole authorization owner without adding configuration, state, wrappers, or alternate paths.

AGENTS.md: found_applied

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

Label details

Label justifications:

  • P1: A crafted dynamic Bash argument can bypass the expected approval decision and reach process launch.
  • merge-risk: 🚨 security-boundary: The diff changes which shell arguments may execute automatically under allowlist policy.
Evidence reviewed

PR surface:

Area Files Added Removed Net
Source 1 3 1 +2
Tests 2 36 0 +36
Docs 0 0 0 +0
Config 1 2 0 +2
Generated 0 0 0 +0
Other 0 0 0 +0
Total 4 41 1 +40
  • Owning fix: The PR extends the existing dynamic shell-expansion classifier to legacy $[ without adding another policy owner.
    • repo: openclaw/openclaw
    • file: src/infra/exec-authorization-plan.ts:204
    • command: git diff --no-ext-diff --no-textconv --no-renames 00125bb5bbc0bb8e9fb91ee39e6420132041b90e e9fe4f14b4c8a88531446c9fbfe5716fae85ab80 -- src/infra/exec-authorization-plan.ts
    • sha: e9fe4f14b4c8
  • Final-effect regression: The integration test runs a literal safe-builtin control through the real supervisor and verifies crafted arithmetic requests cause zero supervisor calls and no marker side effect.
  • Parser contract: The command explainer records parser-discovered dynamic arguments with their original text, which is the field classified by the planner.
  • Current-main gap: Fetched main still has the expansion pattern without $[, so the central repair is not already implemented upstream.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Behavior proof for exact head e9fe4f14b4c8a88531446c9fbfe5716fae85ab80:

The isolated Linux/Bash gateway exec-tool regression and standalone runtime harness exercise the production authorization planner, shell preparation, and real process supervisor. With an empty allowlist and approval fallback set to deny, the literal control : benign; pwd completed with one process launch and the expected working directory. Encoded legacy and modern arithmetic operands were rejected before the process runner, with zero launches and no marker-file side effect. Replaying the new regression on the original base failed because the legacy arithmetic command completed; the fixed head passes.

The standalone command bun .local/gateway-runtime-proof.ts used repository-pinned Bun revision 1.4.4-canary.1+191755ec1, ran outside Vitest without Gateway or process mocks, and exited 0. The complete sanitized OPENCLAW_RUNTIME_PROOF terminal receipt is included in the PR body.

pnpm test src/infra/exec-safe-builtins.test.ts src/infra/exec-authorization-plan.test.ts src/infra/exec-authorization-render.test.ts src/infra/exec-authorization-allowlist.test.ts src/infra/exec-allow-always-persistence.test.ts src/infra/exec-approvals-safe-bins.test.ts src/node-host/invoke-system-run-allowlist.test.ts src/agents/bash-tools.exec-authorization.integration.test.ts --maxWorkers=1: eight files passed, 113 tests passed, three platform/optional-shell skips, 96.61 seconds total wall time. Focused formatting, focused lint, test-line and line-cap ratchets, and diff checks passed.

This proof used synthetic configuration and temporary state. No live external Gateway, channel, or model was used. The separate local typecheck was unavailable because its declaration wrapper rejects the borrowed dependency installation; canonical PR CI production and test typecheck jobs passed for this exact head.

The shipped node-host system.run entry point was also invoked with synthetic prepared config and the production command runner: the literal control completed with one runner call, and both encoded arithmetic forms returned SYSTEM_RUN_DENIED: approval required, with zero runner calls and no marker files. The sanitized OPENCLAW_NODE_RUNTIME_PROOF receipt is in the PR body.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Verification before merge: exact head e9fe4f14b4c8a88531446c9fbfe5716fae85ab80.

  • Legacy Bash arithmetic arguments now follow the existing dynamic-argument approval policy. Literal builtins remain usable. The change stays at the shared authorization owner; no new configuration or persistence format is introduced.
  • Linux/Bash production exec and shipped node-host system.run receipts passed using repository-pinned Bun 1.4.4-canary.1+191755ec1 with synthetic policy and isolated state. The literal control completed with one launch/runner call; both encoded arithmetic forms were denied before the protected runner, with zero denied runner calls and no marker file. No live external Gateway, channel, or model was used.
  • Commands bun .local/gateway-runtime-proof.ts and bun .local/node-host-runtime-proof.ts exited 0; sanitized terminal receipts are in the PR body. The base replay of the new gateway regression failed because the unauthorized legacy arithmetic command completed; the fixed head passed.
  • pnpm test src/infra/exec-safe-builtins.test.ts src/infra/exec-authorization-plan.test.ts src/infra/exec-authorization-render.test.ts src/infra/exec-authorization-allowlist.test.ts src/infra/exec-allow-always-persistence.test.ts src/infra/exec-approvals-safe-bins.test.ts src/node-host/invoke-system-run-allowlist.test.ts src/agents/bash-tools.exec-authorization.integration.test.ts --maxWorkers=1: eight files passed, 113 tests passed, three platform/optional-shell skips, 96.61 seconds wall time. Focused formatting, focused lint, test-line/file-size checks, and diff checks passed.
  • Remote ClawSweeper rated this commit Platinum. The final canonical local review rated overall/proof/patch Diamond, cleared security, and reported no findings, structured risks, or outstanding maintainer decision. Optional review-pr and autoreview were disabled.
  • Main CI run 40875371853 passed, including production and test typechecks. The final snapshot has 72 successful, 119 skipped, one neutral, zero failed and zero pending checks; one historical cancelled auto-response job has successful replacements. GitHub reports MERGEABLE/CLEAN. Local standalone typechecking was unavailable because the declaration wrapper rejects the borrowed installation; canonical CI covers it.
  • Delivery checks passed for this unchanged candidate. Regression risk is limited to the intentional requirement for approval on legacy arithmetic arguments, matching the existing behavior for modern arithmetic. This is the smallest complete fix at the existing policy owner.

The PR has not been merged.

@clawsweeper clawsweeper Bot removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
Keep the main branch risk-classifier extraction and move the legacy arithmetic expansion check into exec-authorization-risks.ts. Retain both arithmetic and recursive-assignment execution regressions.

Gateway and node-host production execution proofs pass on the resolved source: literal controls execute; legacy and modern arithmetic are denied before process launch. Focused lint, formatting, diff checks, and test/file line ratchets pass. The planner suite passed 19 tests; remaining Vitest execution is blocked by ENOSPC during runtime-worker compilation. Previous green PR CI: run 40875371853 at e9fe4f1; current-head CI must run after push.
@pgondhi987
pgondhi987 merged commit 3f34977 into openclaw:main Oct 30, 2026
14 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…#187653)

* fix(exec): gate legacy $[...] arithmetic arguments in allowlist mode

Bash re-evaluates the text of a `$[...]` arithmetic expansion, so an array
subscript rebuilt from ANSI-C numeric escapes can run command substitution
even though no literal `$(` appears in the source. The shell authorization
plan already blocked `$((...))` dynamic arguments but its expansion pattern
missed the legacy `$[` form, so quoted `"$[...]"` operands on safe builtins
such as `:` and `cd` were auto-allowed and executed unchanged.

Treat `$[` like the other runtime shell expansions so these commands fall
back to approval.

* test(exec): verify arithmetic arguments stop before process launch
amittell pushed a commit to amittell/openclaw that referenced this pull request Nov 16, 2026
…#187653)

* fix(exec): gate legacy $[...] arithmetic arguments in allowlist mode

Bash re-evaluates the text of a `$[...]` arithmetic expansion, so an array
subscript rebuilt from ANSI-C numeric escapes can run command substitution
even though no literal `$(` appears in the source. The shell authorization
plan already blocked `$((...))` dynamic arguments but its expansion pattern
missed the legacy `$[` form, so quoted `"$[...]"` operands on safe builtins
such as `:` and `cd` were auto-allowed and executed unchanged.

Treat `$[` like the other runtime shell expansions so these commands fall
back to approval.

* test(exec): verify arithmetic arguments stop before process launch

(cherry picked from commit 3f34977)
amittell added a commit to amittell/openclaw that referenced this pull request Nov 16, 2026
Alex, room openclaw#620. Of the 72 11.3..11.4 commits the census counted as
production changes, six main fixes are ported: openclaw#187499, openclaw#187653, openclaw#188023,
openclaw#195400, openclaw#196297 and openclaw#197960. PORTING-NOTES.md, "The 72 11.4 repairs
reviewed against the carry", records each deferral with its reason, the two
UNSURE outcomes, and the M4 qualification.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Backport #187653 into the existing release authorization planner.
Source: 3f34977.

Co-authored-by: Pavan Kumar Gondhi <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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