Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-10857

SQL injection bug in JdbcDialect.getTableExistsQuery()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Incomplete
    • 1.5.0
    • None
    • SQL

    Description

      All of the implementations of this method involve constructing a query by concatenating boilerplate text with a user-supplied name. This looks like a SQL injection bug to me.

      A better solution would be to call java.sql.DatabaseMetaData.getTables() to implement this method, using the catalog and schema which are available from Connection.getCatalog() and Connection.getSchema(). This would not work on Java 6 because Connection.getSchema() was introduced in Java 7. However, the solution would work for more modern JVMs. Limiting the vulnerability to obsolete JVMs would at least be an improvement over the current situation. Java 6 has been end-of-lifed and is not an appropriate platform for users who are concerned about security.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhillegas Richard N. Hillegas
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: