Skip to content

[Security] Error details leaked to unauthenticated clients in HTTP handler #2383

@robbyczgw-cla

Description

@robbyczgw-cla

Summary

Internal error details are exposed to unauthenticated HTTP clients.

Location

src/gateway/server-http.ts (compiled: dist/gateway/server-http.js)

Problem

// Line ~178-181 in compiled JS
} catch (err) {
  res.statusCode = 500;
  res.end(String(err));  // Exposes internal error details
}

This catch block is reached before authentication (loadConfig at line 151 can throw).

Impact

  • Unauthenticated users can receive internal error messages
  • May leak file paths, config structure, or other sensitive info
  • Severity: MEDIUM

Suggested Fix

} catch (err) {
  logError('HTTP handler error:', err);
  res.statusCode = 500;
  res.end('Internal Server Error');  // Generic message
}

Verification

Confirmed by code analysis with Codex CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions