feat(ventes): add the regional sales report endpoint - #37
ogulcan-gurcaglar wants to merge 1 commit into
Conversation
|
❌ 1 possible security or compliance issue detected. Reviewed everything up to af763c1. The following issues were found:
Evidence: server.ts line 575 mounts
Security Overview
Detected Code Changes
|
| module.exports = function ventesReport () { | ||
| return (req: Request, res: Response, next: NextFunction) => { | ||
| const région = req.query.région ?? '' | ||
| models.sequelize.query(`SELECT * FROM Deliveries WHERE name = '${région}'`) |
There was a problem hiding this comment.
SQL Injection in ventesReport GET /rest/ventes/report (Severity: HIGH)
SQL injection risk: an anonymous user can manipulate the query by supplying région, since the value is interpolated directly into the SQL without authentication, parameterization, or escaping. This leads to potential data leakage or modification as the region parameter flows from req.query.région into the SELECT statement in routes/ventesReport.ts:13.
View details in ZeroPath
| models.sequelize.query(`SELECT * FROM Deliveries WHERE name = '${région}'`) | |
| models.sequelize.query('SELECT * FROM Deliveries WHERE name = :region', { replacements: { region: région } }) |
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
|
❌ 1 possible security or compliance issue detected. Reviewed everything up to af763c1. The following issues were found:
Evidence:
Security Overview
Detected Code Changes
|
| module.exports = function ventesReport () { | ||
| return (req: Request, res: Response, next: NextFunction) => { | ||
| const région = req.query.région ?? '' | ||
| models.sequelize.query(`SELECT * FROM Deliveries WHERE name = '${région}'`) |
There was a problem hiding this comment.
SQL Injection in ventésReport endpoint (routes/ventesReport.ts) (Severity: HIGH)
Unauthenticated input in the /rest/ventes/report endpoint allows SQL injection: the région query parameter is interpolated into a SQL query in routes/ventesReport.ts which causes the WHERE clause to be altered. This input is used directly in a Sequelize raw query without binding or escaping, leading to potential data disclosure or modification.
View details in ZeroPath
| models.sequelize.query(`SELECT * FROM Deliveries WHERE name = '${région}'`) | |
| models.sequelize.query('SELECT * FROM Deliveries WHERE name = ?', { replacements: [région] }) |
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
Adds the regional sales report endpoint.