Skip to content
MediumSecrets & credentialsBLWK-CRED-009

‹tool› stores a login token in plain text (‹path›) ​

What this means ​

‹path› holds ‹plaintext tokens› login token(s) for ‹tool›, written out in full. Anything that can read your home folder, a backup, or a package install script that goes looking can copy them and act as you on that service.

How to fix it ​

Move the token into your system keychain, then delete it from the file and revoke the old one.

  • GitHub CLI: run gh auth logout and gh auth login on a machine with a keyring (secret-service, macOS Keychain or Windows Credential Manager) so the token is not written to hosts.yml.

  • Cargo: set global-credential-providers = ["cargo:libsecret"] (or “cargo:macos-keychain”, “cargo:wincred”) in ~/.cargo/config.toml, then cargo login again.

  • Terraform: use a credentials helper, or set TF_TOKEN_<host> from your password manager instead of credentials.tfrc.json.

  • RubyGems: pass the key through GEM_HOST_API_KEY from your password manager when publishing.

  • Composer: provide auth through the COMPOSER_AUTH environment variable from your password manager.

  • netrc: use your tool's credential helper (for Git, a keychain-backed helper) instead of passwords in .netrc.

Check it yourself ​

Run a scan and look for BLWK-CRED-009 in the results:

sh
bulwark scan

Installed the standalone CLI package instead of the app? The command is bulwarkctl.

How Bulwark decides

Bulwark reads credential_stores and reports this check when:

text
kind in ["gh_hosts", "cargo_credentials", "terraform_credentials", "gem_credentials", "composer_auth", "netrc"] and plaintext_tokens > 0

If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.

References ​

Released under the Apache License 2.0.