You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security(files): the sensitive-file rule misses common credential files (prod.env, credentials, .git-credentials, .pgpass, *.p12) #683
Found in the #594 security audit. Severity: medium. Status: confirmed (failing test).
Affected code
crates/tole-core/src/sensitive.rs:22is_sensitive_name: .env* (prefix only), .npmrc, .netrc, *.pem, *.key, id_*. Used by read_file (read_file.rs:164), the git diff filter and cora_search hits.
Problem
read_file is Risk::ReadOnly (no approval). Any credential file outside the six patterns is returned verbatim, and its values are usually NOT in the SecretSet (they were never in tole's env), so they reach the provider and the durable log as is. Not sensitive today: prod.env, config.env (docker env_file convention, suffix not prefix), credentials (AWS), .git-credentials, .pgpass, .htpasswd, secrets.yaml, terraform.tfvars, *.p12, *.pfx, .pypirc, .dockercfg, kubeconfig. A hard link to .env under another name is also not caught (only the requested name and the canonical path are checked, both of which are the link's name); low, since creating one needs a command.
Scenario
A repository keeps deploy/production.env (gitignored, present on the dev machine). An injection in an issue asks the model to "check the deploy config"; read_file returns the database password and API keys to the provider without any prompt.
Reproduction
Scratch test crates/tole-core/tests/audit_594.rs::common_secret_files_are_sensitive lists the names above as not sensitive.
Suggested fix
Extend the rule: *.env and *.env.* suffixes, credentials, .git-credentials, .pgpass, .htpasswd, .pypirc, .dockercfg, config.json under .docker/, *.p12, *.pfx, *.jks, *.keystore, *.tfvars, kubeconfig, secrets.y*ml; make the list configurable (user layer adds, project layer can only add).
Optionally check the inode link count (nlink > 1 on a regular file) and treat it as sensitive when any other name would be.
Activity
fix(doctor): derive the sensitive files line from the built-in rule l…