Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion routes/shipmentTrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { type Request, type Response, type NextFunction } from 'express'
module.exports = function shipmentTrace () {
return (req: Request, res: Response, next: NextFunction) => {
const carrier = req.query.carrier ?? ''
models.sequelize.query('SELECT * FROM Deliveries WHERE name = ?', { replacements: [carrier] })
models.sequelize.query(`SELECT * FROM Deliveries WHERE name = '${carrier}'`)

@zeropath-ai-staging zeropath-ai-staging Bot Sep 9, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SQL Injection in shipmentTrace route (routes/shipmentTrace.ts) (Severity: CRITICAL)

The query parameter carrier is interpolated directly into SQL, which can lead to an unauthenticated attacker altering the WHERE clause and reading arbitrary data. This occurs because the code uses a string-concatenated query in lines around the shipmentTrace function instead of parameter binding, resulting in possible quote-based payloads and data exposure.
View details in ZeroPath

Suggested change
models.sequelize.query(`SELECT * FROM Deliveries WHERE name = '${carrier}'`)
models.sequelize.query('SELECT * FROM Deliveries WHERE name = ?', { replacements: [carrier] })

💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.

All commands

.then(([rows]: any) => {
res.json({ carrier, rows })
}).catch((error: Error) => {
Expand Down