Hermes Closed 31 Credential Leaks Overnight: Another User on Your Box Could Read Your API Key

You set Hermes up on the shared dev box at work on Wednesday afternoon, keys configured, everything running fine. That evening a colleague sshes in to debug something unrelated, runs cat ~/.hermes/config.yaml out of curiosity, and there they are: your OpenAI key, your Anthropic key, your gateway token. Plaintext. Readable.
Nothing about your setup was wrong. The file’s mode was 0644 — every account on that machine can read it.
If you run Hermes alone on a personal laptop, this sounds remote. But as soon as there is a second account on the box — a shared dev server, a CI runner, a bastion host, the family NAS — your secrets are effectively public on that host. Between the night of November 13 and the early hours of November 14, Hermes merged 31 hardening PRs about exactly this (GitHub label sec-marathon-2026-11-13). Below are the ten or so worth knowing: what the hole was, how far it reached, and what you can do today.
31 PRs in one night, all doing the same thing
They share a property: none of them close a new attack surface. They close old, already-existing ones — file modes, debug logs written to disk, incomplete export redaction, scanner rules.
The maintainers label this work “§3.2 hardening (not a new boundary)”, and that framing matters for how you read this article. Do not assume “upgraded, therefore safe”. Check the files that are already on your disk — some of them may have been sitting at the wrong mode for months.
One fact up front: all of this is on main only, not in v0.23.1 (tagged November 9). If you run a stable release today, you do not have these fixes yet. More on that at the end.
1. config.yaml inherited its own permissions
This is the widest blast radius in the batch (PR #155270).
Hermes writes config atomically: temp file, then os.replace. The ruamel round-trip writers carry the existing file’s mode across that replace. So once config.yaml was 0644 (or 0666), every subsequent “safe” write kept it 0644.
Worse, only save_config() re-tightened afterwards. Every other writer — gateway slash commands, the TUI, auth flows, onboarding — plus every path that copies a config.yaml into place (hermes migrate xai --apply, /snapshot restore, hermes import, hermes profile import, profile clones, distribution installs) left a world-writable config.yaml world-writable.
The fix pushes the responsibility down to the one place all file-backed config writes land: FileBackend.write_path calls drop_other_access() after writing. The copy and migration paths that bypass it call the same helper.
Three details worth knowing:
- Group bits survive:
0660and0670still work, because some shared home directories are built that way. - setgid survives:
02676becomes02670. - Managed and container installs are skipped: they have their own permission model.
Check yours now:
ls -l ~/.hermes/config.yaml
# want: -rw------- (0600) or -rw-r----- (0640)
# -rw-r--r-- (0644) means any local user can read it
If it is 0644, do not wait for a release:
chmod 600 ~/.hermes/config.yaml
chmod 600 ~/.hermes/.env 2>/dev/null || true
Then do the part people skip: treat every key in that file as exposed and re-issue it. A mode fix governs the future; it cannot undo the past.
2. Backup zips carried auth.json and .env
hermes backup builds a zip containing auth.json and .env. That archive is sensitive by definition, but under a 022 umask it was written 0644 — and it lands in $HOME by default.
The fix has two layers (PR #155219):
backups/is created and tightened to0700._atomic_output_pathcreates the hidden.partialfile withO_CREAT|O_EXCLat mode0600before the first byte is written.
The second point is the real one. The earlier salvaged version chmod’d at publish time, which leaves a genuine window where the partial file is 0644; O_EXCL also refuses a pre-planted symlink. It covers hermes backup, quick and full backups, and the pre-update / pre-migration archives, because they share the helper.
ls -ld ~/.hermes/backups 2>/dev/null
ls -l ~/.hermes/backups/*.zip 2>/dev/null | head
3. --redact only scrubbed the conversation
This one should make people sit up (PR #155215).
redact_session_data — the helper behind hermes sessions export --redact — only cleaned messages and segments. A session export has other fields:
- the auto-generated title, which usually quotes your first message and may contain a token;
system_prompt;model_config;- other top-level fields.
All of them went into md and jsonl exports in plaintext.
The fix walks the whole session dict through the existing force-mode redact_sensitive_text, including string keys.
Because redact_session_data is the single helper behind every export path, one change covers hermes sessions export --redact (md and jsonl), the CLI /export redact path, the gateway slash command, and TUI/desktop session.export.
One residual limitation the PR is honest about: two different keys that redact to the same masked form collapse into one. Only relevant on an explicit --redact export.
4. The model’s reasoning was stored verbatim
Hermes already redacted content in build_assistant_message before writing history and state.db. But reasoning, reasoning_content, and unsigned reasoning_details text were stored as-is (PR #155288).
Why that matters: if a key appears in a conversation, the model often quotes it while thinking (“that looks like a real token”). That reasoning text then sat in your database in plaintext — and databases get backed up, synced, and occasionally pasted to other people.
The fix applies redact_sensitive_text to those mutable copies where the message is built, so the stored bytes match the replayed bytes. It deliberately keeps byte-exact: signature, encrypted_content, encrypted/native-carrier types, and the codex/anthropic/bedrock sidecars — providers verify signatures on replay, so touching them breaks requests.
And here is the honest caveat from the PR: signed reasoning entries keep their text by necessity. The change reduces plaintext copies; it does not remove a quoted credential from signed replay material. So: do not paste secrets into a chat. Not once.
5. A debug log persisted the first 60 characters you typed
interrupt_debug.log. You have probably never seen the name, but it existed (PR #155272).
Both busy-input interrupt paths — cli_chat_turn_mixin._chat_monitor_agent_thread and cli_tui_mixin._tui_enter_while_busy — appended the first 60 characters of the user’s message to HERMES_HOME/interrupt_debug.log with a raw open().write(). That bypasses RedactingFormatter.
So a token you pasted while a turn was running, a command with a password in it, a connection string — sat there in plaintext.
The fix is deletion, not rerouting. Those writes were temporary instrumentation (commit e004c094ea), and agent.interrupt() already logs the same request through logging, which is redacted. Startup tip tips.t249 (17 locales) now points at agent.log (hermes logs) and HERMES_DEBUG_INTERRUPT=1.
6. Kanban worker logs were world-readable
If you run Kanban multi-agent work — we covered the review lifecycle earlier — this is yours (PR #155271).
_open_worker_log opened <board>/logs/<task>.log with the process umask — typically 0644 — and rotation carried that mode onto .log.1. Those logs hold worker output, meaning the agent’s final reply text.
Worse, the dispatcher’s worker is now a thin client: the text it prints into that log is worker_result.last_output, and that value was booked unredacted.
Two changes:
kanban_worker_log.open_worker_logcreates at0660and strips only the other bits on every open and on rotation (group kept for shared-group homes; legacy logs tightened on their next open).- The booked
last_outputis redacted withredact_review_valuebefore the 500-character tail cut. Order matters: cut first and a PEM header or token prefix that straddles the boundary leaves an unrecognisable remainder the redactor cannot match.
7. hermes webhook subscribe printed the HMAC secret
Simple and nasty (PR #155221): every create or update printed the full HMAC secret to the terminal.
That put it in your scrollback, in agent transcripts, and in CI logs — which are frequently team-visible.
The fix prints mask_secret(secret) and points to <HERMES_HOME>/webhook_subscriptions.json (0600) for the full value. No new flag; --secret still lets you supply your own.
If you ran webhook subscribe in CI, go read those build logs and rotate the secret. Usage details live in webhook event delivery; the real subcommands are subscribe / list / remove / test.
8. On macOS and Windows, changing the case walked right past the deny list
Linux users can skip this section (PR #155241 scopes the change to darwin/win32).
macOS and Windows default to case-insensitive filesystems, and realpath/resolve preserve the case you typed. So ~/.SSH/authorized_keys, <home>/MCP-TOKENS/..., <home>/AUTH.JSON, <home>/CONFIG.YAML open the denied file while slipping past three exact-string checks:
- the deny checks in
agent/file_safety.py; - the
write_filesensitive-path guard; - the gateway media-delivery denylist.
The fix adds agent.file_safety.deny_key, which casefolds on darwin/win32 only (via hermes_platform), plus deny_path_under.
The important design choice: folding applies only to the DENY side. Safe roots and cache allowlists stay exact, because folding widens a match — fold an allowlist and you can accidentally permit a directory. Done this way, folding can only make a denial stricter, never an allowance looser.
A follow-up commit moves the @file: / @folder: context-reference guard (fed untrusted gateway text) onto the same helpers.
The smaller ones worth knowing about
Also merged that night, all hardening rather than new boundaries:
| PR | What it fixed | Why it matters |
|---|---|---|
| #155219 | backup zips 0600, backups/ 0700 |
the archive contains auth.json and .env |
| #155222 | SSRF guard explicitly blocks fec0::/10, 2001:20::/28, 100::/64, 2001:2::/48 |
those IPv6 special-use ranges report is_global on Python 3.11–3.14 and passed is_safe_url |
| #155212 | execute_code tool grant became tri-state |
an empty intersection used to fall back to every sandbox tool, so the documented contract was fiction |
| #155289 | redactor strips whole CSI sequences before matching | an ANSI-coloured token (ESC[32msk-...) leaked in full |
| #155250 | google-workspace OAuth token, client secret, PKCE state now 0600 | they were written with Path.write_text(), so 0644, and a manual chmod was undone by the next re-auth |
| #155204 | MCP description scan catches multi-word filler | variants like ignore ALL prior instructions were never logged |
| #155259 | MCP scan peels exec wrappers first | env bash -c ... and timeout 10 bash -c ... skipped both shell scans |
| #155221 | webhook HMAC secret masked | see section 7 |
One judgement call that is yours to make: #155204 and #155259 are heuristics and still warn-only. If an MCP tool description carries injection text, Hermes logs a line; it does not block. Treat that as a searchlight, not a wall. For the wider supply-chain picture see MCP catalog security and plugin catalog CI supply chain.
Four things to do today
No version bump required:
# 1. See what is publicly readable on this machine
ls -l ~/.hermes/config.yaml ~/.hermes/.env ~/.hermes/auth.json 2>/dev/null
ls -ld ~/.hermes/backups 2>/dev/null
ls -l ~/.hermes/interrupt_debug.log 2>/dev/null # left over? delete it
# 2. Tighten
chmod 600 ~/.hermes/config.yaml ~/.hermes/.env ~/.hermes/auth.json 2>/dev/null
chmod 700 ~/.hermes ~/.hermes/backups 2>/dev/null
# 3. Rotate anything that sat in a plaintext file
# provider keys, webhook HMAC secrets, MCP tokens
# 4. Run services under a stricter umask
umask 077
hermes gateway
Step 3 is the one people skip and the one that matters most. File modes govern who can read things next; a secret that was readable needs replacing.
When you get this
These merged from the night of November 13 into the small hours of the 14th, all on main, none in v0.23.1 (the November 9 tag). After the next release the upgrade is the usual:
hermes update
Keep your expectations calibrated, though. This batch reduces plaintext copies; it does not make leakage impossible. Several of the PRs repeat one sentence in their own words — redaction is a heuristic, not a boundary. The real boundaries are two: do not put secrets into conversations or memory, and do not grant a secret more access than it needs.
Why write this up at all: 31 PRs landing under one label in a single night is an organised sweep, not scattered patching. For users it doubles as a checklist — those ten items map onto the places Hermes writes sensitive data on your machine. Work through the four steps above and you are probably cleaner than 90% of installs.
Update (2026-11-16): the sweep has finished. The
sec-marathon-2026-11-13label holds 161 PRs, 160 merged and 1 still open (counted with the GitHub searchlabel:sec-marathon-2026-11-13 is:pr is:merged). This article picks the ten-odd first-batch items worth auditing; the conclusions hold for the later merges too, and the label itself is the full list.