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
[SECURITY] Use backend-correct quoting for generated SQL literals and identifiers #821
Reproduced with the current build and local k8s fixture: a mock node with kind="O'Reilly" is returned without a filter, but AND kind = 'O''Reilly' fails in backing SQLite with near "Reilly": syntax error.
At the formatter/SQLite boundary, the value x' OR 1=1 -- renders as 'x\' OR 1=1 --'; SELECT 1 WHERE 'x' = <rendered-value> returned 1. This proves syntax escape at that boundary; it is not a claim that every planner context accepts that exact payload or that stacked statements were demonstrated. Bare provider-free SELECT follows a different path and correctly handled the apostrophe in the probe.
Required outcome
Prefer bound values for generated predicates. Where rendering is required, use the target dialect's quoting rules, including apostrophes, backslashes, NULs and Unicode.
Centralize identifier quoting and double embedded quote delimiters. Apply it to user names, aliases and provider-defined column/relation names at actual SQL sinks.
Keep CLI, pgwire and MCP behavior consistent without changing legitimate values.
Validation and acceptance
Add robot regression tests on both backends for quoted response-column filters and aliases/identifiers containing delimiters. Add generator-level tests proving hostile-looking text remains data, including extended parameters and nested predicates. Existing PR #804 parameter substitution tests must continue passing.
Scope and related work
Separate from intentional NATIVEQUERY passthrough and the cache-request lookup interpolation. QueryMaterializedView has no callers in this checkout; remove or harden it within this work, without claiming a reachable exploit through dead code.
Activity