Repository navigation
fix: redact denied exec failure params - #85140
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection shows current main can throw an exec allowlist miss and then log serialized PR rating 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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the targeted adapter-level sanitizer after maintainer/security acceptance of the logging tradeoff and use the linked issue as the canonical closure target once merged or shipped. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main can throw an exec allowlist miss and then log serialized Is this the best way to solve the issue? Yes, pending maintainer acceptance of the diagnostic tradeoff. Sanitizing at the adapter failure-log boundary is narrow, covers normalized exec/bash aliases and malformed params, and leaves non-exec failure logging unchanged. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4faeb378ee49. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Cosmic Signal Puff Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
* fix exec failure log redaction * docs: add exec redaction changelog * test: satisfy redaction lint
* fix exec failure log redaction * docs: add exec redaction changelog * test: satisfy redaction lint
* fix exec failure log redaction * docs: add exec redaction changelog * test: satisfy redaction lint
* fix exec failure log redaction * docs: add exec redaction changelog * test: satisfy redaction lint
Summary
execfailures logged rawraw_params, which could include shell commands and inline credentials.execfailure params before formatting failure logs, omitting command text and env values while retaining safe metadata.exec/bashfailure logging now summarizescommand/cmd, omits env values, handles JSON-string and malformed exec params, and adds escaped env-assignment redaction as defense in depth.Motivation
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
exectool failures still produce a useful failure log, but do not write raw command text or env values containing credentials.provider=aws, leasecbx_d7bedb291d7a, runrun_46e34297e3b5.execcall with fake inline command credentials and fake env credentials, then inspected stderr, the OpenClaw file log, and tool result output.gatewayErrContainsOmittedCommand=true,gatewayErrContainsOmittedEnv=true,fileLogContainsOmittedCommand=true,fileLogContainsOmittedEnv=true, and all fake-token/export checks false.raw_params={"command":{"omitted":true,...},"env":{"...":"[omitted exec env value]"},"timeout":5}with no fake token values and noexport XAI_API_KEYtext in combined proof output.run_232c08c997df, leasecbx_1e896a6cf0f1, reproduced current-main leakage where denied execraw_paramscontained the fake XAI and Brave token strings in stderr and file logs.Root Cause (if applicable)
src/agents/pi-tool-definition-adapter.tsformatted failed toolraw_paramsbefore applying any exec-specific command/env omission, so denied exec errors could serialize raw command input into stderr and file logs.Regression Test Plan (if applicable)
src/agents/pi-tool-definition-adapter.logging.test.ts,src/logging/redact.test.ts, plus AWS Crabbox repro proof.exec/bashlogs omit rawcommand/cmdand env values for object, JSON-string, and malformed params.User-visible / Behavior Changes
Failed
execlogs no longer include raw command text or env values. They now include safe command metadata and env key names for correlation/debugging.Diagram (if applicable)
N/A
Security Impact (required)
Yes, explain risk + mitigation: this reduces log exposure for command/tool execution failures by omitting command text and env values before log formatting. The tradeoff is less raw diagnostic detail for failed exec calls; retained metadata includes type, length, short hash, env keys, and non-sensitive fields such as timeout.Repro + Verification
Environment
host=gateway,security=allowlist,ask=off, empty safe binsSteps
Expected
Denied exec failure is visible, but raw command text and env values are absent from logs.
Actual
AWS Crabbox proof passed with omitted command/env markers present and fake-token/export checks false.
Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
bashalias normalized toexec, andcmdpayload alias.Review Conversations
Compatibility / Migration
Risks and Mitigations
type,chars, shortsha256), env key names, and non-sensitive fields so repeated failures remain correlatable without exposing secrets.