Skip to content

fix(app-restart): mask quoted secrets with spaces whole; add Pwd and Credential (follow-up to #403) - #406

Merged
MendixMau merged 3 commits into
masterfrom
fix/app-restart-mask-quoted
Oct 16, 2026
Merged

MendixMau merged 3 commits into
masterfrom
fix/app-restart-mask-quoted

Conversation

@MendixMau

@MendixMau MendixMau commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #403.

Direct lane (changes to project-bin/)

What changed and why: #403 review found that a quoted secret with spaces still showed everything after its first word, for --constant "Mod.ApiKey=two words" and --db-password 'two words' (the quoted-flag case leaked before #403 too). mask() in project-bin/app-restart.sh now masks each argument before quoting it for display, so the whole quoted value goes. Pwd and Credential join the secret words (Passphrase and ClientSecret were already covered by Pass and Secret). An env assignment at the start of a --cmd string (DB_PASSWORD=x ./mxcli run ...) keeps the whole command visible, only the value masked, also on the refusal message. Display path only: the executed argv is untouched, and a real-launch test proves the started app receives the raw argv (a stub app records its argv). Known over-mask kept, not widened: the word match is a substring, so Monkey (Key) and Turkey mask too; a new test pins it.

Impact

Row Answer
Process none. No human step or gate added.
Dependencies project-bin/app-restart.sh, tests/wave2/test-app-restart.sh, CHANGELOG.md. No shared helper touched; independent of other open PRs. No new tools.
Context cost none: no routed or always-loaded file touched.
Behaviour n/a: scripts only.
Runtime measured on macOS, 12-argument argv, per mask() call including bash start: master about 53 ms, first version of this PR about 590 ms, now about 56 ms (sed forks only for arguments holding a secret word, found by a bash glob). Once per restart.

Categorisation: kind: fix; lane: Direct; size: small (3 files); regression risk: low (display only); toolkit: mxcli-project-toolkit.

Field evidence: found in review of #403 (reviews/403.md); the leaking inputs were reproduced against master's mask().

  • No client data anywhere in the diff
  • Size cap respected
  • Test tier: T1. tests/wave2/test-app-restart.sh PASS=96 FAIL=0 on the branch (macOS, no-op setsid shim on PATH). The new cases run against master's mask() give PASS=88 FAIL=8.
  • CHANGELOG.md line appended, credited

Remaining known leak: a secret whose name has no secret word (e.g. Mod.Salt=x), and a value containing an embedded quote character inside a quoted secret.

🤖 Generated with Claude Code

MendixMau and others added 3 commits October 16, 2026 09:26
…Credential to the secret words

Follow-up to #403. Each argument is masked before it is quoted for display; the executed argv is untouched (tested).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… forks, real-launch argv test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@MendixMau
MendixMau merged commit d1cbd41 into master Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant