T09 · Insecure Skill Coding Practices
- Location
scripts/subagent_batch.py:159- Finding
Per-Task Timeout Is Declared but Never Enforced
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent subagent framework, but it exposes broad child-agent powers and has implementation flaws that could weaken tool boundaries or run batches indefinitely.
Review before installing or using this as runtime code. It should be kept in a sandbox or patched first with explicit tool-permission enforcement, bounded concurrency, enforced timeouts, retry caps, and preservation of child-agent state across resume/retry. I found no evidence of exfiltration, remote code loading, persistence, or destructive install behavior.
scripts/subagent_batch.py:159Per-Task Timeout Is Declared but Never Enforced
scripts/subagent_batch.py:207Rate-Limited Tasks Can Retry Indefinitely with Unbounded Exponential Backoff
scripts/subagent_batch.py:292Batch Concurrency Is Unlimited by Default
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# Kimi K3 Code Subagent 架构学习笔记
> 学习来源: github.com/MoonshotAI/kimi-code (MIT协议, TypeScript)
> 核心包: packages/agent-core/src/session/subagent-host.ts, subagent-batch.ts
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# Kimi K3 Code Subagent 架构学习笔记
> 学习来源: github.com/MoonshotAI/kimi-code (MIT协议, TypeScript)
> 核心包: packages/agent-core/src/session/subagent-host.ts, subagent-batch.ts
The skill explicitly advertises a 'coder' subagent with write/edit capabilities but provides no warning, permission model, or usage constraints around modifying local files. In an agentic environment, this increases the chance that users invoke a file-mutating agent without understanding that it can change repository contents, overwrite files, or introduce unintended persistence.
The skill documents bash-capable execution for the 'coder' subagent without any warning about shell-command risk, environment access, or destructive operations. Because shell access can execute arbitrary commands, exfiltrate data, alter files, or invoke networked tools, omitting a clear warning and guardrails materially increases operational risk.
The top-level natural-language documentation is entirely in Chinese, including the module description and operational comments, which indicates a fixed language choice rather than offering user-selectable locale behavior. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.
start_btw creates a text-only agent with tools_disabled=True, but resume/retry obtain agent state through _get_child_agent, which returns a new object with tools_disabled=False and profile_name='subagent'. This can silently upgrade a restricted side-channel agent into a tool-capable one, violating the intended trust boundary and potentially enabling unauthorized tool execution.
_get_child_agent is documented and used as though it retrieves persisted child-agent state, but it instead fabricates a fresh default dict. That breaks resume/retry semantics, loses security-relevant state such as tool restrictions and prior turns, and can cause policy bypass when later code assumes the returned object reflects the real suspended agent.
This Python file contains natural-language descriptions and usage guidance entirely in Chinese in the module docstring and profile metadata. Under the policy, forcing a specific language without user opt-in or justification is a language/locale policy violation.
The user-facing profile description and when-to-use fields for multiple built-in subagents are encoded entirely in Chinese, with no alternative language or opt-in mechanism. That imposes a specific language on users and downstream consumers without an explicit documented locale constraint.
This markdown file is entirely written in Chinese, including the title and all operational descriptions, with no indication that language selection is optional or that the document is intended for a specific Chinese-only audience. Under the stated policy, forcing a specific language without opt-in is a natural-language policy violation.
The file’s top-level docstring and many inline comments are written only in Chinese, which imposes a specific language on operators and maintainers without any stated opt-in or region-specific justification. Under the policy, language constraints should either offer choice or be clearly documented as intentional and necessary.