Repository navigation
Description
Evidence (verified on origin/main 1e80e51, crate landed in #13760 / PR 95b052f)
The translator uses the column name verbatim as the PostgREST query-parameter key (pkgs/id/crates/id-pg/src/translate.rs step 10: params.push((leaf.column.clone(), render_leaf_value(leaf)?))), and CollectionAllowlist (allowlist.rs) performs no validation on declared names — any string is an acceptable column/relation name.
Reproduced with a throwaway integration test (removed after verification; cargo test -p id-pg in pkgs/id):
- Collection declares filterable columns
id,or,select; query filtersor eq 1with keyset pagination overid→ params:
[("select", "id,or,select"), ("or", "eq.1"), ("or", "(id.gt.9)"), ("order", "id.asc"), ("limit", "50")]
Twoorparams: the column filter and the adapter-generated keyset logic group. PostgREST reservesor/andas the logic operators, so the column predicate is serialized into a position the source reads as boolean logic — the request is at best rejected, at worst misread. - Same collection, filter
select eq 2, no pagination → params:
[("select", "id,or,select"), ("select", "eq.2"), …]
Twoselectparams: the projection and a column filter PostgREST reads as a second projection directive.
Same class, unverified beyond reading: a filter on a column named order/limit/offset lands in a directive position; a relation name containing /, ? or # is interpolated raw into the path (format!("/{relation}")); column names containing ,/(/)/"/whitespace are interpolated raw into the select/order/or values (only in.(…) and keyset cursor values go through quoted_literal; identifiers never do).
This contradicts the crate root's own contract (lib.rs\): malformed-value edges "are refused as field_unsupported` rather than serialized into a request the source would reject or misread") — reserved-name columns serialize instead of refusing.
Why it matters
A column predicate silently promoted into a directive/logic position can widen or break the result set (e.g. a keyset or group merged with a column-or filter), defeating the allowlist's job as the layer-1 grant boundary. The transport slice (#13763) will turn these requests into live HTTP calls; registration (#13758, "checking them against the live endpoint") does not exist yet, so the translator is currently the only guard — and it does not guard this.
Dedupe
- Open searches for
postgrest,translator,keyset: no tracker covers this (nearest open is id: impl: PostgREST conformance fixtures for Postgres HTTP adapter (from #5805) #13764 conformance fixtures; parent id: impl: Postgres HTTP query translator with allowlist (from #5805) #13760 is closed/landed). - Closed id: impl: Postgres HTTP query translator with allowlist (from #5805) #13760 is the landing slice, not this defect. No open PR touches
id-pg.
Suggested fix shape / acceptance
- Translator (defense in depth, before any network call): refuse
field_unsupportedwhen a filter/order column name collides with a PostgREST reserved parameter (select,order,limit,offset,or,and, plus thePrefer/countfamily as applicable) or when a relation/column name is not a safe identifier for its syntactic position. - Registration (id: impl: Postgres HTTP adapter registration and owner config (from #5805) #13758): reject such names at allowlist construction against the live endpoint.
- Regression tests in
id-pg: filter onor+ keyset pagination refuses; filter onselectrefuses; (existing suite: 22 passed per landing commit).
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-24T13:51:23Z",
"session_id": "ses_e5df2327eddffeZ0r1Lz7AVdq4",
"lane": null,
"host": "amd",
"worktree": "/home/user/git/code",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/git/code",
"repo": "developing-today/code",
"branch": "queue/21642-14039-native-lancedb-reader",
"sha": "9e6b4adf64e54d8c623c329257bbac3b1f859266"
},
"auth_subject": "oc-code-05",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activity
developing-today commentedon Nov 24, 2026
CODE-5311
dezren39 commentedon Nov 24, 2026
PR #14497 implements the translator refusal: filter/order columns that are reserved PostgREST names (
select,order,limit,offset,or,and,not,columns,on_conflict) or not plain identifiers now refuse asfield_unsupported; a non-identifier relation collapses tonot_available. Projection names and the registration-time check are not covered here, see the follow-up issue linked from #13758.Merge pull request #14497 from developing-today/dispatch/23601-14391-…