7.5high

CVE-2016-10556

SQL Injection in sequelize

Also known as GHSA-9c2p-jw8p-f84v

Published 8 y ago · modified 4 mo ago · JSON

CVSS
7.5
v3.0 · NVD
CISA KEV
No
not known exploited
EPSS
1.3%
percentile 71%
Public exploits
0
none known

Summary

sequelize is an Object-relational mapping, or a middleman to convert things from Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server into usable data for NodeJS In Postgres, SQLite, and Microsoft SQL Server there is an issue where arrays are treated as strings and improperly escaped. This causes potential SQL injection in sequelize 3.19.3 and earlier, where a malicious user could put `["test", "'); DELETE TestTable WHERE Id = 1 --')"]` inside of ``` database.query('SELECT * FROM TestTable WHERE Name IN (:names)', { replacements: { names: directCopyOfUserInput } }); ``` and cause the SQL statement to become `SELECT Id FROM Table WHERE Name IN ('test', '\'); DELETE TestTable WHERE Id = 1 --')`. In Postgres, MSSQL, and SQLite, the backslash has no special meaning. This causes the the statement to delete whichever Id has a value of 1 in the TestTable table.

Exploit prediction (EPSS)

1.32% probability of exploitation in the next 30 days, higher than 71% of all scored CVEs.

CVSS scores

Assigned byVersionScoreVector
NVD3.07.5CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD2.05.0AV:N/AC:L/Au:N/C:N/I:N/A:P
GitHub3.07.5CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected packages

EcosystemPackageAffectedFixed in
npmsequelize
<3.20.0
3.20.0

Affected products

  • HackerOne sequelize node module

Classification

Weakness
  • CWE-89 Improper Neutralization of Special Elements used in an SQL Command

References

  • github.com /sequelize/sequelize/issues/5671 · x_refsource_MISC, x_transferred
  • nodesecurity.io /advisories/102 · x_refsource_MISC, x_transferred
  • nvd.nist.gov /vuln/detail/CVE-2016-10556 · advisory
  • github.com /sequelize/sequelize/commit/23952a2b020cc3571f090e67dae7feb084e1be71 · web
  • github.com /sequelize/sequelize/commits/v3.20.0?after=62e4dacb28a779a190a3e042b971dcd8c7926e49+34&bra · web

Sources

vulnwire keeps one entry per vulnerability: the CVE id wins, then GHSA; records that alias each other are merged. Machine-readable: JSON.