Skip to content

fix(configure): mask gateway password input in CLI wizard prompt#90571

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
anurag-bg-neu:fix/mask-gateway-token
Jun 15, 2026
Merged

fix(configure): mask gateway password input in CLI wizard prompt#90571
vincentkoc merged 2 commits into
openclaw:mainfrom
anurag-bg-neu:fix/mask-gateway-token

Conversation

@anurag-bg-neu

@anurag-bg-neu anurag-bg-neu commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

What problem does this PR solve?
The openclaw configure --section gateway wizard echoes the typed Gateway password in cleartext on the terminal. This is reproducible on the latest published CLI with no special setup — anyone using documented onboarding steps over a shared screen, screen recording, pair-programming session, or office display can leak their gateway password.

Why does this matter now?
This is the same class of UX/security defect already fixed for onboarding-wizard token/credential inputs in #76693 — the gateway configure surface was missed by that PR. Closing the gap keeps interactive credential entry consistent across all OpenClaw configure flows.

What is the intended outcome?
The Gateway password prompt renders bullets (••••) instead of the typed characters. Persisted config shape, validation, and downstream auth behavior are unchanged.

What is intentionally out of scope?

What does success look like?
Running the published-CLI repro after this patch shows bullets where the screenshot below shows the cleartext password. No regression in the authMode === "password" config persistence path (existing unit test does not set password to literal 'undefined' when prompt returns undefined still passes).

What should reviewers focus on?

  • That the new password helper in configure.shared.ts matches the styling of the existing text/confirm/select wrappers.
  • That the local-variable rename (passwordpasswordInput) in configure.gateway.ts does not shadow the new imported helper.
  • That configure.gateway.test.ts's existing textQueue fixtures still feed the password branch via the new password mock.

Linked context

Which issue does this close?

None — this PR was authored from an audit of unmasked credential prompts, not in response to an open issue.

Which issues, PRs, or discussions are related?

Was this requested by a maintainer or owner?

