| 标题 | GitHub dresende node-sql-query 0.1.25-0.1.28 SQL Injection |
|---|
| 描述 | An SQL fragment injection vulnerability exists in the joinType option of the SelectQuery.from() method.
The library allows developers to specify a JOIN type through an options object:
.from("orders", "user_id", "id", {
joinType: "LEFT"
})
However, the value of joinType is not checked against an allow-list of valid JOIN types. During SQL generation, the value is only converted to uppercase and is then concatenated directly into the generated SQL statement.
The affected code is:
if (from.opts && from.opts.joinType) {
query.push(from.opts.joinType.toUpperCase());
}
query.push("JOIN");
The call to toUpperCase() is not a security validation mechanism. It does not remove SQL keywords, comments, parentheses, subqueries, or other attacker-controlled SQL syntax.
If a downstream application passes untrusted data, such as an HTTP request parameter or JSON property, into joinType, an attacker can inject arbitrary SQL fragments into the generated SELECT statement. |
|---|
| 来源 | ⚠️ https://github.com/windhxy/CVE-my/issues/2 |
|---|
| 用户 | windhxy (UID 90128) |
|---|
| 提交 | 2026-06-23 03時58分 (2 月前) |
|---|
| 管理 | 2026-08-08 18時29分 (2 months later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 387190 [dresende node-sql-query 0.1.25/0.1.26/0.1.27/0.1.28 Request Parameter lib/Select.js SelectQuery.from/SelectQuery.build SQL注入] |
|---|
| 积分 | 20 |
|---|