fix: docs no longer claim project .env files are write-denied
_BLOCKED_PROJECT_ENV_BASENAMES is consulted only by get_read_block_error; project .env / .env.local / .envrc are read-denied but writable on both main and this branch, so the write-safety table row saying "anywhere on disk" was wrong. Denying writes would stop the agent from creating .env files for the user, so the doc is corrected rather than the behaviour changed. Review finding: security.md write-safety table listed project .env files that are only read-denied.
This commit is contained in:
@@ -348,9 +348,10 @@ These categories are always denied, even when `HERMES_WRITE_SAFE_ROOT` is unset:
|
||||
|----------|----------|
|
||||
| OS credential stores | `~/.ssh/` (keys, `authorized_keys`), `~/.aws/`, `~/.kube/`, `/etc/sudoers`, `~/.netrc` |
|
||||
| Hermes secret stores | `.env`, `.anthropic_oauth.json`, `auth/google_oauth.json`, Bitwarden cache (`cache/bws_cache.json`, `cache/bws_cache.enc.json`), `vault/`, `browser-profile/`, `mcp-tokens/`, `pairing/` under HERMES_HOME (active profile and global root). Control files (`auth.json`, `config.yaml`, `webhook_subscriptions.json`) are read-denied but stay writable. |
|
||||
| Project secret files | `.env`, `.env.local`, `.env.production`, `.envrc` anywhere on disk |
|
||||
| Windows NT/device-namespace paths | `\??\...`, `\\.\...`, `\\?\UNC\...`, `\\?\GLOBALROOT...` — rejected for both reads and writes on every platform. On Windows, merely *resolving* such a path (e.g. `\??\UNC\host\share`) triggers outbound SMB authentication and can leak the user's NTLM hash; the prefixes also bypass normal path normalization. Ordinary extended-length local paths (`\\?\C:\...`) and plain UNC shares (`\\server\share`) are unaffected. |
|
||||
|
||||
Project-local `.env`, `.env.local`, `.env.production` and `.envrc` files are **read-denied** anywhere on disk (the file tools refuse to read them) but remain writable: the agent can create or edit them for you, it just cannot read the values back.
|
||||
|
||||
Sensitive paths inside the safe root are still blocked — pointing `HERMES_WRITE_SAFE_ROOT` at `$HOME` does not allow writing `~/.ssh/id_rsa`.
|
||||
|
||||
Safe-root violations return `Write denied: '…' is outside HERMES_WRITE_SAFE_ROOT (…)`. Credential-path blocks use `Write denied: '…' is a protected system/credential file.`
|
||||
|
||||
Reference in New Issue
Block a user