Back to skill

Security audit

python-code-analyz

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Python static-analysis skill with a few minor implementation and publishing hygiene issues, but no evidence of hidden, deceptive, destructive, or exfiltrating behavior.

Before installing, note that the skill is primarily Chinese-language and analyzes local Python files you point it at. Avoid running the included example in shared multi-user systems until its fixed /tmp/sample.py path is changed, and maintainers should pin and isolate the ClawHub CLI used for publishing.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
example.py:19
Finding

Predictable Temporary File Allows Symlink-Based File Overwrite

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
PUBLISH.md:5
Finding

Unpinned Global Installation of Third-Party Publishing CLI

Content
View full analysis
/dev/null; then echo -e "${RED}✗ ClawHub CLI 未安装${NC}" echo "请运行: npm i -g clawhub" exit 1 fi ``` ### Technical Analysis The command installs whichever version of the `clawhub` package is currently selected by the npm registry's default distribution tag. No reviewed version, lockfile, integrity digest, package provenance requirement, or verified source is specified. npm packages can define lifecycle scripts that execute during installation. The global installation scope exposes the publisher account's broader environment and places executable files in a shared command location. If the package, maintainer account, registry response, or a future release is compromised, the installed payload may differ from the component originally reviewed with this Skill. The core analyzer itself has no third-party Python dependency and does not execute this installation automatically. The exposure is confined to maintainers who follow the optional publishing workflow. ### Attack Path 1. An attacker compromises the npm package, its maintainer account, its release process, or another component of the package distribution chain. 2. The attacker publishes a malicious version under the version selected by the default npm distribution tag. 3. A publisher follows `PUBLISH.md` or the message emitted by `publish.sh` and runs: ```bash npm i -g clawhub ``` 4. npm downloads the unpinned package and its transitive dependencies. 5. Any permitted installation lifecycle scripts execute with the privileges of the publisher account ...[truncated 1033 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description is written as a direct capability statement in Chinese and presents the tool as the default interaction mode without indicating that other languages are supported. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains user-facing instructions, examples, and operational guidance exclusively in Chinese. The policy requires flagging language or locale constraints when a skill forces a specific language without user opt-in, and no alternative language option or justification is provided here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The top-level description presents the tool as a Python code analysis and optimization tool in Chinese only. This imposes a language choice in user-facing natural language without indicating that users can select another language or locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring is written as a Chinese-only user-facing description ('示例:使用 Code Analyzer 分析代码'), and subsequent printed labels are also Chinese. This indicates a language preference is imposed by the skill content without opt-in or justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · example.py (reported line 32)May include surrounding context.

python
print(analyzer.generate_report(result))
print("\n" + "="*50)
print("按严重性分类的问题数量:")
print(f"  P0 (必须修复): {len(result.get_by_severity(__import__('analyzer').Severity.P0))}")
print(f"  P1 (重要): {len(result.get_by_severity(__import__('analyzer').Severity.P1))}")
print(f"  P2 (建议): {len(result.get_by_severity(__import__('analyzer').Severity.P2))}")

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · example.py (reported line 33)May include surrounding context.

python
print("\n" + "="*50)
print("按严重性分类的问题数量:")
print(f"  P0 (必须修复): {len(result.get_by_severity(__import__('analyzer').Severity.P0))}")
print(f"  P1 (重要): {len(result.get_by_severity(__import__('analyzer').Severity.P1))}")
print(f"  P2 (建议): {len(result.get_by_severity(__import__('analyzer').Severity.P2))}")

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · example.py (reported line 34)May include surrounding context.

python
print("按严重性分类的问题数量:")
print(f"  P0 (必须修复): {len(result.get_by_severity(__import__('analyzer').Severity.P0))}")
print(f"  P1 (重要): {len(result.get_by_severity(__import__('analyzer').Severity.P1))}")
print(f"  P2 (建议): {len(result.get_by_severity(__import__('analyzer').Severity.P2))}")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This shell script uses Chinese for comments, status messages, prompts, and success/failure text throughout, including the user confirmation prompt. That creates a language/locale policy issue because the skill forces a specific language without user opt-in or any indication that it is intentionally limited to Chinese-speaking users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language description and usage labels are presented only in Chinese, which effectively imposes a specific language on users without any opt-in or justification. The policy allows locale constraints when clearly documented and justified, but no such explanation appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file states all update records and linked standards references in Chinese, which indicates a fixed language choice in natural-language content. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation, and no justification or alternative language option is provided here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file contains natural-language instructions only in Chinese, which can constitute a language-policy issue when no user opt-in or alternative locale is offered. The rule for policy violations applies to all file types, and there is no indication that this locale restriction is documented as required or optional.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description is written entirely in Chinese, which signals a language-specific skill presentation without any indication that users can choose another language or that the tool is intentionally region-specific. Under the policy, language constraints should either be optional for users or clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language comment states '无外部依赖,仅使用 Python 标准库' in Chinese, introducing a language-specific instruction/comment without any indication that users can choose their preferred language. The policy for this audit flags language or locale constraints when they are imposed without user opt-in.

Content

No source excerpt is available for this finding.