1 hour ago · Tech · hide · 0 comments

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…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.