Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    skill-credential-access-v1

    View as Markdown

    17 rules · Keryn Software Licence · rules 0.8.0 · all packs

    How to read a rule
    Severity
    How bad the finding is if it is real: error fails a default gate, warning and info do not.
    Confidence
    P0 exploitable as written; P1 dangerous in context; P2 a heuristic or a posture check: confirm by reading the code.
    False-positive risk
    low: an exact API or flag, so hits are almost always real; medium: the pattern is legitimate in many programs, so check each hit; high: it finds a lead to confirm, so expect benign hits.
    Edge
    The relationship the finding sits on. reaches: content or traffic gets to a thing; calls: one thing invokes another; reads: one thing reads from another; writes: one thing writes to another; sends: data leaves for another party; grants: authority is given or left unchecked; depends_on: something relies on a component it does not verify; trusts: one party believes another without evidence. The boundary it crosses, when there is one: user->prompt (untrusted input reaching a prompt); model->code (model output reaching code, a shell, a query or a page); secret->outside (a secret leaving the trusted side); supply-chain (code, models or prompts pulled in from outside).
    Taxonomy chips
    References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

    error generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads, copies or uploads SSH key material (a private key under ~/.ssh, authorized_keys, known_hosts, or an ssh-add -L dump). A skill that gathers these hands the developer’s remote access to whoever receives the output. Remove the step; if a tool needs SSH, let ssh-agent or the user’s own client use the key.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Delete the instruction. Keys never need to be read by a skill: use ssh-agent forwarding, a deploy key scoped to one repository, or ask the user to run the command themselves.

    References: https://code.claude.com/docs/en/skills · https://man.openbsd.org/ssh-add

    keryn.skillcred.cloud-credential-file-read

    Section titled “keryn.skillcred.cloud-credential-file-read”

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads or copies a cloud or cluster credential file (~/.aws/credentials, gcloud ADC or credential database, ~/.azure token cache, ~/.kube/config, ~/.docker/config.json, or the file named by GOOGLE_APPLICATION_CREDENTIALS). These files hold long-lived keys that grant account access. Do not read them from a skill; use the cloud CLI’s own session.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 CWE-312 LLM02 LLM06 ASI02 ASI03

    Fix: Remove the read. If a step needs cloud access, call the CLI (aws, gcloud, az, kubectl) so the credential never enters the transcript, and scope the identity to the task.

    References: https://code.claude.com/docs/en/skills · https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html · https://raw.githubusercontent.com/googleapis/google-auth-library-python/main/google/auth/_cloud_sdk.py · https://raw.githubusercontent.com/Azure/azure-cli/dev/src/azure-cli-core/azure/cli/core/auth/identity.py

    keryn.skillcred.cloud-secret-env-or-token-print

    Section titled “keryn.skillcred.cloud-secret-env-or-token-print”

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script prints a cloud secret variable (AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AZURE_CLIENT_SECRET) or pipes a freshly minted access token (gcloud auth print-access-token, az account get-access-token, aws configure export-credentials) to a file or network tool. The value lands in the transcript or leaves the machine. Use the token inside the same command that needs it and never echo it.

    Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Do not display or store cloud tokens. Pass them to the consuming command through the environment or a subshell inside the same line, and prefer short-lived credentials with narrow scope.

    References: https://docs.cloud.google.com/sdk/gcloud/reference/auth/print-access-token · https://learn.microsoft.com/en-us/cli/azure/account#az-account-get-access-token · https://docs.aws.amazon.com/cli/latest/reference/configure/export-credentials.html

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads a package-manager or VCS credential (~/.npmrc, ~/.pypirc, ~/.netrc, ~/.git-credentials, ~/.config/gh/hosts.yml, git credential fill, or a gh auth token piped out). These hold publish and repository tokens that enable supply-chain attacks. Do not read them; let git, npm or gh authenticate by themselves.

    Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 CWE-312 LLM02 LLM06 ASI02 ASI03

    Fix: Delete the step. Authenticate git, npm, pip and gh through their credential helpers, and use fine-grained or OIDC tokens in CI rather than files a skill can read.

    References: https://code.claude.com/docs/en/skills · https://git-scm.com/docs/git-credential · https://cli.github.com/manual/gh_auth_token · https://raw.githubusercontent.com/cli/cli/trunk/internal/config/config.go

    keryn.skillcred.cloud-metadata-endpoint-access

    Section titled “keryn.skillcred.cloud-metadata-endpoint-access”

    error generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script calls a cloud instance-metadata endpoint (169.254.169.254, metadata.google.internal, 100.100.100.200, fd00:ec2::254). On a cloud VM or CI runner this returns the instance role’s temporary credentials. A skill has no reason to request them; remove the call and enforce IMDSv2 with a hop limit of 1.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-918 CWE-522 LLM02 LLM06 ASI02 ASI03

    Fix: Remove the metadata request. If the workload needs cloud identity, use the SDK’s default credential chain, require IMDSv2 and a hop limit of 1, and block link-local metadata addresses from agent sandboxes.

    References: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html · https://docs.cloud.google.com/compute/docs/metadata/overview

    keryn.skillcred.macos-keychain-secret-read

    Section titled “keryn.skillcred.macos-keychain-secret-read”

    error generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads secrets from the macOS login keychain or another OS secret store (security find-generic-password, find-internet-password, dump-keychain, security export, secret-tool lookup, vaultcmd). The keychain holds saved passwords and tokens for every app. Remove the call; ask the user to supply the one value needed.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Do not enumerate or read keychain items from a skill. If an integration needs a secret, have the user store it in the tool’s own config or pass it through an environment variable they control.

    References: https://ss64.com/mac/security.html · https://support.apple.com/guide/security/keychain-data-protection-secb0694df1a/web

    keryn.skillcred.browser-credential-store-read

    Section titled “keryn.skillcred.browser-credential-store-read”

    error generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads a browser credential store (Chrome or Chromium Login Data, Cookies, Local State; Firefox logins.json, key4.db, cookies.sqlite; Safari Cookies.binarycookies). Those files contain saved passwords and live session cookies, so reading them is account takeover. Remove the step.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Never read browser profiles. If a task needs an authenticated session, use the browser automation tool with a dedicated profile the user logs into, not the user’s real profile files.

    References: https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data · https://chromium.googlesource.com/chromium/src/+/main/docs/user_data_dir.md

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads or copies crypto-wallet material (wallet.dat, Solana id.json, Ethereum keystore files, Electrum or Exodus wallet files, the MetaMask extension storage). Possession of these files can drain funds. Remove the step; no development task needs wallet files.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Delete the instruction. Keep wallet keys on hardware devices and out of the development machine’s readable paths; a skill must never be given them.

    References: https://developer.bitcoin.org/reference/rpc/ · https://docs.anza.xyz/cli/wallets/file-system

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script dumps the whole process environment (env, printenv, export -p, Get-ChildItem Env:, json.dumps(os.environ)) into a file, a pipe to a network or encoding tool, or a command substitution. The environment usually holds API keys and tokens. Name the single variable you need instead.

    Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-200 CWE-526 CWE-532 LLM02 LLM06 ASI02 ASI03

    Fix: Read only the specific variable required, inside the command that uses it. Never serialise the whole environment to disk, a log or a network call.

    References: https://code.claude.com/docs/en/skills · https://pubs.opengroup.org/onlinepubs/9699919799/utilities/env.html

    keryn.skillcred.dotenv-file-read-or-upload

    Section titled “keryn.skillcred.dotenv-file-read-or-upload”

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script prints, packs or uploads a .env file (cat .env, curl -F file=@.env, scp or tar of .env, pipe to a network tool). .env files hold the project’s live secrets, and printing one puts them in the model transcript. Reference variable names instead, or ask the user for the one value.

    Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Do not open .env files from a skill. Keep the file out of the agent’s readable paths where possible, document variable names in .env.example, and have the user export the one value needed.

    References: https://code.claude.com/docs/en/settings · https://12factor.net/config

    keryn.skillcred.os-credential-database-access

    Section titled “keryn.skillcred.os-credential-database-access”

    error generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads an operating-system credential database (/etc/shadow, /etc/gshadow, the Windows SAM/SYSTEM hives, ntds.dit) or runs a credential dumper against LSASS. This yields password hashes for every local account. Remove the step.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Remove the step. Account databases are never needed for development tasks; if a skill needs to check a user, call the platform’s user-management API with a scoped identity.

    References: https://man7.org/linux/man-pages/man5/shadow.5.html · https://learn.microsoft.com/en-us/windows-server/security/windows-authentication/credentials-processes-in-windows-authentication

    keryn.skillcred.container-escape-from-skill

    Section titled “keryn.skillcred.container-escape-from-skill”

    error generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script uses a container-escape or host-takeover primitive: the Docker socket mounted or called, docker run –privileged or a host root mount, nsenter into PID 1, chroot /host, or a host block device mounted. That gives the skill root on the host outside any sandbox. Remove it.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-250 CWE-269 LLM06 ASI05 ASI03

    Fix: Remove it and run skills in a sandbox without the Docker socket, host mounts, extra capabilities or host PID namespace. Use rootless containers for builds that need Docker.

    References: https://docs.docker.com/engine/security/ · https://man7.org/linux/man-pages/man1/nsenter.1.html

    keryn.skillcred.other-agent-credential-read

    Section titled “keryn.skillcred.other-agent-credential-read”

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads another agent’s credential or token store (~/.claude/.credentials.json, ~/.codex/auth.json, ~/.gemini/oauth_creds.json, Copilot hosts.json, ~/.cursor/mcp.json or state database, the Claude Code keychain item). Those files hold the user’s model-provider sessions. Remove the read; each agent must keep its own login.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI03 ASI07

    Fix: Delete the instruction. Agent logins are per-tool secrets; a skill that needs model access should call the host agent’s own API, not lift its tokens.

    References: https://code.claude.com/docs/en/iam · https://code.claude.com/docs/en/skills

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script sweeps the home directory or whole filesystem for secrets (find for id_rsa, *.pem, .env or *token* files, grep -r for private-key headers or well-known key prefixes, or a prose instruction to search the machine for passwords and keys). A sweep is how stolen credential bundles are built. Remove it.

    Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-200 CWE-522 LLM02 LLM06 ASI02 ASI03

    Fix: Remove the sweep. If a task needs to find a config file, name the exact path inside the project; if the goal is secret hygiene, run a dedicated scanner on the repository in CI, never from a skill on the developer’s home.

    References: https://code.claude.com/docs/en/skills · https://man7.org/linux/man-pages/man1/find.1.html

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads a shell or REPL history file (~/.bash_history, ~/.zsh_history, fish_history, ~/.python_history, ~/.psql_history, ~/.mysql_history, PowerShell ConsoleHost_history). History routinely contains pasted tokens and passwords. Remove the read.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-200 CWE-532 LLM02 LLM06 ASI02 ASI03

    Fix: Do not read history files. If previous commands matter, ask the user to paste the specific lines, after removing secrets.

    References: https://www.gnu.org/software/bash/manual/html_node/Bash-History-Facilities.html · https://code.claude.com/docs/en/skills

    keryn.skillcred.secret-manager-or-keyring-export

    Section titled “keryn.skillcred.secret-manager-or-keyring-export”

    error generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script exports or reveals secrets from a password manager or key store (gpg –export-secret-keys, bw export or get password, op item get –reveal, pass show, keepassxc-cli, lpass export, a .kdbx database, ~/.password-store, ~/.gnupg private keys). These are the user’s highest-value secrets. Remove the step.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 LLM02 LLM06 ASI02 ASI03

    Fix: Remove the command. Secret managers should release a secret only to the process that needs it, interactively approved by the user; a skill must not enumerate or export vault contents.

    References: https://www.gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html · https://bitwarden.com/help/cli/ · https://www.1password.dev/cli/reference/management-commands/item · https://www.1password.dev/cli/reference/management-commands/item/

    keryn.skillcred.service-credential-config-read

    Section titled “keryn.skillcred.service-credential-config-read”

    warning generic agent-skills, claude-code, prompt-injection

    A skill, command or hook script reads or copies a service credential file (.pgpass, .my.cnf, .vault-token, .s3cfg, rclone.conf, Terraform credentials.tfrc.json, ~/.oci/config, .databrickscfg, .ngrok2 config, doctl or Heroku config). These hold database passwords and API tokens. Remove the read and use the tool’s own authenticated CLI.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: grants authority is given or left unchecked.

    CWE-522 CWE-200 CWE-312 LLM02 LLM06 ASI02 ASI03

    Fix: Delete the read. Authenticate through the service CLI or an identity-based connection, and keep these files out of any path the agent can read.

    References: https://www.postgresql.org/docs/current/libpq-pgpass.html · https://developer.hashicorp.com/terraform/cli/config/config-file