Skip to content

sec(router): deprecate plaintext api_key field in route config YAML #583

@cluster2600

Description

@cluster2600

Summary

RouteConfig in crates/openshell-router/src/config.rs (lines 26–28) accepts api_key directly as a YAML field alongside the more secure api_key_env (which reads from environment variables). This means real API keys could end up in config files on disk.

The ResolvedRoute struct does have a custom Debug impl that redacts the api_key field (line 56: .field("api_key", &"[REDACTED]")), preventing accidental logging — which is good.

Impact

  • Severity: Medium
  • Config files containing plaintext API keys may be committed to version control, included in backups, or exposed through file access.

Proposed Fix

  1. Emit a warning when plaintext api_key is used in config files
  2. Consider deprecating the api_key field in favour of api_key_env only
  3. Document the security implications in the config reference

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