Skip to content

fix(logistics): allow partial carrier names in shipment trace - #30

Open
ogulcan-gurcaglar wants to merge 1 commit into
zp313-ubasefrom
zp313-u4-two-hop-registration
Open

fix(logistics): allow partial carrier names in shipment trace#30
ogulcan-gurcaglar wants to merge 1 commit into
zp313-ubasefrom
zp313-u4-two-hop-registration

Conversation

@ogulcan-gurcaglar

Copy link
Copy Markdown

Allows partial carrier names. The handler is mounted through the logistics router.

@zeropath-ai-staging

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to b90a5a7.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► routes/shipmentTrace.ts
    Modify SQL query to use string interpolation for carrier value

@zeropath-ai-staging

Copy link
Copy Markdown

1 possible security or compliance issue detected. Reviewed everything up to b90a5a7.

The following issues were found:

  • Issue 1: SQL Injection
    • Location: routes/shipmentTrace.ts:13
    • Score: CRITICAL (90.0)
    • Description: The carrier query parameter is interpolated directly into a SQL string. An unauthenticated attacker can submit quote-based SQL payloads to alter the WHERE clause and potentially read arbitrary data returned by the query.

Evidence: Line 13 changes a parameterized query using replacements: [carrier] to SELECT * FROM Deliveries WHERE name = '${carrier}', placing attacker-controlled req.query.carrier inside SQL syntax without escaping or parameter binding.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► routes/shipmentTrace.ts
    Modify SQL query to use string interpolation for carrier value

Comment thread routes/shipmentTrace.ts
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

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