Skip to content

fix: credential follow-ups from the log redaction - #885

Merged
EVWorth merged 5 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h
Oct 24, 2026
Merged

EVWorth merged 5 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h

Conversation

@EVWorth

@EVWorth EVWorth commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Follow-ups to #875 (#880): three more routes by which a password reached disk or a log, plus the cleanup-script gap found while fixing them.

Changes

  • Server error echo (fix: server error text leaks passwords into the log #881). MySQL and MariaDB syntax errors end with near '<rest of the statement>' at line N. That quoting is not SQL quoting, so the credential redactor could not find a password inside it, and a mistyped CREATE USER … IDENTIFIED BY 'pw' wrote the password to the log file and to history's stored error.
    • New mas_core::query::redact_server_echo and log_safe_error replace the echo with <redacted> and keep the error code, SQLSTATE and line number.
    • They are used for the error logs of execute_query, explain_query, apply_grid_edits and restore.
    • The frontend mirror, redactServerEcho in src/lib/sql-redact.ts, runs in historyStore.addEntry before the existing credential scrub. The app still shows the user the full message.
  • Debug on profiles (fix: ConnectionProfile Debug prints the password #882). ConnectionProfile and SSHConfig now implement Debug by hand. Passwords and passphrases print as <redacted>, or as "" / None when unset, so you can still tell from a log line whether one is set.
  • Agent stdout (fix: agent's non-JSON output goes to the log verbatim #883). A non-JSON line from the harness is now logged by its length only.
  • Disk cleanup (chore: rm -rf deny rule blocks the documented cleanup #884). The new scripts/clean-debug.sh (also just clean-debug) removes target/debug/incremental and test binaries larger than 100 MB.
    • CLAUDE.md, the integration-tests skill and the implementer-rust agent point at it.
    • The rm -rf /* deny rule stays: it guards against wiping the root, and the documented cleanup no longer needs to work around it.
    • The just bump hint now points at the release skill instead of the removed "Release Flow" section.

Closes #881. Closes #882. Closes #883. Closes #884.

Test plan

  • cargo clippy --workspace --all-targets --all-features -- -D warnings and cargo fmt --all --check are clean.
  • cargo test -p mas-core --lib: 242 passed, including 7 new tests:
    • five for redact_server_echo (a real MySQL 1064 message, a close marker inside the echo, a truncated echo, a message with no echo, and log_safe_error);
    • two for Debug (no secret in {:?} or {:#?}, and set/unset still visible).
  • npx vitest run src/lib/__tests__/sql-redact.test.ts src/stores/__tests__/historyStore.test.ts: 91 passed. The new history test fails with the store change reverted.
  • npm run type-check, eslint on the changed files and dprint are clean.
  • bash scripts/clean-debug.sh freed 5 GB in this container.
  • fix: agent's non-JSON output goes to the log verbatim #883 has no unit test: the code path needs a running harness, and the change is one log field.

Generated by Claude Code

The rm -rf deny rule stays: it is the guard against a root wipe. The
cleanup CLAUDE.md asks cloud sessions to run now has a script, so it no
longer needs a hand-typed rm on an absolute path.

Closes #884.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
MySQL syntax errors quote the statement back without escaping its
quotes, so a mistyped CREATE USER put the password in the log file and
in history's stored error. The echo is now removed in both places.

Closes #881.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Doc comments on the profile structs are exported to bindings.ts, which
CI checks is current. These describe Rust internals, so they are plain
comments now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
@EVWorth
EVWorth merged commit 4baf1a8 into main Oct 24, 2026
12 checks passed
@EVWorth
EVWorth deleted the claude/hopeful-bardeen-1k4d1h branch October 24, 2026 13:53
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants