Skip to content

fix(oracle): SQL injection, view comment DOT, and pagination column leak#2052

Open
HandSonic wants to merge 3 commits into
OtterMind:mainfrom
HandSonic:fix/oracle-sql-fixes
Open

fix(oracle): SQL injection, view comment DOT, and pagination column leak#2052
HandSonic wants to merge 3 commits into
OtterMind:mainfrom
HandSonic:fix/oracle-sql-fixes

Conversation

@HandSonic

Copy link
Copy Markdown
Contributor

Summary

Fixes 3 bugs in Oracle plugin:

  1. SQL injection (OracleMetaData.tables()): escapes single quotes in table name via replace("'", "''") instead of direct string concatenation
  2. View comment SQL (OracleSqlBuilder.buildCreateView()): added missing . separator between schema and view name — was producing "SCOTT""MY_VIEW" instead of "SCOTT"."MY_VIEW"
  3. Pagination (OracleSqlBuilder.buildPageLimit()): always applies outer SELECT * FROM (...) wrapper — previously skipped for first page, leaking CAHT2DB_AUTO_ROW_ID extra column into results

Split from #1926 per review feedback.

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
HandSonic force-pushed the fix/oracle-sql-fixes branch from da8b56e to d15fa1c Compare July 24, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants