Skip to content

Commit 5482d90

Browse files
committed
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
1 parent c03a9b4 commit 5482d90

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

mcp-server/src/handlers/sse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export async function handleMessage(req: Request, res: Response) {
8888

8989
body = JSON.stringify(req.body);
9090
} catch (error) {
91-
res.status(400).json(error);
91+
res.status(400).json({ error: "Bad request" });
9292
logger.error('Bad POST request', error as Error, {
9393
sessionId,
9494
contentType: req.headers['content-type']

mcp-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ app.get("/styles.css", staticFileRateLimit, (req, res) => {
229229
});
230230

231231
// Splash page
232-
app.get("/", (req, res) => {
232+
app.get("/", staticFileRateLimit, (req, res) => {
233233
const splashPath = path.join(__dirname, "static", "index.html");
234234
res.sendFile(splashPath);
235235
});

0 commit comments

Comments
 (0)