Skip to content

dropSchema and createSchema allowing SQL injection #4202

Closed

Description

@billxinli
var reportingSchema = 'report CASCADE; CREATE SCHEMA if not exist foo --'
return sequelize.dropSchema(reportingSchema)

Is this the intended behaviour? if so, how can one ensure reportingSchema is escaped properly as a literal?

Currently using: 2.0.5, changelog did not specify any injection fixes for releases after 2.0.5.

Activity

  1. added
    type: bug
    on Jul 29, 2015
  2. mickhansen commented on Jul 29, 2015

    @mickhansen
    Contributor

    Not sure we've ever considered that as a vector since we hadn't considered using end-user supplied values for creating a schema.

    I guess we can escape them as we do tables, if that is allowed, although i have no idea if table names are injection proof.

  3. wstallard-gobalto commented on May 18, 2017

    @wstallard-gobalto

    Docs for dropSchema/createSchema should probably reflect their potential as a SQL injection vector...

  4. stale commented on Jul 18, 2017

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    staletype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions