-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Option value truncated when it contains '=' characters #83882
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Severity: medium / Confidence: high / Category: bug
Triage: confirmed-bug
Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18)
Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol
Evidence
src/cli/root-option-value.ts:6-8(takeCliRootOptionValue)Reasoning
Array destructuring with
split("=", 2)limits the split result to 2 elements, so any characters after the second=in the raw token are silently discarded. For example,--token=abc=defyields value"abc"instead of"abc=def". API tokens and secrets frequently include base64-padding=characters; URLs with query parameters also contain=. The caller receives a silently corrupted value with no error or warning.Reproduction
Pass any root option whose value contains
=: e.g.openclaw --some-option=base64pad==. The resolved value will be"base64pad"instead of"base64pad==".Recommendation
Replace
raw.split("=", 2)with an index-based slice:This preserves all characters after the first
=.Why existing tests miss this
No tests are listed for src/cli/root-option-value.ts; the bug surface (option values with embedded
=) is easy to overlook.Suggested regression test
Add a Vitest test in a colocated
root-option-value.test.tsthat assertstakeCliRootOptionValue("--opt=abc=def", undefined).value === "abc=def"and likewise for base64 padding ("abc==").Minimum fix scope
Single-line change in src/cli/root-option-value.ts replacing
raw.split("=", 2)with index-slice logic.Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID:
fnd_sig-feat-cli-command-0c37e1d71a-_71ed7d37a6.