Skip to content

Security: Fix critical SQL injection in sequelize (CVE-2023-25813) - #38

Open
swinton wants to merge 2 commits into
mainfrom
fix/security-SNYK-JS-SEQUELIZE-2932027
Open

Security: Fix critical SQL injection in sequelize (CVE-2023-25813)#38
swinton wants to merge 2 commits into
mainfrom
fix/security-SNYK-JS-SEQUELIZE-2932027

Conversation

@swinton

@swinton swinton commented Apr 1, 2026

Copy link
Copy Markdown
Member

Security Fix

Vulnerability Details

  • ID: SNYK-JS-SEQUELIZE-2932027 (CVE-2023-25813)
  • Severity: Critical
  • Type: SCA (Dependency)

Changes Made

Upgraded sequelize from 6.1.06.37.8 to patch a critical SQL Injection vulnerability where unsanitized input could be injected directly into SQL queries.

Additional Issues Fixed (13 total)

ID Severity Title
SNYK-JS-SEQUELIZE-3324088 High Improper Filtering of Special Elements
SNYK-JS-SEQUELIZE-2959225 High SQL Injection
SNYK-JS-SEQUELIZE-15456219 High SQL Injection
SNYK-JS-SEMVER-3247795 High ReDoS (transitive)
SNYK-JS-DOTTIE-3332763 High Prototype Pollution (transitive)
SNYK-JS-VALIDATOR-13653476 High Incomplete Filtering (transitive)
SNYK-JS-SEQUELIZE-3324089 Medium Information Exposure
SNYK-JS-SEQUELIZE-3324090 Medium Type Confusion
SNYK-JS-VALIDATOR-13395830 Medium Improper Input Validation (transitive)
SNYK-JS-VALIDATOR-1090599/01/02 Medium ReDoS (transitive, ×3)

Files Changed

  • package.json — bumped sequelize to ^6.37.8
  • package-lock.json — regenerated lockfile

Validation

  • Snyk SCA scan: 49 issues → 36 issues (13 resolved)
  • No new vulnerabilities introduced
  • npm install succeeded cleanly

Note: This is an intentionally vulnerable demo repo — remaining issues in other packages (handlebars, lodash, axios, etc.) are left as-is.

🤖 Generated with Claude Code

swinton and others added 2 commits April 14, 2025 12:09
…njection

Resolves: SNYK-JS-SEQUELIZE-2932027 (CVE-2023-25813)
Severity: Critical
Also fixes 12 additional high/medium issues in sequelize and its
transitive dependencies (semver, dottie, validator).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@swinton

swinton commented Apr 1, 2026

Copy link
Copy Markdown
Member Author

Snyk checks have failed. 2 issues have been found so far.

Status Scan Engine Critical High Medium Low Total (2)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 1 1 0 2 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@swinton

swinton commented Apr 1, 2026

Copy link
Copy Markdown
Member Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment thread app.js
@@ -0,0 +1,27 @@
const express = require('express');
const sqlite3 = require('sqlite3').verbose();
const app = express();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Information Exposure - X-Powered-By Header

Disable X-Powered-By header for your Express app (consider using Helmet middleware), because it exposes information about the used framework to potential attackers.

Line 3 | CWE-200 | Priority score 600 | Learn more about this vulnerability

Comment thread app.js

const query = `SELECT * FROM users WHERE username = '${username}' AND password = '${password}'`;

db.get(query, (err, row) => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  SQL Injection

Unsanitized input from the HTTP request body flows into get, where it is used in an SQL query. This may result in an SQL Injection vulnerability.

Line 20 | CWE-89 | Priority score 850 | Learn more about this vulnerability
Data flow: 9 steps

Step 1 - 4

danger/app.js

Line 16 in fe30622

const { username, password } = req.body;

Step 5 - 7 app.js#L18

Step 8 - 9

danger/app.js

Line 20 in fe30622

db.get(query, (err, row) => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant