Holocron Security Tool Exposed: Local Config Override Allows Path Hijacking
A low-severity but critical configuration weakness in the Holocron security-monitoring tool enables local file hijacking. The tool's config loader prioritizes a local `holocron.yaml` file in the current working directory, allowing it to override the user's global configuration. This design, common in tools like Git and Docker, creates a subtle attack vector where a malicious YAML file placed in any directory where a user runs the `holo` command can redirect core data paths to attacker-controlled locations.
The vulnerability resides in `internal/config/config.go`. The loader reads configuration in a specific order: first the user's config at `~/.holocron/config.yaml`, then a local `holocron.yaml` in the current directory, with the local file taking precedence. A crafted local config can override `store.path` to redirect the SQLite database to a world-readable location, potentially exposing session data. It can also hijack `sources[].sessionDir` to point session scanning at a directory containing malicious JSONL files, or override `sources[].token` with an empty or different value—though the token feature is noted as a 'Phase 2' addition.
While the severity is marked as LOW, the implications for a tool designed for security monitoring are significant. It introduces a supply-chain-like risk where an attacker could plant a config file in a shared project directory. The next user to run `holo` from that directory would have their store and session paths silently hijacked, potentially leading to data interception or corruption. The issue highlights the tension between user convenience and security hardening in developer tools, warranting a review of the trust model for local configuration overrides.