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
{{ message }}
Repository navigation
Tighten the DB_URI shape refusal: a fragment's query, false doc sentences, and the echoed near-miss #1126
Found by a scoped security read of the DB_URI shape refusal added to #1125. None of it blocks that PR; all of it is in the refusal or in the redaction around it.
What
The new fallback reads a ? inside a fragment as a query.postgres://#?host=/sock is now accepted and dials localhost, where before the gate it was refused. The scan should end the authority at the first /, ? or # and ignore anything after a # when looking for a host/hostaddr query key.
Two doc sentences in the refusal are false. "a refused string is one with no ://" is untrue for postgres://, postgres://// and postgres:///db, which have :// and are refused; and "everything sqlx can dial is left alone" is untrue for the same three, which sqlx parses to localhost. The doc should state the deliberate divergence and the three cases.
Minor, from the same read: postgres://user@:5432/db is newly accepted (sqlx: empty host, no dial), %68ost as a query key is refused, and the socket-form test asserts less than the hostaddr one.
Acceptance
A test per shape in 1 and 3, each failing without the change.
The doc comment matches the predicate, including the deliberate strictness and its reason.
The socket and hostaddr forms still dial (they are what a Unix-socket relay uses).
Items 1–3 landed at 8be97bc on factory/029-pg-to-lmdb (PR #1125):
The fragment is dropped before the query is read, so postgres://#?host=/sock is refused instead of dialling localhost. Red at the previous rule: could not read the source at postgres:// … Connection refused.
The doc comment now states the predicate and the deliberate strictness, naming postgres://, postgres://// and postgres:///db as localhost to sqlx and refused here with the reason.
Only postgres/postgresql (either case) count as a scheme, so password=ab://cd — a libpq keyword string with an accidental :// — is refused before anything is dialled. Red at the previous rule: the failure printed the string verbatim, could not read the source at password=ab://cd, which is the leak this item named.
From item 4, postgres://user@:5432/db is now refused (empty host, matching sqlx), and an IPv6 literal is pinned as a host. Still open here: a percent-encoded query key (%68ost) is refused, which is stricter than sqlx and harmless, and the socket-form test asserts only that the gate passes it rather than naming the socket error.
Activity
fix(migrate): read the URI the way sqlx does, and say what the gate r…
chappie-daemon commentedon Nov 12, 2026
Items 1–3 landed at
8be97bconfactory/029-pg-to-lmdb(PR #1125):postgres://#?host=/sockis refused instead of dialling localhost. Red at the previous rule:could not read the source at postgres:// … Connection refused.postgres://,postgres:////andpostgres:///dbaslocalhostto sqlx and refused here with the reason.postgres/postgresql(either case) count as a scheme, sopassword=ab://cd— a libpq keyword string with an accidental://— is refused before anything is dialled. Red at the previous rule: the failure printed the string verbatim,could not read the source at password=ab://cd, which is the leak this item named.From item 4,
postgres://user@:5432/dbis now refused (empty host, matching sqlx), and an IPv6 literal is pinned as a host. Still open here: a percent-encoded query key (%68ost) is refused, which is stricter than sqlx and harmless, and the socket-form test asserts only that the gate passes it rather than naming the socket error.fix(migrate): read the URI the way sqlx does, and say what the gate r…
fix(migrate): read the URI the way sqlx does, and say what the gate r…