104 days ago · Tech · hide · Fediverse post

On WSL2 without a working keyring, gh auth login falls back to storing the token in plaintext at ~/.config/gh/hosts.yml. Worse, the OAuth token GitHub CLI issues . covers this problem well. This isn’t a theoretical risk. gh auth token shows up repeatedly as a credential-harvesting step in real npm supply chain attacks. Palo Alto Networks’ Unit 42 in the Mini Shai-Hulud campaign, where a malicious payload invoked Bun to run gh auth token alongside other credential-harvesting commands. To work around it, I set up , a CLI that issues a GitHub App User Access Token and refreshes it every 8 hours. A recently added feature lets you set the backend to agent, which instead of relying on a keyring. Here’s how I installed it, following . Before you start If you’ve ever run gh auth login on this WSL2 environment, a plaintext token is probably still sitting in ~/.config/gh/hosts.yml. Log out and invalidate it first. gh auth status # check current state gh auth logout Once the logout succeeds, the…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town