Skip to content

Go SDK: JSONSelection has no Value method, so pgx binds its redacted text and the query matches nothing #1849

In review

Description

@auxesis

Background

The Go SDK is in languages/golang in this repository. It encrypts values in a Go program, and gets its keys from ZeroKMS, CipherStash's key management service. In November 2026 we audited version v0.1.0-rc.7 by building programs against a dev workspace and PostgreSQL 17 with EQL (Encrypt Query Language) v4.

Problem

A JSON path query binds the generated selector as a query parameter. The value has no driver.Valuer Value method. So pgx binds the value's String output. That output is redacted text. The query then returns no rows, and no error.

A developer sees an empty result and has no reason to suspect the parameter. Binding .Selector() works.

Proposal

  1. Add a Value method to JSONSelection that returns the selector the query needs.
  2. Add a test that binds a JSONSelection through database/sql with pgx and finds the row.

Evidence

Verified with EXPLAIN and by query, in two separate trials.

Metadata

Metadata

Assignees

Labels

GolangSDKbug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions