T09 · Insecure Skill Coding Practices
- Location
generators/hook_generator.py:111- Finding
Generated hooks expose complete pipeline contexts through logging
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This OpenClaw analyzer is mostly coherent, but its generated hooks can log complete agent context and its write behavior is not clearly scoped, so it needs review before use.
Install only if you are comfortable reviewing and editing the generated hooks before enabling them. Remove full-context logging, validate hook names and output paths, and run the analyzer in a version-controlled or disposable workspace so generated files are easy to inspect and undo.
generators/hook_generator.py:111Generated hooks expose complete pipeline contexts through logging
generators/hook_generator.py:122Unsanitized hook names allow writes outside the selected output directory
run.sh:7Entry script may execute attacker-controlled relative Python files after directory-change failure
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
"replace": {
"function": "replace_context_gather",
"signature": "async replace_context_gather(context, next) => {...}",
"description": "Hook point: replace context_gather"
}
}
},
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
"replace": {
"function": "replace_context_gather",
"signature": "async replace_context_gather(context, next) => {...}",
"description": "Hook point: replace context_gather"
}
}
},
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
"replace": {
"function": "replace_memory_retrieve",
"signature": "async replace_memory_retrieve(context, next) => {...}",
"description": "Hook point: replace memory_retrieve"
}
}
},
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
"replace": {
"function": "replace_memory_retrieve",
"signature": "async replace_memory_retrieve(context, next) => {...}",
"description": "Hook point: replace memory_retrieve"
}
}
},
The natural-language documentation is entirely in Chinese, with no indication that users may choose another language or that the skill is intended only for a Chinese-speaking audience. Under the language/locale policy, forcing a specific language without user opt-in is a policy concern.
The skill explicitly advertises automatic hook generation and report saving, both of which can write files into the workspace, but it does not warn users that running these actions may modify project state. In a tool that targets architecture analysis and extension generation, undocumented write behavior increases the risk of unintended code or artifact creation and makes misuse or accidental execution more dangerous.
This Python file contains natural-language descriptions such as the module docstring and later console output in Chinese only. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is explicitly justified.
The script prints progress and status messages only in Chinese during execution. Because this affects runtime interaction and no language selection or justification is provided, it violates the language/locale policy for natural-language content in code.
The code synthesizes hook points for every detected or inferred stage and then emits them with concrete file and line metadata, which can mislead downstream users into believing those hooks were actually discovered in the target codebase. In a security or architecture context, fabricated analysis results can drive unsafe modifications, incorrect trust decisions, or conceal the fact that no real hook exists at that location.
The hook logs the entire context object before passing control onward, which can expose sensitive user input, credentials, tokens, prompts, or other internal state to application logs. Because this is a pre-input hook, it is positioned to capture raw inbound data broadly, making accidental data leakage more likely across many requests.
The hook logs the entire context object before submitting to the next stage, which can expose prompts, user inputs, credentials, tokens, or other sensitive runtime metadata to logs. In an LLM pre-submit hook, this is more dangerous because context commonly contains raw user content and operational secrets, and logs are often broadly accessible and retained.
The hook logs the entire context object before a memory retrieval operation, which may contain prompts, user data, system instructions, tokens, or other sensitive runtime state. Even if intended for debugging, broad context logging can expose confidential information to logs, log processors, or operators without any minimization or redaction.
The hook logs the entire context object, which commonly contains prompts, user inputs, tokens, credentials, conversation state, or other sensitive runtime data. Writing this wholesale to logs can create an unintended disclosure channel, especially if logs are retained, centralized, or accessible to operators and downstream systems.
Multiple natural-language elements in the file, including the module docstring and runtime status messages, are presented exclusively in Chinese. Under the stated policy, forcing a specific language without offering a user choice is a natural-language policy violation.
This Python code creates directories and writes multiple files under the configured output path, but provides no prompt, cautionary comment, or docstring warning that it will modify the filesystem. Although it prints a count after saving, that disclosure happens only after the writes and does not warn the user beforehand.
The module docstrings and all user-facing status text are written in Chinese, indicating the skill is intended to operate in a single language. Under the policy, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy concern.
This Python file contains natural-language descriptions in Chinese in the module docstring, and the same locale-specific pattern continues in user-facing print output later in the file. Because the skill does not offer language selection or explain that it is intended only for a Chinese-speaking context, it violates the language/locale policy for all file types.
The main execution path prints status and results exclusively in Chinese, which creates a locale-specific user experience regardless of user preference. The file provides no option to select another language and no documented reason for restricting runtime messaging to Chinese.
The method is documented as analyzing 'tool implementations', which implies inspection of executable code. In practice it only scans markdown files under docs/tools and returns their stems, so the behavior contradicts the stated analysis intent.
This markdown file presents all headings and guidance in Chinese, with no indication that the language is selectable or that the report is intentionally region-specific. The policy requires avoiding fixed language or locale constraints unless users can opt in or the constraint is clearly justified.