fix(gateway): sanitize error responses to prevent information disclosure

Replace raw error messages with generic 'Internal Server Error' to prevent
leaking internal error details to unauthenticated HTTP clients.

Fixes #2383
This commit is contained in:
Robby (AI-assisted)
2026-01-26 21:03:41 +00:00
committed by Shadow
parent 91d5ea6e33
commit 5aa02cf3f7

View File

@@ -291,10 +291,10 @@ export function createGatewayHttpServer(opts: {
res.statusCode = 404;
res.setHeader("Content-Type", "text/plain; charset=utf-8");
res.end("Not Found");
} catch (err) {
} catch {
res.statusCode = 500;
res.setHeader("Content-Type", "text/plain; charset=utf-8");
res.end(String(err));
res.end("Internal Server Error");
}
}