Fix security vulnerabilities identified by CodeQL

- Fix information exposure: return generic error instead of stack traces in sse.ts
- Add missing rate limiting to root route in index.ts
This commit is contained in:
Basil Hosmer 2025-10-06 21:38:33 -04:00
commit 5482d905a9
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -88,7 +88,7 @@ export async function handleMessage(req: Request, res: Response) {
body = JSON.stringify(req.body);
} catch (error) {
res.status(400).json(error);
res.status(400).json({ error: "Bad request" });
logger.error('Bad POST request', error as Error, {
sessionId,
contentType: req.headers['content-type']

View file

@ -229,7 +229,7 @@ app.get("/styles.css", staticFileRateLimit, (req, res) => {
});
// Splash page
app.get("/", (req, res) => {
app.get("/", staticFileRateLimit, (req, res) => {
const splashPath = path.join(__dirname, "static", "index.html");
res.sendFile(splashPath);
});