fix(oracle): SQL injection, view comment DOT, and pagination column leak - #2052
Merged
Conversation
tableName was concatenated directly into SQL without escaping. Table names
containing single quotes (e.g. O'Brien) would break SQL syntax or allow
injection. Now escapes single quotes with replace("'", "''").
View comment SQL was missing DOT between schema and view name identifiers, producing "SCOTT""MY_VIEW" instead of "SCOTT"."MY_VIEW".
When offset==0 (first page), the outer SELECT * FROM (...) wrapper was skipped, leaking CAHT2DB_AUTO_ROW_ID into the result set. Now both wrappers are always applied for consistent column schema across pages.
HandSonic
force-pushed
the
fix/oracle-sql-fixes
branch
from
July 24, 2026 14:01
da8b56e to
d15fa1c
Compare
openai0229
approved these changes
Jul 25, 2026
openai0229
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the full change and added maintainer follow-up commits for Oracle pagination consistency, schema/comment SQL escaping, quoted identifiers, and regression coverage. Local reactor verification passed: tools 26, SPI 54, Oracle 15; git diff --check also passed.
This was referenced Jul 25, 2026
This was referenced Jul 26, 2026
This was referenced Jul 26, 2026
Merged
HandSonic
added a commit
to HandSonic/Chat2DB
that referenced
this pull request
Jul 26, 2026
…intainer review (OtterMind#1914) - strengthen OracleIdentifierProcessor: INSTANCE, escapeString with single-quote doubling, static escapeIdentifier/quoteIdentifierAlways - OracleMetaData processor singleton delegates to INSTANCE; private escapeSqlLiteral (OtterMind#2052) unified to processor escapeString - builders/DBManager/enums/value processors use the processor (or OracleSqlGuards for non-escapable validation) - OracleSqlEscapes removed; tests migrated (33 green)
openai0229
pushed a commit
to HandSonic/Chat2DB
that referenced
this pull request
Jul 29, 2026
…intainer review (OtterMind#1914) - strengthen OracleIdentifierProcessor: INSTANCE, escapeString with single-quote doubling, static escapeIdentifier/quoteIdentifierAlways - OracleMetaData processor singleton delegates to INSTANCE; private escapeSqlLiteral (OtterMind#2052) unified to processor escapeString - builders/DBManager/enums/value processors use the processor (or OracleSqlGuards for non-escapable validation) - OracleSqlEscapes removed; tests migrated (33 green)
openai0229
added a commit
that referenced
this pull request
Jul 29, 2026
#1914) (#2195) * fix(oracle): escape SQL identifiers and literals in metadata/DDL paths (#1914) * refactor(oracle): move escaping into OracleIdentifierProcessor per maintainer review (#1914) - strengthen OracleIdentifierProcessor: INSTANCE, escapeString with single-quote doubling, static escapeIdentifier/quoteIdentifierAlways - OracleMetaData processor singleton delegates to INSTANCE; private escapeSqlLiteral (#2052) unified to processor escapeString - builders/DBManager/enums/value processors use the processor (or OracleSqlGuards for non-escapable validation) - OracleSqlEscapes removed; tests migrated (33 green) * fix(oracle): keep SPI quoteIdentifier conditional, reserve always-quote for DDL paths (#1914) * fix(oracle): preserve legal SQL escaping semantics (#1914) --------- Co-authored-by: zgq <openai0229@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Oracle SQL generation in three areas:
OracleMetaData.tables()): escapes both schema and table-name SQL literals before interpolation.OracleSqlBuilder.buildCreateView()): quotes schema/view identifiers with Oracle double-quote escaping, emits the missing.separator, handles schema-less views, and escapes comment string literals without treating backslashes as Oracle escapes.OracleSqlBuilder.buildPageLimit()): always applies the outer projection so the syntheticCAHT2DB_AUTO_ROW_IDcolumn does not leak on the first page, while retaining the lower-bound wrapper for later pages.Maintainer follow-up adds focused regression coverage for quote, backslash, and apostrophe edge cases.
Split from #1926 per review feedback.