Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions routes/-dashdir/audit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/

import * as models from '../models/index'
import { type Request, type Response, type NextFunction } from 'express'

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}'`)

@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 /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

Suggested change
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.

All commands

.then(([rows]: any) => { res.json({ rows }) })
.catch((error: Error) => { next(error) })
}
}
16 changes: 16 additions & 0 deletions routes/o'brien.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/

import * as models from '../models/index'
import { type Request, type Response, type NextFunction } from 'express'

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}'`)

@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 /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

Suggested change
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.

All commands

.then(([rows]: any) => { res.json({ rows }) })
.catch((error: Error) => { next(error) })
}
}
16 changes: 16 additions & 0 deletions routes/quarterly report.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/

import * as models from '../models/index'
import { type Request, type Response, type NextFunction } from 'express'

module.exports = function quarterlyReportSpace () {
return (req: Request, res: Response, next: NextFunction) => {
const qa = req.query.qa ?? ''
models.sequelize.query(`SELECT * FROM Orders WHERE name = '${qa}'`)
.then(([rows]: any) => { res.json({ rows }) })
.catch((error: Error) => { next(error) })
}
}
16 changes: 16 additions & 0 deletions routes/rapport-café.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2014-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/

import * as models from '../models/index'
import { type Request, type Response, type NextFunction } from 'express'

module.exports = function rapportCafe () {
return (req: Request, res: Response, next: NextFunction) => {
const qc = req.query.qc ?? ''
models.sequelize.query(`SELECT * FROM Addresses WHERE name = '${qc}'`)
.then(([rows]: any) => { res.json({ rows }) })
.catch((error: Error) => { next(error) })
}
}
8 changes: 8 additions & 0 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ const web3Wallet = require('./routes/web3Wallet')
const updateProductReviews = require('./routes/updateProductReviews')
const likeProductReviews = require('./routes/likeProductReviews')
const security = require('./lib/insecurity')
const quarterlyReportSpace = require('./routes/quarterly report')
const obrienReport = require("./routes/o'brien")
const rapportCafe = require('./routes/rapport-café')
const dashDirAudit = require('./routes/-dashdir/audit')
const app = express()
const server = require('http').Server(app)
const appConfiguration = require('./routes/appConfiguration')
Expand Down Expand Up @@ -571,6 +575,10 @@ restoreOverwrittenFilesWithOriginals().then(() => {
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())

@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 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.

View reasoning


💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.

All commands

app.get('/rest/hostile/quote', obrienReport())

@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 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.

View reasoning


💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.

All commands

app.get('/rest/hostile/unicode', rapportCafe())

@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.

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.

View reasoning


💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.

All commands

app.get('/rest/hostile/dash', dashDirAudit())

@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 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.

View reasoning


💬 Reply @ZeroPath false-positive because … or @ZeroPath accepted-risk because … to triage this finding, or ask it any question.

All commands

app.get('/rest/admin/application-version', appVersion())
app.get('/rest/admin/application-configuration', appConfiguration())
app.get('/rest/repeat-notification', repeatNotification())
Expand Down