Skip to content

fix(oh1): recognize proven DB-API parameter binding - #890

Open
chrisknvidia wants to merge 3 commits into
mainfrom
feat/christopherk/oh1-bound-sql
Open

chrisknvidia wants to merge 3 commits into
mainfrom
feat/christopherk/oh1-bound-sql

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #888.

OH1 mistakes percent markers in literal SQL with separately bound parameters for string interpolation. Recognize bounded source-level binding through canonical sqlite3, psycopg and psycopg2 APIs, exempting only the lexical match owned by the exact call.

Check passive setup once and memoize immutable connection argument validation. Preserve whole-tree mutation/alias checks, the AST-node/depth limits and shared source-position handling. Actual interpolation, nested unsafe queries, unknown helpers, opaque/function contexts and malformed/transformed input retain findings. Runtime driver identity is not verified; scoring and exit policy are unchanged.

Validation on 8400b6c:

  • 1,424 existing affected tests, project lint/format and targeted mypy pass. One existing resource regression now checks many safe queries plus an unsafe trailing query; no test cases or files were added.
  • 22 installed-console invocations and four real MCP stdio scans cover JSON/SARIF agreement, strict gates, baselines, recursive outcomes and expected malformed-input partial results. All 114 Python modules match source, wheel and installation. Real SQLite binding preserves SQL-looking row data and the table.
  • Repeated architecture/code/manual security review and complete-finding comparisons pass.

Five hosted checks pass; hosted unit CI is still running. No live PostgreSQL, model-provider or customer production run is claimed.

Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
@chrisknvidia
chrisknvidia marked this pull request as ready for review October 20, 2026 20:11
@chrisknvidia
chrisknvidia requested a review from rng1995 October 20, 2026 20:11
@chrisknvidia
chrisknvidia marked this pull request as draft October 20, 2026 20:17
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
@chrisknvidia
chrisknvidia marked this pull request as ready for review October 20, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OH1 flags proven DB-API parameter binding as output injection

1 participant