Skip to content

Build your personal knowledge base with Trilium Notes

Potential fix for pull request finding 'CodeQL / Information exposure through a stack trace'

Elian Doran3536a3ca164a
diff --git a/apps/server/src/routes/electron.ts b/apps/server/src/routes/electron.ts
index d115a0c548..9f40e54c78 100644
--- a/apps/server/src/routes/electron.ts
+++ b/apps/server/src/routes/electron.ts
@@ -25,7 +25,7 @@ function init(app: Application) {
return await dispatch(app, request);
} catch (err) {
console.error(`[trilium-app] dispatch failed for ${request.method} ${request.url}:`, err);
- return new Response(String((err as Error)?.stack ?? err), { status: 500 });
+ return new Response("Internal Server Error", { status: 500 });
}
});
});