From 986c4cae6cc6e7f300866f46624de2f22c4a4630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=E1=BA=A7n=20B=C3=A1ch?= <45133811+barttran2k@users.noreply.github.com> Date: Tue, 7 Apr 2026 00:09:34 +0700 Subject: [PATCH] fix(security): undefined variable `next` referenced in route erro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GET /schema route handler's function signature is `(req, res)` (only two parameters), but the catch block calls `next(err)`. Since `next` is not defined in this scope, this will throw a `ReferenceError` at runtime when an error occurs, potentially crashing the process or causing an unhandled rejection instead of properly returning an error response. Affected files: schema.js Signed-off-by: Trần Bách <45133811+barttran2k@users.noreply.github.com> --- backend/routes/schema.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/routes/schema.js b/backend/routes/schema.js index 86bc18660d..0a57c57c87 100644 --- a/backend/routes/schema.js +++ b/backend/routes/schema.js @@ -18,7 +18,7 @@ router /** * GET /schema */ - .get(async (req, res) => { + .get(async (req, res, next) => { try { const swaggerJSON = await getCompiledSchema();