Skip to content

BYOK API key stored in plaintext in world-readable (0644) config.yaml #159

Description

@superbigcup325

mcode 0.4.12, npm install, Linux, Node v26.8.2

BYOK API keys are stored in plaintext in ~/.minimax/config.yaml with mode
0644 (world-readable), despite provider add --api-key-env suggesting the key
stays referenced by environment variable name:

$ stat -c '%a %n' ~/.minimax/config.yaml
644 /home/cyanthus/.minimax/config.yaml

$ grep -A2 'custom_provider:' ~/.minimax/config.yaml
custom_provider:
  atria:
    ...
    options:
      apiKey: atr_...   # plaintext value, not "ATRIA_API_KEY"

The adjacent auth/ directory is created 0700, so the intent is clearly
there — config.yaml just doesn't get the same treatment.

For comparison:

SECURITY.md also tells users to "Restrict local access" on the data
directory — hard to follow when the provider config is 644 under a 755
parent.

Suggestion (any of):

  1. chmod 0600 on config.yaml at creation and on write
  2. store the env var name (the CLI already accepts --api-key-env) and
    resolve at runtime instead of storing the value
  3. keychain where available

Happy to provide more details if useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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