T09 · Insecure Skill Coding Practices
- Location
scripts/config.py:12- Finding
Hardcoded DeepSeek API Credential Shipped in Source Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a skill-optimizer, but it can send skill/session data to DeepSeek and persist model-generated changes to active skill files without enforcing the user confirmation its documentation promises.
Review this carefully before installing. Use only with non-sensitive skills and rollout/session data, rotate the exposed DeepSeek key, set your own API key through the environment, and require a manual diff review before allowing it to overwrite any active SKILL.md. Avoid running it against private SESSION-STATE.md or proprietary skills unless you have redaction and provider-approval controls in place.
scripts/config.py:12Hardcoded DeepSeek API Credential Shipped in Source Code
scripts/evolve_core.py:145Failure Trajectories and Answer Content Are Transmitted to an External LLM Without Redaction
scripts/slow_update.py:101Slow Update Sends Skill Document Content to an External Service Without Data Classification
scripts/skill_scheduler.py:477Remote Model Output Can Be Persisted Into Skill Instructions Without Required User Confirmation
scripts/state_manager.py:42Unsanitized Skill Identifier Enables Path Traversal During State File Access
The request URL is derived from environment/config input (DEEPSEEK_BASE_URL) and the function sends sensitive skill content and failed trajectories to that endpoint without validation. If an attacker can influence the environment or config, they can redirect the data to an arbitrary server, causing exfiltration of potentially sensitive prompts, documents, and operational metadata.
},
method="POST",
)
with urllib.request.urlopen(req, timeout=120) as resp:
result = json.loads(resp.read().decode("utf-8"))
return result["choices"][0]["message"]["content"]
except urllib.error.HTTPError as e:
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# skill-evolve-pro — 技能进化引擎(Phase 1 + Phase 2)
> **版本**:Phase 1 + Phase 2
> **基于**:SkillOpt / ReflACT 6步循环
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# skill-evolve-pro — 技能进化引擎(Phase 1 + Phase 2)
> **版本**:Phase 1 + Phase 2
> **基于**:SkillOpt / ReflACT 6步循环
The skill explicitly sends failure trajectories to the external DeepSeek API for analysis, but does not clearly warn that user data and model outputs may be transmitted to a third-party service. This is especially dangerous here because the trajectories can include raw user messages, predictions, references, and failure reasons, which may contain confidential or personal information.
The file contains a hardcoded DeepSeek API key as the default value for DEEPSEEK_API_KEY. Embedding a live secret in source code risks accidental disclosure through source control, package distribution, logs, or downstream reuse, and the surrounding docstring claiming the config is not uploaded can create false confidence that reduces safe handling of the secret.
This scheduler is explicitly designed to self-modify a skill by generating edits from rollout data, applying them, and writing the updated SKILL.md back to disk when the gate passes. Because the edit source is derived from potentially untrusted trajectories and reflection logic, a weak or bypassable gate can allow prompt/content injection, persistence of unsafe instructions, or corruption of the skill's behavior. In this context, the self-modification capability makes the system materially more dangerous because it persists generated changes rather than keeping them ephemeral.
2. skill_reflect.reflect() -> generate edits from trajectories
3. skill_apply.apply_all_edits() -> apply edits, produce skill_after
4. skill_gate.gate_validate() -> validate (auto or manual)
5. If gate passes -> write skill file -> bump_round -> record_edits -> save_state
"""
from __future__ import annotations
Model-generated guidance is automatically written into a protected long-term region without human review or robust validation. Because that region is intended to persist across updates, an injected or manipulated model output can become durable control-plane instruction, effectively escalating influence over future agent behavior.
The README states that the tool will automatically apply edits and produce an evolved skill version, but it does not prominently warn users that local skill files will be modified. In this context, silent or poorly disclosed file mutation is dangerous because the skill is specifically designed to rewrite code or prompt files, including protected-region updates in later phases.
The trigger phrases are very broad generic utterances such as '优化这个技能' and '让技能自动进化', which can overlap with ordinary user requests and cause the skill to activate unintentionally. Because this skill performs autonomous editing of other skills, accidental invocation can lead to unauthorized or surprising file modifications in the workspace.
文档标题、流程说明、用户确认词和示例几乎全部固定为中文,例如要求回复“确认改”“同意”“确认”等,但没有说明是否支持其他语言或允许用户自行选择交互语言。按规则,这属于可能的语言/locale 强制约束,且缺少用户 opt-in。
The trigger phrases include very common requests such as '优化这个技能' and '运行进化流程', which can plausibly appear in normal discussion and cause unintended activation of a workflow that edits files. In this skill's context, accidental triggering is more dangerous because the skill is designed to modify other skills and process stored trajectory data, so a false activation could lead to unwanted analysis, diff generation, or preparation for file changes.
Phase 2 describes automatic parsing of SESSION-STATE.md, including user messages, feedback, and task metadata, but does not state any notice, minimization, redaction, retention, or consent controls. In context, this is risky because session-state content may contain sensitive user data and is being repurposed for rollout analysis beyond the immediate interaction.
The skill instructs automatic collection, storage, and later reuse of raw user messages, feedback, and related rollout metadata from SESSION-STATE. This creates a data-retention and secondary-use risk because sensitive interaction content may be persisted in temp/rollouts without clear minimization, retention, or access-control guidance.
The module docstring is written entirely in Chinese and includes an instruction-like description without offering any language choice or documenting a justified locale restriction. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation.
This code file contains user-facing natural-language text entirely in Chinese, including the module description and setup instructions. The file does not offer a language choice or indicate that the locale restriction is intentional for a region-specific tool, which fits the policy category for forced language without user opt-in.
The RuntimeError text shown to users when configuration is missing is Chinese-only. Because this is a direct user-facing interaction in code and there is no alternative language path or documented justification, it constitutes a natural-language policy violation under the locale rule.
The file’s natural-language strings and system prompts are written exclusively in Chinese, which effectively constrains operation to a specific language/locale without any opt-in or alternative. The policy requires flagging language or locale constraints when the skill forces a specific language without giving the user a choice.
The Reflect system prompt and surrounding documentation repeatedly instruct the model to generate changes for "SKILL.md", implying the tool is scoped to skill-document evolution. However, the CLI at L649-L654 reads an arbitrary path from argv and L619 applies edits to whatever content was supplied, so the documented target is narrower than the implemented behavior.
The evolve cycle transmits portions of the skill document and failed trajectory data to an external LLM service, but this code provides no user-facing warning, consent gate, or redaction step. In security-sensitive environments, that can leak proprietary, personal, or confidential data to a third party, especially because the transfer is integral to normal operation and easy to overlook.
This code repeatedly assumes the user is referred to as “先生” and uses that label in comments, parsing rules, and generated output. That imposes a specific language/locale-style form of address rather than offering a user choice, which fits the policy category for forced language/locale behavior.
The parser only recognizes user lines prefixed with “先生” and AI lines prefixed with “AI” or “双鱼座”, which enforces a particular localized naming convention. Users who do not use that form are not given any documented choice or configuration, making this a natural-language policy concern.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.