feat(tenant): add tenant report endpoint - #31
ogulcan-gurcaglar wants to merge 1 commit into
Conversation
|
❌ 1 possible security or compliance issue detected. Reviewed everything up to 251bae9. The following issues were found:
Evidence:
Security Overview
Detected Code Changes
|
| module.exports = function tenantReport () { | ||
| return (req: Request, res: Response, next: NextFunction) => { | ||
| const tenant = req.query.tenant ?? '' | ||
| models.sequelize.query(`SELECT * FROM Users WHERE email = '${tenant}'`) |
There was a problem hiding this comment.
SQL Injection in GET /rest/tenant/report (tenant param) (Severity: HIGH)
The endpoint accepts a tenant query parameter and directly embeds it into a SQL query, which causes an attacker-controlled value to alter the WHERE clause or run additional statements. This occurs in routes/tenantReport.ts where req.query.tenant is interpolated into the SELECT * FROM Users query, and the lack of authentication on server.ts:575 permits unauthenticated access.
View details in ZeroPath
| models.sequelize.query(`SELECT * FROM Users WHERE email = '${tenant}'`) | |
| models.sequelize.query('SELECT * FROM Users WHERE email = ?', { replacements: [String(tenant)] }) |
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
|
✅ No security or compliance issues detected. Reviewed everything up to 251bae9. Security Overview
Detected Code Changes
|
Adds the tenant report endpoint.