You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(keepass-cred-mgr): harden REPL quoting, output parsing, and notes escaping
Research into keepassxc-cli source revealed three additional corruption vectors:
1. REPL quoting model was wrong: the CLI uses Utils::splitCommandString
(backslash escapes any character), not QProcess::splitCommand. Updated
comments to document the actual behavior.
2. _parse_show_output misinterpreted notes containing "Password: ..." as
field boundaries. Since Notes is always the last standard field in
keepassxc-cli output, only Tags: terminates notes mode now.
3. keepassxc-cli's Add.cpp/Edit.cpp replace literal \\n in --notes values
with actual newlines before storing. Added _escape_notes_for_cli() to
prevent silent data corruption when notes contain backslash-n text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: plugins/keepass-cred-mgr/CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
10
10
- Newlines in REPL arguments (notes, urls) corrupt the keepassxc-cli command stream, causing garbled entries and data loss. `_repl_quote()` now sanitizes `\n`/`\r` to spaces before quoting.
11
11
-`deactivate_entry` constructed notes with an embedded newline (`\n[DEACTIVATED: ...]`) that split the REPL command across two lines. Uses ` | ` separator instead.
12
12
-`run_cli` stdin_lines (passwords) now reject embedded newlines with a clear error instead of silently corrupting the stream.
13
+
- Corrected REPL quoting model: the CLI uses `Utils::splitCommandString` (backslash escapes any character), not `QProcess::splitCommand`. Updated comments and docs.
14
+
-`_parse_show_output` no longer misinterprets notes containing `Password: ...` or `URL: ...` text as field boundaries. Notes is the last standard field; only `Tags:` terminates it.
15
+
- Notes passed via `--notes` are now escaped to prevent keepassxc-cli from silently converting literal `\n` text into newlines (the CLI replaces `\\n` → newline before storing).
0 commit comments