No — found while auditing remaining unmasked credential prompts after #76693 merged.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: openclaw configure --section gateway echoes the Gateway password in cleartext.

  • Real environment tested: Windows 10 Home Single Language (build 19045.7291), PowerShell, OpenClaw 2026.6.1 (2e08f0f) for before-evidence (installed via the documented global installer npm install -g openclaw@latest); OpenClaw 2026.6.2 (861bf54) from this branch via pnpm openclaw configure --section gateway for after-evidence.

  • Exact steps or command run after this patch:

    1. git checkout fix/mask-gateway-token
    2. pnpm install && pnpm build
    3. pnpm openclaw configure --section gateway
    4. Answer prompts: bind=Loopback, access protection=Password, Tailscale=Off
    5. At Gateway password, type USING_DUMMY_PASSWORD
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output): fix_mask-gateway_token

  • Observed result after fix: characters render as bullets; persisted gateway.auth.password value is the typed string (validated end-to-end by openclaw configure printing Updated config: ~/.openclaw/openclaw.json).

  • What was not tested: macOS, Linux. The change touches cross-platform @clack/prompts code with no process.platform branching, so the fix applies on all three platforms. Verification on each is tracked as a separate atomic task — macOS: [verify] gateway password mask renders bullets on macOS (PR #90571) #90634; Linux: [verify] gateway password mask renders bullets on Linux (PR #90571) #90635.

  • Proof limitations or environment constraints: My machine is Windows-only. The fix path is platform-agnostic, but I cannot personally screenshot macOS/Linux output.

  • Before evidence (optional but encouraged): gateway_token_issue

Tests and validation

Which commands did you run?

pnpm build ; pnpm check ; pnpm test

pnpm install run first (fresh checkout). pnpm check — typecheck green; one pre-existing lint failure in extensions/slack/ (this PR's commits touch zero slack/plugin-sdk surface, per CONTRIBUTING.md:128-129). pnpm test — pre-existing Windows-only failures (POSIX-path, SQLite EBUSY, PTY tests) — none in this PR's files; configure.gateway.test.ts shard passes. Targeted regression: npx vitest run src/commands/configure.gateway.test.tsTest Files 1 passed (1) / Tests 11 passed (11). After commit fa3f5e8aa4: pnpm tsgo:core and pnpm test:changed — green (one pre-existing POSIX-path failure in src/crestodian/operations.test.ts, unrelated). Manual repro per the steps above.

What regression coverage was added or updated?

Updated mock setup in src/commands/configure.gateway.test.ts to register the new password helper. Existing assertions covering the password branch ('does not set password to literal "undefined"', Tailscale-funnel-requires-password) continue to pass unchanged, demonstrating that the masked prompt feeds the same persistence path. Added clackPassword: vi.fn() and password: mocks.clackPassword to the @clack/prompts mock in src/commands/configure.wizard.test.ts so the shared module import chain resolves correctly (commit fa3f5e8aa4).

What failed before this fix, if known?

No automated test failure — this is a UX/security defect not previously asserted. The proof is the live terminal capture.

If no test was added, why not?

A test was not added because automated tests cannot meaningfully assert "the TTY echoes bullets, not characters" — that requires a real terminal. The structural fix is the new password import; verifying it is correctly wired is exactly what the manual repro screenshots prove.

Risk checklist

Did user-visible behavior change? (Yes/No)

Yes — the Gateway password prompt now renders bullets instead of typed characters. No other visible UI changes.

Did config, environment, or migration behavior change? (Yes/No)

No — gateway.auth.password in openclaw.json is persisted unchanged. Backup file path unchanged. No migration.

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No)

Yes — masking the on-screen rendering of secret input. This is the intended security fix; no other auth/network behavior altered.

What is the highest-risk area?

Local-variable shadowing: I renamed const password (the local variable holding the answer) to passwordInput so it doesn't shadow the new imported password helper. If a reviewer prefers an alternative name (e.g., passwordAnswer), it's a one-token change.

How is that risk mitigated?

The new helper is named identically across the wizard surface (text, confirm, select, now password) so future credential prompts in configure.gateway.ts and siblings have an obvious masked counterpart and won't accidentally regress to text(...). The variable rename is mechanical and locally scoped.

Current review state

What is the next action?

Maintainer review.

What is still waiting on author, maintainer, CI, or external proof?

Which bot or reviewer comments were addressed?

ClawSweeper Codex review (2026-06-07, commit 3b067a65ab): P1 finding addressed in commit fa3f5e8aa4 — added clackPassword: vi.fn() to the vi.hoisted() mocks and password: mocks.clackPassword to the vi.mock("@clack/prompts", ...) block in src/commands/configure.wizard.test.ts. All targeted tests pass after the fix.


AI-assisted PR:

  • Mark as AI-assisted in the PR title or description
  • Include human-run real behavior proof from your own setup. AI-generated tests, mocks, lint, typechecks, and CI output are supplemental only; they do not prove the fix works for users.
  • Include prompts or session logs if possible (super helpful!)
  • Confirm you understand what the code does
  • If you have access to Codex, run codex review --base origin/main locally and address the findings before asking for review
  • Resolve or reply to bot review conversations after you address them

The `openclaw configure --section gateway` wizard echoed the typed
Gateway password in cleartext on the terminal. Switch the prompt from
clack's `text` to `password` (via a new styled `password` helper in
`configure.shared.ts`) so input renders as bullets. Persisted config
shape, validation, and downstream auth behavior unchanged.

Mirrors the masking discipline established by openclaw#76693 for onboarding
credential prompts. Sibling Gateway-token and models-auth paste-token
prompts will be addressed in separate PRs.
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 5, 2026
@clawsweeper

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 7, 2026, 6:16 AM ET / 10:16 UTC.

Summary
The PR adds a styled configure-wizard password wrapper, uses it for the Gateway password prompt, and updates configure test mocks for the new helper.

PR surface: Source +7, Tests +5. Total +12 across 4 files.

Reproducibility: yes. Source inspection of current origin/main shows openclaw configure --section gateway reaches promptGatewayConfig, and the password branch uses the plain configure text wrapper for Gateway password.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Manual visual proof is Windows-only; macOS and Linux checks are tracked separately, but the OpenClaw code path uses the shared @clack/prompts.password primitive without an OpenClaw platform branch.

Maintainer options:

  1. Decide the mitigation before merge
    Merge this narrow masking fix after the usual maintainer and CI gates, and keep sibling credential-prompt fixes in their separate PRs.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; no blocking review finding remains, so the next step is normal maintainer review and merge-gate validation.

