Repository navigation
Conversation
A design-level model of how Proxy maps, forwards or refuses each statement, checked with TLC: plaintext must never reach an encrypted column except with UNSAFE_DISABLE_MAPPING. Covers the refuse-by-default route from #484, simple Query batches, Parse and Bind, transactions and concurrent DDL. TLC confirms the safety properties for clients that never disable mapping, and records three findings as expected counterexamples: stale routes under concurrent DDL, statement kinds Proxy never type checks, and a Parse under UNSAFE_DISABLE_MAPPING bound after mapping is enabled again. Three injected faults are each caught. Adds a non-required CI workflow. No production code changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
S3 tracks writes into columns that are encrypted when the write happens; values already stored before DDL makes a column encrypted are out of scope. The README and verification record no longer imply that a change to Proxy's Rust code alone changes the TLC results. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
tobyhede
force-pushed
the
claude/project-thread-p8sn3b
branch
from
October 22, 2026 23:51
a2c955f to
dd25d54
Compare
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Proxy refuses a Bind with PreparedSettingsChanged when the mapping setting differs from the one at Parse, for any statement it type checks. The model left that check out, so it reported a plaintext path (F3) that Proxy built from main does not have. Model the check, drop the candidate-fix instances, and add mutation M4, which removes it and is caught by S1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Toby
A proof-of-concept formal model, in Quint, of how Proxy decides to map, forward or refuse each statement.
The property it checks is that plaintext never reaches an encrypted column, except when the client uses
UNSAFE_DISABLE_MAPPING.It's a design-level model only: it changes no production code, and no Rust code is tested against it yet.
Start with
specs/quint/routing/requirements.md, which has the scope, assumptions, properties, findings and open decisions.verification.mdhas the exact results.What it models
Frontend::routefrom refactor(proxy): route each statement through one refuse-by-default decision #484, includingmay_fall_back, the unresolvable-table refusal (fix(proxy): refuse writes to a table Proxy cannot resolve #486) and the simple Query batch rule.UNSAFE_DISABLE_MAPPING.mapping_errors_enabled.Results (Quint 0.33.0, TLC, exhaustive for each finite instance)
UNSAFE_DISABLE_MAPPINGand concurrent DDL.With a stable schema they hold on Proxy's routing alone, even with PostgreSQL's domain check switched off.
main's pre-refactor(proxy): route each statement through one refuse-by-default decision #484 behaviour), and no Bind settings check.Findings to confirm against real Proxy before acting
These are recorded as expected counterexamples, so CI fails if one stops reproducing.
F3(retracted): the first version of the model left out the Bind settings check (PreparedSettingsChanged), so it reported a plaintext path that Proxy does not have. The model now includes the check, and mutation M4 covers it.COPY FROM STDIN,DOandCALLare never type checked, so nothing in routing stops them writing plaintext.PostgreSQL's domain check should reject the value in every case, so none of these is a confirmed leak. Each would need a failing test first.
Tooling
specs/quinthas a pinnedpackage-lock.json, andcheck.shcovers typecheck, scenario tests, simulation, TLC and mutations..github/workflows/quint.ymlruns on changes underspecs/quintonly. It isn't a required check, and the full run takes about 8 minutes.npm auditflagsadm-zip, which Quint uses only to unpack its own Apalache download (noted in the README).Acknowledgment
By submitting this pull request, I confirm that CipherStash can use, modify, copy, and redistribute this contribution, under the terms of CipherStash's choice.
Generated by Claude Code