Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/cli/utils/pid.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function waitForServer(port, timeout = 15000) {
const start = Date.now();
while (Date.now() - start < timeout) {
try {
const res = await fetch(`http://localhost:${port}/api/health`, {
const res = await fetch(`http://localhost:${port}/api/monitoring/health`, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Using /api/monitoring/health as a public health check is a security risk. The endpoint returns sensitive data including active session IDs and provider details (see buildHealthPayload in src/lib/monitoring/observability.ts). Exposing this without authentication allows for potential session hijacking. Consider using a minimal, non-sensitive endpoint for readiness checks or securing the monitoring route.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change modifies production code in bin/ without including tests, violating Repository Style Guide Rule 9. Please add unit tests in tests/unit/ to verify the waitForServer logic and ensure coverage requirements are met.

References
  1. Always include tests when changing production code (src/, open-sse/, electron/, bin/). (link)

signal: AbortSignal.timeout(2000),
});
if (res.ok) return true;
Expand Down