Skip to content

SQL injection is possible with mysql.escape function #342

@sebdej

Description

@sebdej

SQL injection is possible despite using mysql.escape:

var object = { 'a` = 2; INSERT INTO test_inject SET `a': 1 };

conn.query('INSERT INTO test_inject SET ?', object, function (err, results) { });

SqlString.objectToValues is the problem, it doesn't properly escape the object keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions