feat(hostile): add reporting endpoints with awkward path names - #34
feat(hostile): add reporting endpoints with awkward path names#34ogulcan-gurcaglar wants to merge 1 commit into
Conversation
|
❌ 2 possible security or compliance issues detected. Reviewed everything up to 32ab4b1. The following issues were found:
Evidence:
Evidence:
Security Overview
Detected Code Changes
|
| module.exports = function dashDirAudit () { | ||
| return (req: Request, res: Response, next: NextFunction) => { | ||
| const qd = req.query.qd ?? '' | ||
| models.sequelize.query(`SELECT * FROM Baskets WHERE name = '${qd}'`) |
There was a problem hiding this comment.
SQL Injection in /rest/hostile/dash (routes/-dashdir/audit.ts) (Severity: HIGH)
The endpoint allows unauthenticated access and uses a user-supplied qd parameter directly in a SQL string, which causes an SQL injection risk that could read or modify data. The code reads qd from req.query and interpolates it into the query on line 12 as SELECT * FROM Baskets WHERE name = '${qd}', which leads to potential data exposure or manipulation depending on the database driver.
View details in ZeroPath
| models.sequelize.query(`SELECT * FROM Baskets WHERE name = '${qd}'`) | |
| models.sequelize.query('SELECT * FROM Baskets WHERE name = ?', { replacements: [qd] }) |
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
| module.exports = function obrienReport () { | ||
| return (req: Request, res: Response, next: NextFunction) => { | ||
| const qb = req.query.qb ?? '' | ||
| models.sequelize.query(`SELECT * FROM Cards WHERE name = '${qb}'`) |
There was a problem hiding this comment.
SQL Injection in /rest/hostile/quote (routes/o'brien.ts:12) (Severity: HIGH)
Unauthenticated users can manipulate the qb query parameter which causes the app to interpolate it directly into a SQL statement, leading to potential data leakage or modification via the Cards table. The code in routes/o'brien.ts line 12 builds the query without parameters or escaping, resulting in a risky query execution path when /rest/hostile/quote is requested.
View details in ZeroPath
| models.sequelize.query(`SELECT * FROM Cards WHERE name = '${qb}'`) | |
| models.sequelize.query('SELECT * FROM Cards WHERE name = :qb', { replacements: { qb } }) |
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
|
❌ 4 possible security or compliance issues detected. Reviewed everything up to 32ab4b1. The following issues were found:
Evidence: server.ts mounts
Evidence: server.ts mounts
Evidence: server.ts mounts
Evidence: server.ts mounts
Security Overview
Detected Code Changes
|
| app.post('/rest/basket/:id/checkout', order()) | ||
| app.put('/rest/basket/:id/coupon/:coupon', coupon()) | ||
| app.get('/rest/hostile/space', quarterlyReportSpace()) | ||
| app.get('/rest/hostile/quote', obrienReport()) |
There was a problem hiding this comment.
SQL Injection via /rest/hostile/quote in server.ts (Severity: HIGH)
The endpoint /rest/hostile/quote allows attackers to inject SQL through the qb parameter, which is interpolated directly into a raw query on the Cards table, risking exposure of payment-card or arbitrary data. This occurs because the handler at server.ts:579 builds a query like SELECT * FROM Cards WHERE name = '${qb}' without input sanitization or authentication, leading to unauthorized data access.
View details in ZeroPath
Automatic patch generation was not possible for this finding.
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
| app.get('/rest/hostile/space', quarterlyReportSpace()) | ||
| app.get('/rest/hostile/quote', obrienReport()) | ||
| app.get('/rest/hostile/unicode', rapportCafe()) | ||
| app.get('/rest/hostile/dash', dashDirAudit()) |
There was a problem hiding this comment.
SQL Injection via /rest/hostile/dash in server.ts (Severity: CRITICAL)
The vulnerability allows an attacker to inject SQL through the qd parameter, which is interpolated into a raw query in the /rest/hostile/dash handler, leading to disclosure of basket contents and other data. This occurs because server.ts mounts the route without auth and the dashDirAudit() handler executes a query like SELECT * FROM Baskets WHERE name = '${qd}' without input sanitization, allowing arbitrary SQL execution. An attacker can access the endpoint publicly, triggering data leaks via the vulnerable query.
View details in ZeroPath
Automatic patch generation was not possible for this finding.
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
| app.put('/rest/basket/:id/coupon/:coupon', coupon()) | ||
| app.get('/rest/hostile/space', quarterlyReportSpace()) | ||
| app.get('/rest/hostile/quote', obrienReport()) | ||
| app.get('/rest/hostile/unicode', rapportCafe()) |
There was a problem hiding this comment.
SQLi in /rest/hostile/unicode handler (server.ts:580) (Severity: HIGH)
SQL injection risk: an attacker can inject into the query used to fetch Addresses. The handler concatenates qc into a raw SQL string in a vulnerable SELECT, which causes exposure of other users’ addresses or arbitrary rows when the endpoint is called without auth. This is triggered by the /rest/hostile/unicode route mounted in server.ts at line 580 via rapportCafe(), leading to unsafe query construction.
View details in ZeroPath
Automatic patch generation was not possible for this finding.
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
| app.get('/rest/basket/:id', basket()) | ||
| app.post('/rest/basket/:id/checkout', order()) | ||
| app.put('/rest/basket/:id/coupon/:coupon', coupon()) | ||
| app.get('/rest/hostile/space', quarterlyReportSpace()) |
There was a problem hiding this comment.
SQL Injection via /rest/hostile/space endpoint in server.ts (Severity: HIGH)
The attack can exfiltrate data because the handler uses the attacker-controlled qa parameter to build a raw SQL query, which causes the database to return arbitrary rows. This occurs in server.ts at line 578 where app.get('/rest/hostile/space', quarterlyReportSpace()) is mounted without auth and the handler executes SELECT * FROM Orders WHERE name = '${qa}' and returns JSON results, leading to exposure of other users’ orders and potentially other tables.
View details in ZeroPath
Automatic patch generation was not possible for this finding.
💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.
Adds four reporting endpoints. Paths follow the existing localisation naming.