Security: API key suffix leaked in tracing logs (providers/reliable.rs)
Summary
src/openhuman/providers/reliable.rs — rotate_key() logs the last 4 characters of the API key in a tracing::info! call. With multiple key rotations, an attacker with log access can reconstruct significant portions of short API keys.
Location
src/openhuman/providers/reliable.rs — rotate_key() method
Impact
Medium — Partial key material leaked to logs. Combined with log aggregation or Sentry capture, this can narrow key search space significantly.
Suggested Fix
Log only the key slot index: tracing::info!("Rotated to key slot {}/{}", current_idx + 1, total_keys) — no key material at all.
I rechecked current origin/main and this looks stale/resolved.
Evidence:
- The path in the issue,
src/openhuman/providers/reliable.rs, no longer exists onmain; the current implementation is undersrc/openhuman/inference/provider/reliable.rs. - Current
rotate_key()only advances the index and returns the selected key:let idx = self.key_index.fetch_add(1, Ordering::Relaxed) % self.api_keys.len();Some(&self.api_keys[idx])
- I did not find the described
tracing::info!that logs a key suffix / last 4 chars in the current reliable provider.
I think this issue can be closed unless there is another current log path still emitting key material.
Verified: the file has moved to src/openhuman/inference/provider/reliable.rs and the current rotate_key() no longer logs key material. Closing as stale — thanks @honor2030 for verifying.