<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://vulnerability.circl.lu/rss/recent/all/10</id>
  <title>Most recent entries from all</title>
  <updated>2026-09-29T19:49:37.426784+00:00</updated>
  <author>
    <name>Vulnerability-Lookup</name>
    <email>info@circl.lu</email>
  </author>
  <link href="https://vulnerability.circl.lu" rel="alternate"/>
  <generator uri="https://lkiesow.github.io/python-feedgen" version="1.0.0">python-feedgen</generator>
  <subtitle>Contains only the most 10 recent entries.</subtitle>
  <entry>
    <id>https://vulnerability.circl.lu/vuln/ghsa-6457-6jrx-69cr</id>
    <title>GHSA-6457-6jrx-69cr — Sequelize v6 Vulnerable to SQL Injection via JSON Column Cast Type</title>
    <updated>2026-09-29T19:49:37.428681+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><strong>Affected:</strong> npm: sequelize</p>
<p>### Summary</p>
<p>SQL injection via unescaped cast type in JSON/JSONB `where` clause processing. The `_traverseJSON()` function splits JSON path keys on `::` to extract a cast type, which is interpolated raw into `CAST(... AS &lt;type&gt;)` SQL. An attacker who controls JSON object keys can inject arbitrary SQL and exfiltrate data from any table.</p>
<p>Affected: v6.x through 6.37.7. v7 (`@sequelize/core`) is not affected.</p>
<p>### Details</p>
<p>In `src/dialects/abstract/query-generator.js`, `_traverseJSON()` extracts a cast type from `::` in JSON keys without validation:</p>
<p>```javascript
// line 1892
_traverseJSON(items, baseKey, prop, item, path) {
    let cast;
    if (path[path.length - 1].includes("::")) {
      const tmp = path[path.length - 1].split("::");
      cast = tmp[1];       // attacker-controlled, no escaping
      path[path.length - 1] = tmp[0];
    }
    // ...
    items.push(this.whereItemQuery(this._castKey(pathKey, item, cast), { [Op.eq]: item }));
}
```</p>
<p>`_castKey()` (line 1925) passes it to `Utils.Cast`, and `handleSequelizeMethod()` (line 1692) interpolates it directly:</p>
<p>```javascript
return `CAST(${result} AS ${smth.type.toUpperCase()})`;
```</p>
<p>JSON path **values** are escaped via `this.escape()` in `jsonPathExtractionQuery()`, but the cast **type** is not.</p>
<p>**Suggested fix** — whitelist known SQL data types:</p>
<p>```javascript
const ALLOWED_CAST_TYPES = new Set([
  'integer', 'text', 'real', 'numeric', 'boolean', 'date',
  'timestamp', 'timestamptz', 'json', 'jsonb', 'float',
  'do…</p></div>
    </content>
    <link href="https://vulnerability.circl.lu/vuln/ghsa-6457-6jrx-69cr"/>
  </entry>
</feed>
