T09 · Insecure Skill Coding Practices
- Location
scripts/hermes-sync.sh:34- Finding
Automatic Collection and Git Upload of Credentials and Private Hermes Data
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This GitHub sync skill can automatically upload and restore Hermes secrets, sessions, memories, and skills with too little user control.
Review carefully before installing. Use only a private repository you own, remove .env, auth.json, sessions, and any secrets from the sync flow, check git status and diffs before every push, and do not pull memories or skills from a repository unless you trust and have reviewed the exact changes.
scripts/hermes-sync.sh:34Automatic Collection and Git Upload of Credentials and Private Hermes Data
scripts/hermes-sync.sh:62Unverified Remote Content Can Overwrite Persistent Memories and Installed Skills
The README explicitly instructs users to copy the entire Hermes configuration, memories, and skills directories into a Git repository and push them to GitHub, but it provides no warning about secrets, tokens, private prompts, personal data, or embedded credentials that may exist in those files. In this context, the omission is dangerous because users are encouraged to publish or sync highly sensitive local application state to a remote service, potentially exposing credentials and private data across devices or through repository misconfiguration.
The skill markets itself as a simple Hermes config/data sync tool, but the documented behavior includes committing and pushing data to a remote GitHub repository and optionally syncing highly sensitive files such as .env, auth.json, and sessions. That mismatch prevents informed consent and increases the chance users will expose credentials, tokens, or private conversation history without appreciating the risk.
The trigger list includes broad everyday terms like 同步, github, git, 备份, 上传, 下载, which can cause the skill to activate in many unrelated contexts. Overbroad activation is dangerous here because the skill contains instructions that can move sensitive data into a Git repository and overwrite local Hermes state.
The upload workflow copies .env, auth.json, and sessions from the Hermes directory into a Git-tracked location, enabling collection and remote transmission of credentials and private session data. In this context, the skill is not merely reading config; it is operationalizing secret access and publication.
cp ~/.hermes/config.yaml .
cp -r ~/.hermes/memories .
cp -r ~/.hermes/skills .
cp ~/.hermes/.env . # 可选,包含API密钥
cp ~/.hermes/auth.json . # 可选,包含认证信息
cp -r ~/.hermes/sessions . # 可选,对话历史
The skill normalizes copying API keys and authentication data into GitHub-backed storage with only mild wording like 'optional' rather than a strong risk warning. In the context of a sync skill, users may follow the steps mechanically and inadvertently expose long-lived secrets that enable account takeover or third-party API abuse.
The instructions explicitly direct users to place .env and auth.json into a GitHub-synced repository. This is a direct secret-handling anti-pattern that can expose API keys, tokens, and authentication state to any party gaining repository or device access.
The download workflow restores .env and auth.json onto another machine, propagating secrets and auth state across devices. This increases blast radius if any synced copy is compromised and can violate least-privilege expectations for per-device authentication.
cp config.yaml ~/.hermes/config.yaml
cp -r memories/* ~/.hermes/memories/
cp -r skills/* ~/.hermes/skills/
cp .env ~/.hermes/.env # 可选
cp auth.json ~/.hermes/auth.json # 可选
cp -r sessions/* ~/.hermes/sessions/ # 可选
The sync content table explicitly identifies .env and auth.json as sensitive yet still includes them in the documented sync scope, reinforcing unsafe handling of credentials. This makes the dangerous behavior easier to justify and repeat despite acknowledging the data sensitivity.
| config.yaml | 主配置文件 | 否 |
| memories/ | 个人记忆和偏好 | 否 |
| skills/ | 所有技能 | 否 |
| .env | API密钥(可选) | ⚠️ 是 |
| auth.json | 认证信息(可选) | ⚠️ 是 |
| sessions/ | 对话历史(可选) | 否 |
| reddit_research/ | 创业研究数据 | 否 |
The documented workflow culminates in git push, which sends all staged files to a remote repository. In the context of earlier steps that copy broad Hermes contents and optional secrets into the repo, this becomes a high-risk publication step that can exfiltrate sensitive local data.
│ cp -r ~/.hermes/skills . │
│ git add . │
│ git commit -m "更新配置" │
│ git push │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
The rollback command git reset --hard HEAD^ paired with git push --force can destroy local and remote history, causing data loss and hard-to-recover state across synchronized devices. This is especially risky in a backup/sync skill where preserving history and recoverability should be central.
# 回滚到上一个版本
git reset --hard HEAD^
git push --force
Copying the .env file into a Git-backed sync directory is direct credential handling and can disclose API keys, secrets, and environment-based authentication material to anyone with repository access. In a sync-to-GitHub skill, this is especially dangerous because exfiltration can happen through routine use rather than a separate attack step.
cp -r "$HERMES_DIR/skills" .
# 可选文件
[ -f "$HERMES_DIR/.env" ] && cp "$HERMES_DIR/.env" .
[ -f "$HERMES_DIR/auth.json" ] && cp "$HERMES_DIR/auth.json" .
[ -d "$HERMES_DIR/sessions" ] && cp -r "$HERMES_DIR/sessions" .
The script explicitly copies .env, auth.json, and sessions into a Git repository, which can expose API keys, bearer tokens, refresh tokens, and authenticated session material if the repository is pushed to a remote. Storing credential artifacts in source control creates a durable, easily replicated leak path and can enable direct account compromise.
The script silently stages and pushes highly sensitive credential and session files without any explicit warning, consent prompt, or visibility into what is being uploaded. Because the skill is marketed as convenient sync, users may not realize they are publishing secrets and active sessions to a remote Git service.
This finding reflects the same credential-restoration behavior in the pull path: secret-bearing files are copied from the repository into the active Hermes directory. That design turns the repository into a credential transport mechanism and magnifies the blast radius of any repo compromise or accidental exposure.
cp -r skills/* "$HERMES_DIR/skills/" 2>/dev/null || true
# 可选文件
[ -f ".env" ] && cp .env "$HERMES_DIR/.env"
[ -f "auth.json" ] && cp auth.json "$HERMES_DIR/auth.json"
[ -d "sessions" ] && cp -r sessions/* "$HERMES_DIR/sessions/" 2>/dev/null || true
This finding reflects the same credential-restoration behavior in the pull path: secret-bearing files are copied from the repository into the active Hermes directory. That design turns the repository into a credential transport mechanism and magnifies the blast radius of any repo compromise or accidental exposure.
cp -r skills/* "$HERMES_DIR/skills/" 2>/dev/null || true
# 可选文件
[ -f ".env" ] && cp .env "$HERMES_DIR/.env"
[ -f "auth.json" ] && cp auth.json "$HERMES_DIR/auth.json"
[ -d "sessions" ] && cp -r sessions/* "$HERMES_DIR/sessions/" 2>/dev/null || true
All user-facing instructions in the file are presented in Chinese, with no alternative language option or opt-in. This can violate a language/locale policy when a skill forces a specific language without user choice and no region-specific justification is provided.
The natural-language content of the skill, including its description, scenarios, instructions, and FAQ, is presented exclusively in Chinese. There is no indication that the skill offers language choice or that the Chinese-only constraint is required for a region-specific or compliance-specific purpose.
The instructions tell users to copy credential-bearing files and authentication artifacts into a Git repository as part of routine sync. Even if the repository is intended to be private, this greatly expands the attack surface through accidental exposure, collaborator access, device compromise, or future repository misconfiguration.
The FAQ states that syncing .env to a private repository is acceptable, which downplays the real risk of secret compromise. Private repositories are not equivalent to secret stores; misconfiguration, token theft, collaborator access, backups, and audit gaps can still expose credentials.
The FAQ encourages syncing arbitrary additional files beyond the stated Hermes configuration scope. This broadens the skill into a generic exfiltration or oversharing workflow, increasing the chance that users place sensitive local files into version control and push them remotely without adequate review.
The rollback section recommends git reset --hard and git push --force without warning that these commands permanently discard local history and rewrite remote history. Users can easily destroy configuration history, lose unsaved work, or break synchronization across devices.
The script does more than sync harmless configuration: it copies Hermes memories, skills, and other runtime artifacts into a Git working tree and then pushes them upstream. In this context, those files may contain prompts, internal state, proprietary skill code, or sensitive user data, so automatically publishing them to GitHub materially increases exposure beyond ordinary config backup.
The pull workflow overwrites local Hermes files from repository contents with no confirmation, backup, or integrity check. If the remote repository is outdated, maliciously modified, or simply wrong for the device, the user can lose local configuration or import unsafe skill content and stale credentials.
All user-facing comments and console messages are in Chinese, which imposes a language choice on users without opt-in. The file does not indicate that this skill is intentionally limited to a Chinese-speaking or region-specific audience.