Back to skill

Security audit

Knowledge-Base

Security checks for vulnerabilities and agentic risk

Overview

This knowledge-base skill is mostly coherent, but its Git workflow can commit and push the entire configured repository, including unrelated or sensitive files.

Review this skill before installing if your knowledge-base repository may contain private drafts, credentials, local configuration, or unrelated files. Require the agent to show `git status` and the staged diff, stage only intended paths, and ask before any `git push`.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
references/hansphere.md:123
Finding
Unrestricted Repository Staging and Push May Disclose Sensitive Files## Vulnerability Details **File Location**: `references/hansphere.md`, lines 123–127 **Vulnerability Type**: T09: Insecure Skill Coding Practices **Risk Level**: Medium ### Vulnerable Code ```bash cd D:\HanSphere git add . git commit -m "docs: 简要描述变更" git push ``` ### Technical Analysis The documented Git workflow uses `git add .`, which stages every modified and untracked file under the repository rather than limiting the commit to files changed for the requested knowledge-base operation. It then instructs the agent to commit and push the staged content without requiring review, secret scanning, or user confirmation. The skill's separate prohibition against writing sensitive information does not protect sensitive or unrelated files that already exist in the repository. Consequently, a routine note-management operation could unintentionally include preexisting credentials, local configuration, generated reports, private documents, or unrelated work. ### Attack Path 1. A sensitive or unrelated modified or untracked file exists anywhere under `D:\HanSphere`. 2. The agent performs a legitimate knowledge-base update. 3. The agent follows the documented Git workflow and executes `git add .`. 4. Git stages both the intended note and the unrelated file. 5. The agent commits all staged content without reviewing the staged diff. 6. `git push` transmits the resulting commit to the repository's configured remote. 7. Users with access to that remote can retrieve the unintentionally committed content, including through repository history even if it is later deleted. ### Impact Assessment An attacker does not gain local code execution or elevated operating-system privileges through this issue alone. However, the workflow can disclose any modified or untracked file located within the repository and readable by the account running Git. The affected scope includes the entire `D:\HanSphere` working tree and the configured remote repository. Potential consequences inclu ...[truncated 309 chars]
Remediation
## Remediation Suggestions 1. Replace broad staging with explicit path-based staging: ```bash git add -- Notes/03-Concepts/CONCEPT-Domain-Topic.md ``` 2. Before committing, inspect the working tree and staged changes: ```bash git status --short git diff --cached --name-only git diff --cached ``` 3. Abort the commit if the staged set contains files outside the current operation. 4. Run an approved secret scanner against staged content before committing. 5. Maintain a restrictive `.gitignore` for credentials, local configuration, temporary files, generated output, and private artifacts. 6. Require explicit user confirmation before `git push`, and display the target remote, branch, and staged file list. 7. Consider separating commit creation from remote publication so that a normal knowledge-base update does not automatically push. 8. If sensitive data has already been pushed, revoke affected credentials, remove the data from repository history using an appropriate history-rewriting procedure, force-update the remote only after coordination, and notify affected repository users.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger description is very broad and includes common knowledge-work actions like note-taking, organizing, searching, and writing reports. This can cause the skill to activate in ordinary conversations where the user did not clearly intend filesystem or knowledge-base operations, increasing the chance of unintended file reads/writes or over-collection of user content.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The document states '正文语言:中文', which imposes a specific language requirement. Under the policy, forcing a language without explicit user opt-in or a clearly documented regional justification is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The skill allows the note body language to be dictated by a reference configuration rather than explicit user choice. This can lead to silent mismatch with user expectations, cause incorrect handling of multilingual content, and create integrity/usability issues if notes are rewritten or created in an unexpected language without consent.

Static analysis

No suspicious patterns detected.