Repository navigation
chore: prepare v2.2.7 release - #530
Conversation
Bump the workspace version to 2.2.7 and move the unreleased changelog entries under a dated 2.2.7 heading, following the maintenance release steps for release/2.2. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013Q6HAPe4RUfXwkC13DxDVk
Proxy logged every PostgreSQL ErrorResponse at error level with all of its fields. Fields such as the message and detail can contain values from the statement, so those values reached the logs at the default log level. Log only the SQLSTATE and message, at debug level on the PROTOCOL target, as main does since 9dc3608.
5223646 to
85b3bb1
Compare
…tor updates
The migrate command built each row's UPDATE by inserting the source
value as '{val}' without escaping, and the target column and table
names unescaped. A value with a single quote broke the batch, and a
value shaped like SQL ran as SQL, because the batch is sent with
simple_query. Escape all three with escape_literal and
escape_identifier, as main does since PR 533 (CIP-5750).
|
@cipherstash-agent review |
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation
Reviewed e69267b · posted from Claude Code · claude-opus-5-5 · effort medium (code-review)
Sources: code-review · claude-opus-5-5; rust-security · claude-opus-5-5; mattpocock-skills:code-review · claude-opus-5-5
Skills: code-review, company-skills:rust-security, mattpocock-skills:code-review, company-skills:review-cross-check
Findings (8): 3 major, 5 minor — 5 inline, 3 below.
packages/cipherstash-proxy/src/cli/migrate/mod.rs:192(outside diff) major The migrator still logs the whole batchUPDATEatMIGRATEdebug, and it holds every plaintext source value, soCS_LOG__MIGRATE_LEVEL=debugwrites them all to the log;:189also logs primary-key values under--verboseat the default level.mainfixed both alongside the escaping (52017f8 in #533, andSensitivein #534). Logrows = batch.len()and drop or countrecords.packages/cipherstash-proxy/src/cli/migrate/mod.rs:68(outside diff) major Existing code:debug!(?config)printsclient_access_key,client_key(config/tandem.rs:38-49) and an inline TLSprivate_key_pem(config/tls.rs:13-22), all with derivedDebug, whenevermigrateruns at debug.mainredacts them in 4864637; worth a 2.2.x backport.packages/cipherstash-proxy/src/cli/migrate/mod.rs:196(outside diff) minor Existing code:BEGIN;is sent once before the loop butCOMMIT;after every batch, and paging isLIMIT/OFFSET, so a concurrent delete or insert during a migration skips a row (left unencrypted) or repeats one. Use keyset pagination withBEGIN/COMMITaround each batch.
Checked and not raised: escaping covers every value and identifier in the UPDATE, and build_update_statement matches main; quoting the table matches the SELECT, which was already quoted; rkyv is not compiled in (cargo tree -i rkyv -e all --all-features prints nothing); jsonwebtoken 9.3.1 is reached only through stack-auth, which decodes with signature and exp checks off; the three migrate tests pass.
Generated by Claude Code
| @@ -164,33 +164,12 @@ impl Migrate { | |||
| row.get(source_col.as_str()).unwrap_or("").to_owned() | |||
There was a problem hiding this comment.
minor Existing code: unwrap_or("") turns a SQL NULL into '', so a NULL source value is written as an encrypted empty string instead of NULL, and a NULL key column gives WHERE "col"='', which matches the wrong rows or none. Keep Option<String> and emit NULL in SET, and IS NULL in WHERE (or refuse a NULL key).
Source: code-review · claude-opus-5-5
Generated by Claude Code
The ErrorResponse message can contain values from the statement, such as the input in an invalid input syntax error, so stop logging it in the debug event and add a regression test.
Also remove a stale comment from build_update_statement.
Requested by User · project thread
Summary
Prepares the 2.2.7 maintenance release of CipherStash Proxy from
release/2.2.It bumps the version and dates the changelog, following "Maintenance releases (2.2.x)" in
DEVELOPMENT.md.No tag or GitHub release has been created.
Changes
Cargo.toml: workspace version 2.2.6 → 2.2.7.Cargo.lock:cargo update --workspace, which only moves the three workspace crates to 2.2.7.CHANGELOG.md:[Unreleased]renamed to[2.2.7] - 2026-12-04, with a fresh empty[Unreleased]above it.postgresql/backend.rs: a database error is now logged atdebuglevel on thePROTOCOLtarget, with only its SQLSTATE code. The message is not logged, because it can contain statement values. Previously Proxy logged every database error aterrorlevel with all its fields, which can contain values from the statement. This matchesmainsince 9dc3608.cli/migrate/mod.rs: the Encryption Migrator now escapes each source value, the target column name and the table name in itsUPDATEstatements. Previously a value with a single quote broke the batch, and a value shaped like SQL ran as SQL. This is the escaping part of PR 533 onmain(CIP-5750), with its three quoting tests and a test for backslashes and compound primary keys.CHANGELOG.md: aChangedentry for the log change, andSecurityentries for the migrator fix and explaining that jsonwebtoken GHSA-h395-gr6q-cpjc and rkyv RUSTSEC-2026-0235 do not affect Proxy 2.2.7.Verification
cargo update --workspacechanged only the workspace crate versions (no third-party dependency moved).cargo metadataresolves the workspace.cargo clippy --workspace --all-targets --locked -- -D warnings: passed.cargo fmt --all -- --check: passed.cargo test -p cipherstash-proxy -p eql-mapper --lib --locked: 323 and 92 passed. The three migrator quoting tests failed before the escaping fix and pass after it.Related
The branch is rebased on
release/2.2at 9360272, so 2.2.7 includes:Their changelog entries are under
[2.2.7], and the release date is now 2026-12-04.After the rebase,
cargo update --workspacewas re-run on #528'sCargo.lock, and it moved only the three workspace crates.Review notes
The migrator's debug logging of plaintext and credentials is tracked in CIP-5752, and its NULL handling and batching bugs in CIP-5769. Neither is part of 2.2.7.
After merging, tag and release from the merged commit as described in
DEVELOPMENT.md, with--latest=false --notes-start-tag v2.2.6.Generated by Claude Code