feat(proxy): accept inbound EQL ciphertext payloads - #458
Open
freshtonic wants to merge 9 commits into
Open
Conversation
tobyhede
reviewed
Aug 20, 2026
tobyhede
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the new inbound EQL ciphertext path. One security issue with two exploit paths, one design trade-off to confirm, and one operational gap. Each item was checked against the actual code on this branch and the cipherstash-client 0.42.2 dependency source before being posted here. Two items from an earlier automated pass did not hold up under verification and are not included: the "h" top-level key check is not dead code (it detects SteVec payloads, which carry no top-level c field), and the binary-parameter byte handling in bind.rs does not corrupt data (original bytes stay untouched, and a failed trial parse falls back safely).
See inline comments for details.
freshtonic
commented
Aug 20, 2026
freshtonic
force-pushed
the
feat/cip-3822-inbound-eql-payloads
branch
from
August 23, 2026 12:28
aad1e0b to
4db9e51
Compare
Signed-off-by: James Sadler <james@cipherstash.com>
Signed-off-by: James Sadler <james@cipherstash.com>
Signed-off-by: James Sadler <james@cipherstash.com>
Scope the ZeroKMS cipher to CS_DEFAULT_KEYSET_ID whenever a connection has not selected an override. Previously Proxy only checked that the setting existed, then passed no identifier to ScopedCipher and could silently use the client's account default instead. Application-encrypted payloads use the configured keyset explicitly. When the account and configured defaults differ, Proxy derived searchable-encryption metadata with another index key and rejected valid inbound ciphertext during authentication. Preserve connection-level keyset precedence while making the configured fallback effective. Signed-off-by: James Sadler <james@cipherstash.com>
Inbound EQL authentication independently re-encrypts plaintext and compares its searchable-encryption metadata with the supplied payload. Match-index generation does not guarantee a stable ordering for Bloom-filter bit positions, so comparing serialized query operands rejected valid ciphertext whenever equivalent positions were emitted in another order. Compare scalar metadata field by field and normalize Bloom-filter positions before equality. Continue comparing identifiers, exact-match terms, ordered terms, versions, and structured SteVec operands exactly so altered metadata still fails closed. Add a regression test covering reordered equivalent Bloom-filter terms. Signed-off-by: James Sadler <james@cipherstash.com>
Signed-off-by: James Sadler <james@cipherstash.com>
Signed-off-by: James Sadler <james@cipherstash.com>
Signed-off-by: James Sadler <james@cipherstash.com>
Signed-off-by: James Sadler <james@cipherstash.com>
freshtonic
force-pushed
the
feat/cip-3822-inbound-eql-payloads
branch
from
August 24, 2026 02:23
d99891b to
dc7a97d
Compare
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.
Summary
cipherstash-proxy-integrationCompatibility
On encrypted columns, JSON values with top-level
v,i, and at least one ofc,h, orsvadvertise themselves as EQL payloads and fail closed if invalid. There is no opt-out. The error documentation includes an upgrade audit query and guidance for text-backed source data.Testing
mise run test:checkmise run test:unit(all 372 tests pass; the macOS configuration-store test required an unsandboxed isolated rerun)mise run test:clippymise run test:formatcargo test -p cipherstash-proxy-integration --no-runcargo test -p showcase --no-runRuntime integration and showcase cases use the existing credentialed CI tasks; this checkout has no application/ZeroKMS credentials for starting an isolated current-branch Proxy locally.
Linear: CIP-3822