T01 · Skill Instruction Hijacking
- Location
SKILL.md:36- Finding
Mandatory Remote Task Operations Hijack the Agent Workflow
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a remote task-memory service, but it needs Review because it can automatically sync user task details to a third-party API and stores the API key in a plaintext .env file.
Install only if you are comfortable using xiaobenyang.com as a remote task-memory provider and with your task descriptions being sent there. Do not put secrets, private code, incident details, or personal data into todos unless the service's privacy and retention terms are acceptable. Store the API key outside a shared repository when possible, ensure .env is ignored by version control, and review the stale gaokao references and unpinned dependencies before production use.
SKILL.md:36Mandatory Remote Task Operations Hijack the Agent Workflow
scripts/call_api.py:47User Task Content and API Credentials Are Transmitted to a Third Party Without Data Minimization
scripts/config.py:42API Key Is Persisted in a Plaintext Environment File Without Enforced Permissions
scripts/config.py:11Configurable Base URL Can Redirect Credentials and Task Data to an Attacker-Controlled Endpoint
requirements.txt:1Dependencies Use Open-Ended Version Constraints
scripts/tools.py:1Invalid and Unresolvable Type Annotations Can Break Tool Schema Generation
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
This second mismatch is more severe because the documentation suggests a generic memory/task-management service, while the project structure and instructions indicate local .env manipulation and behavior resembling a separate gaokao API integration. Such inconsistency obscures the real function of the skill and raises the risk of users providing secrets or invoking capabilities under false assumptions.
This second mismatch is more severe because the documentation suggests a generic memory/task-management service, while the project structure and instructions indicate local .env manipulation and behavior resembling a separate gaokao API integration. Such inconsistency obscures the real function of the skill and raises the risk of users providing secrets or invoking capabilities under false assumptions.
The skill claims to provide agent memory/task services, but the instructions pivot to an API-key-gated external service and gaokao workflow references. This is dangerous because it can socially engineer the operator into supplying credentials to a service that is unrelated to the advertised capability.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
model_config = SettingsConfigDict(
env_prefix="XBY_GAOKAO_",
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
)
The post-init hook explicitly force-reads XBY_APIKEY from .env outside normal settings resolution, creating custom secret-loading behavior that is harder to audit and easier to misuse. In the context of a task-management skill, this secret-access logic is broader than expected and increases the chance of exposing credentials from local files.
default_year: int = 2025
def model_post_init(self, __context):
# 强制从 .env 文件读取 XBY_APIKEY
env_path = Path(".env")
if env_path.exists():
content = env_path.read_text(encoding="utf-8")
The code opens and parses the local .env file directly to extract an API key, which is credential access from local storage beyond ordinary task-management functionality. Direct secret-file parsing increases exposure and can normalize broad access to local secrets in environments where multiple tools share the same workspace.
def model_post_init(self, __context):
# 强制从 .env 文件读取 XBY_APIKEY
env_path = Path(".env")
if env_path.exists():
content = env_path.read_text(encoding="utf-8")
for line in content.splitlines():
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if line.startswith("XBY_APIKEY="):
self.api_key = line.split("=", 1)[1].strip()
break
# 如果环境变量有值,覆盖 .env 的值
env_val = os.getenv("XBY_APIKEY", "")
if env_val:
self.api_key = env_val
This function is dedicated to saving an API key into a local .env file in plaintext, which materially increases the risk of credential compromise through repo inclusion, accidental sharing, backups, endpoint compromise, or other local access. Because the skill's declared purpose does not justify local secret escrow, the context makes this behavior more suspicious and more dangerous.
def save_api_key_to_env(api_key: str) -> bool:
"""将API key保存到.env文件"""
try:
env_path = Path(".env")
lines = []
if env_path.exists():
lines = env_path.read_text(encoding="utf-8").splitlines()
The skill documentation describes behaviors that imply access to environment variables, local file persistence, and networked API calls, yet it declares no explicit tool scope or permission boundaries. This weakens reviewability and can cause the host agent to grant broader capabilities than users expect, increasing the risk of secret access or unintended side effects.
The skill instructions are primarily written in Chinese but include substantial English operational guidance for tool usage, with no statement that the user may choose their preferred language or that the locale restriction is intentional. This can amount to a language/locale policy issue because the skill implicitly imposes a language format without opt-in or justification.
The skill instructs the agent to ask the user for an API key and persist it via local configuration without any limits on storage duration, access controls, masking, or later reuse. In the context of an agent skill, this creates a meaningful secret-handling risk: credentials may be retained, exposed to later prompts, or written to insecure locations.
The workflow claims that code 'only calls APIs,' but the documented tools are local todo/session-memory operations. This inconsistency undermines trust in the security model because reviewers cannot reliably determine whether data stays local or is sent remotely.
The instruction to directly present raw tool data to the user bypasses any semantic filtering, least-privilege output shaping, or sensitive-field redaction. If upstream responses include secrets, internal identifiers, personal data, or debugging details, the agent may disclose them verbatim.
This code sends the params payload to an external API and includes an API key in the request headers, which can transmit user or system data off-box. While the code logs success and error states, it does not provide any user-facing warning, confirmation, or explanatory comment/docstring disclosing that data and credentials are being sent to a remote service.
The module implements API credential persistence and retrieval even though the stated skill purpose is task/work-memory management. This expands the trust boundary by storing secrets locally in a reusable configuration file, creating unnecessary exposure if the host filesystem, repository, logs, or backups are accessed.
The function writes an API key into a local .env file without demonstrating that persistent local secret storage is necessary for the advertised task-management function. Persisting secrets in plaintext increases the chance of accidental disclosure through source control, backups, shared workspaces, or local compromise.
The code silently stores the API key in .env and updates the process environment without any user-facing warning, consent, or disclosure. Hidden secret persistence is risky because users may assume the key is used only transiently, while it actually remains on disk in plaintext.
The dependency specification for requests is unpinned and allows installation of any future version above 2.31.0, making builds non-reproducible and increasing supply-chain risk. In an AI agent task-management service that likely handles network access and secrets, unexpectedly pulling a vulnerable or incompatible requests release could expose credentials or weaken transport/security behavior.
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Requests has multiple known advisories, and because the manifest does not pin a version there is no way to verify that deployed environments avoid affected releases. This is more concerning in an AI agent service because outbound HTTP is commonly used for tool access, and vulnerable requests behavior could expose credentials, mishandle redirects, or weaken request verification.
The pydantic dependency is specified with a lower bound only, so installations may resolve to different versions over time, including versions with undiscovered or known issues. Because this service likely relies on schema validation for agent memory/task data, a vulnerable or behavior-changing pydantic release could lead to validation bypasses or denial of service.
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Pydantic has known advisories, but the unpinned requirement prevents verification that only fixed versions are installed. Given this skill's role in managing structured agent/task data, a vulnerable parser or validator could be abused for denial of service or malformed input handling.
The pydantic-settings package is unpinned, which creates uncertainty about which version is deployed and whether it contains security flaws. Since settings libraries often process environment variables, config files, and secret sources, version drift can directly affect secret-handling and file-resolution behavior.
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1
Pydantic-settings has a known advisory related to secret/file source handling, and the lack of version pinning makes it impossible to confirm the deployed package is patched. In a memory/task management service that likely loads secrets and configuration, this can increase the risk of unsafe path or symlink resolution affecting sensitive data.
The python-dotenv dependency is not pinned, so deployments may consume different versions with different security properties. In a service likely using .env-based configuration, this increases the chance of introducing vulnerable file-handling or secret-loading behavior through normal installs or rebuilds.
requests>=2.31.0
pydantic>=2.7.0
pydantic-settings>=2.2.0
python-dotenv>=1.0.1