Skip to content

Hydra 0.3.2: security fixes

Choose a tag to compare

@rahul05ranjan rahul05ranjan released this 20 Nov 04:13

Security fixes from an audit of the CLI, MCP server and hooks. Each one has a regression test. Updating is recommended for anyone using the MCP server.

High

  • hydra_run could run arbitrary code. The gate checked only the runner name, so node --test /any/file.mjs, --import, make --eval, cargo --config and go -vettool all got through. It now refuses paths that leave the working directory (including through ../ and symlinks) and each runner's code-loading flags. A project's own npm test still runs.

Medium

  • hydra_smell, hydra_refactor and hydra_design could read any file on the machine and echo parts of it. They now accept only source files inside the working directory, and no dotfiles.

Low

  • The usage ledger could keep credentials from commands. NAME=value settings, URL passwords and secret-named flags are now masked, and the ledger is written owner-only (0600 in a 0700 folder).
  • Rewriting an agent's config file could widen it from 0600 to 0644. The original mode is now kept.
  • Any local process on 127.0.0.1:11435 was trusted as Hydra's model server. Hydra now trusts it only if its recorded process is alive, belongs to the same user and runs the configured server.
  • The maintainer dashboard listened on all interfaces and started evals for any origin. It now binds to 127.0.0.1, checks the Host header and accepts only same-origin JSON POSTs.

Hardening

  • The OS head's environment probe now hides values such as DATABASE_URL, *_DSN, GH_PAT and MYSQL_PWD, and any value that contains a URL password or connection-string key.
  • The managed llama-server starts with --no-slots --no-webui --cors-origins localhost. Restart it once after updating: hydra stop, and the next call starts it again.
  • MCP tools carry readOnlyHint annotations, so clients can gate hydra_run.
  • hydra smell --diff now runs through the git head's guards, so a repository's diff.external driver no longer runs. blame also adds --no-textconv.

Other fixes (most from @sarfaraz1212, #1 to #8)

  • The git head keeps the requested count in more phrasings ("the newest 3 commits", "the oldest 5 commits"), and build-failure questions route to the test head.
  • The OS head answers about the environment variable the question names (HOME, TERM, a lowercase variable pwd) instead of falling back to PATH. The sensitive-name and credential-value guards still apply to every name.
  • A command killed by a signal reports the usual 128+signal exit code.
  • The hydra improve latency figures use nearest-rank percentiles.
  • Smell scanner: indentation depth is measured with the file's own indent width (its most common indent step, #9); smell --diff reports real line numbers in new files; and sibling if/else branches without braces are no longer flagged as dead code.
  • npm test no longer writes its MCP test calls into your usage ledger.