Global rotate ignores a per-env key that lives only in keychain or pass

Open
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
shell
Domain
cli, security

Research direction

Start at bin/xenv around line 1940, where the global rotate decides which key to use, and at lookup_key, which already probes per-env sources. Reproduce by storing a per-env passphrase only in the keychain or pass with no keys/<env>.key, then running xenv key rotate without an @env argument. Done means the rotate completes for that env, with the per-env key resolved through the same probes that lookup_key uses.

Written by the indexing model from the issue text.

Description

bug

Files: bin/xenv:1940

Repro: Put a per-env passphrase only in the keychain, with no keys/.key. xenv key rotate (no @env) decrypts that env with the global key and dies before any rewrite. The vault is intact. The rotate cannot finish.

Fix: Decide uses _global with the same per-env probes as lookup_key, not only the .key file.


Found at 6e8d2b4 by three runs of a whole-repo review team (deploystrata/offload), then hand-checked against the code by Grok. Lines marked Reproduced were also run by Claude.

Dominant language
Shell
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ahoward/xenv

All issues in ahoward/xenv

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.