Skip to content

fix(jdbc): escape table type values in getTables metadata query#1426

Open
dxbjavid wants to merge 1 commit into
xerial:masterfrom
dxbjavid:gettables-type-escape
Open

fix(jdbc): escape table type values in getTables metadata query#1426
dxbjavid wants to merge 1 commit into
xerial:masterfrom
dxbjavid:gettables-type-escape

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

the types argument passed to getTables is interpolated straight into the TABLE_TYPE IN (...) list without escape(), unlike the other identifiers used in these metadata queries, so a type value containing a single quote breaks the generated SQL and can change what the query returns (for instance a value like "X') OR ('1'='1" bypasses the type filter and lists every table). passing each value through escape() keeps embedded quotes literal, in line with the recent getColumns change. i added a small regression test next to the existing metadata quote tests.

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.

1 participant