fix(ssh): reject NUL-containing command environments - #2573
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 26, 2026, 12:24 AM ET / 04:24 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch rejects NUL-containing SSH command environment values with a variable-name-only exit-2 error, adds rejection and large-value tests, and updates the documentation and changelog. Merge readiness⛔ Blocked before merge - 4 items remain Keep open. Current main still accepts NUL-containing values in the shared SSH command-environment staging path, and this focused fix is distinct from the earlier transport PR. Priority: P2 Review scores
Verification
How this fits togetherCrabbox selects environment values from run configuration and allowlists. The CLI stages command-scoped values through SSH stdin into a private file that the remote session loads before running a workload. flowchart LR
A[Selected command values] --> B[CLI SSH staging]
B --> C{Value contains NUL?}
C -->|Yes| D[Exit 2 with variable name]
C -->|No| E[Private stdin upload]
E --> F[Remote environment file]
F --> G[Workload]
Decision needed
Why: A native process cannot receive the intended value, but the new failure changes the behavior of existing saved configurations. Before merge
Findings
Agent review detailsSecurityNone. Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep validation at the shared command-staging boundary and document how to remove an invalid saved value when the name-only error appears. Do we have a high-confidence way to reproduce the issue? Yes, from source: a saved profile or preset value can reach the staging loop that lacks a NUL check on current main. The added direct regression test supplies that value; this read-only review did not execute it. Is this the best way to solve the issue? Yes for command-staged SSH values: checking the shared staging path before upload is narrow and preserves valid values. A saved-configuration CLI observation would better establish the user-facing failure. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 596d907ba514. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Reject values that native process environments cannot represent before uploading a private command-env file. Report only the variable name and retain valid large and multiline stdin payloads. Follow-up to #2556.
0d8cb9d to
ba1f939
Compare
The stdin-based SSH environment transport accepted NUL-containing strings from constructed/profile/preset environment values. Native process environments cannot represent NUL, so accepting the staged shell file can silently change the intended value.
Reject these values with exit code 2 before opening an SSH upload, and report only the validated variable name. Add regression coverage for early rejection with no SSH activity or value disclosure, plus an approximately 80 KiB multiline round trip to preserve valid large payloads.
Follow-up to #2556.
Validation:
TestSSHCommandEnvRejectsNULBeforeUploadfailed before the fix because staging returned no error. The focused env transport/allowlist race shard now passes, including the large value, cancellation/failure cleanup, PowerShell/WSL fixtures, and real OpenSSH stdin separation. Gofmt,go vet ./..., CLI build/invocation, and both docs checks passed. Codex autoreview is scoped-clean through P2. No cloud resources were created; native Windows/WSL2 live execution was unavailable and the coordinator owns the full remote suite.