hermes-control-interface icon indicating copy to clipboard operation
hermes-control-interface copied to clipboard

[BUG] Hardcoded API Key

Open stamandster opened this issue 7 months ago • 1 comments

Vulnerability Description A hardcoded API key was present in the source code, exposing gateway access to anyone who obtained the code.

Affected Code Location
server.js — embedded API key string

Risk Assessment
- Severity: Critical
- Impact: Unauthorized access to Gateway API, potential usage charges, data exposure

Fix Applied (v3.3.0)
Replaced hardcoded key with environment variable loading:
javascript
const GATEWAY_API_KEY = process.env.GATEWAY_API_KEY || loadGatewayApiKey();

function loadGatewayApiKey() {
  try {
    const configPath = path.join(os.homedir(), '.hermes', 'config.yaml');
    if (fs.existsSync(configPath)) {
      const cfg = yaml.load(fs.readFileSync(configPath, 'utf8'));
      return cfg?.platforms?.api_server?.extra?.key || '';
    }
  } catch {}
  return '';
}

stamandster avatar Apr 23 '26 14:04 stamandster

✅ Already fixed in v3.4.0

This issue was resolved in v3.4.0 but the issue was never closed. Confirming closure in v3.4.0 with the v3.5.0 release.

Release: https://github.com/xaspx/hermes-control-interface/releases/tag/v3.5.0

xaspx avatar Apr 27 '26 11:04 xaspx