fix(logistics): allow partial carrier names in shipment trace - #30
fix(logistics): allow partial carrier names in shipment trace#30ogulcan-gurcaglar wants to merge 1 commit into
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to b90a5a7. Security Overview
Detected Code Changes
|
|
❌ 1 possible security or compliance issue detected. Reviewed everything up to b90a5a7. The following issues were found:
Evidence: Line 13 changes a parameterized query using
Security Overview
Detected Code Changes
|
| 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}'`) |
There was a problem hiding this comment.
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
| 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.
Allows partial carrier names. The handler is mounted through the logistics router.