Security
Cleared: The diff improves secret input rendering and does not add dependencies, workflow changes, broader permissions, or new secret storage paths.

Review details

Best possible solution:

Merge this narrow masking fix after the usual maintainer and CI gates, and keep sibling credential-prompt fixes in their separate PRs.

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

Yes. Source inspection of current origin/main shows openclaw configure --section gateway reaches promptGatewayConfig, and the password branch uses the plain configure text wrapper for Gateway password.

Is this the best way to solve the issue?

Yes. Adding a shared configure password wrapper and switching only the Gateway password prompt is the narrowest maintainable fix; stored password normalization and buildGatewayAuthConfig behavior remain unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 85840eb10e7f.

Label changes

Label justifications:

  • P2: The PR fixes a limited CLI credential-display leak in the configure wizard without changing stored config or runtime auth behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body includes after-fix Windows terminal screenshot proof showing the Gateway password prompt rendered as bullets and the configure flow completing.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix Windows terminal screenshot proof showing the Gateway password prompt rendered as bullets and the configure flow completing.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes after-fix Windows terminal screenshot proof showing the Gateway password prompt rendered as bullets and the configure flow completing.
Evidence reviewed

PR surface:

Source +7, Tests +5. Total +12 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 11 4 +7
Tests 2 5 0 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 16 4 +12

What I checked:

  • Current main still echoes through text prompt: On current origin/main, promptGatewayConfig imports only confirm, select, and text, and the authMode === "password" branch awaits text({ message: "Gateway password" }). (src/commands/configure.gateway.ts:249, 85840eb10e7f)
  • PR merge result masks the password prompt: The synthetic merge result for this PR changes the password branch to call password({ message: "Gateway password", validate: validateGatewayPasswordInput }). (src/commands/configure.gateway.ts:249, abed70c6afee)
  • Shared wrapper follows existing configure prompt style: The PR adds a configure shared password wrapper that delegates to clackPassword and applies the same styled message transform as the existing text wrapper. (src/commands/configure.shared.ts:93, abed70c6afee)
  • Config persistence path remains unchanged: The downstream gateway auth builder still receives a password string and stores password auth only when the trimmed value is present; the PR changes input rendering, not config shape. (src/commands/configure.gateway-auth.ts:186, 85840eb10e7f)
  • Sibling credential masking pattern exists: The onboarding wizard already routes sensitive text prompts through @clack/prompts.password, matching the direction this PR applies to the configure gateway password prompt. (src/wizard/clack-prompter.ts:131, 85840eb10e7f)
  • Dependency contract checked: @clack/[email protected] exports password(opts: PasswordOptions) and documents that the password prompt behaves like text input with masked input; its options include message, mask, validate, and clearOnError.

Likely related people:

  • anurag-bg-neu: Authored the merged predecessor that added sensitive prompt plumbing for onboarding credential inputs, which is the closest established pattern for this PR. (role: credential-masking contributor; confidence: high; commits: 727398f41a85, a3db64c265e6; files: src/wizard/clack-prompter.ts, src/wizard/setup.gateway-config.ts, src/commands/onboard-remote.ts)
  • Peter Steinberger: Git history shows repeated gateway configure and prompt/refactor work around the affected command surface. (role: gateway/configure area contributor; confidence: medium; commits: 9fb131e5feae, 63e00b811e74, 53d10f8688b4; files: src/commands/configure.gateway.ts, src/commands/configure.wizard.ts, src/wizard/setup.gateway-config.ts)
  • Christine Yan: Current-main blame/log in this checkout points the latest configure gateway and wizard prompt surfaces to a recent commit touching the relevant files. (role: recent area contributor; confidence: medium; commits: 22276e6de0b7; files: src/commands/configure.gateway.ts, src/commands/configure.shared.ts, src/wizard/clack-prompter.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jun 5, 2026
@anurag-bg-neu
anurag-bg-neu marked this pull request as ready for review June 5, 2026 06:48
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 7, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 7, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 7, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 15, 2026
@vincentkoc vincentkoc self-assigned this Jun 15, 2026
@vincentkoc
vincentkoc merged commit 865e4db into openclaw:main Jun 15, 2026
258 of 275 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 16, 2026
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants