Back to skill

Security audit

zzheng

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Chinese legal article generator that fetches public hot topics and writes local article files, with no evidence of hidden control, credential access, exfiltration, or persistence beyond its disclosed output files.

Install in a virtual environment, consider pinning dependency versions, and expect the script to contact public Chinese news/social services and create or overwrite dated article files plus progress JSON in its configured output directory.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Note
Location
SKILL.md:19
Finding

Unpinned Third-Party Python Dependencies

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 19-26
Vulnerability Type: Unpinned third-party dependencies
Risk Level: Low

Vulnerable Code

markdown
## Dependency Requirements
- Python 3.7+
- requests
- beautifulsoup4

Install dependencies:
```bash
pip install requests beautifulsoup4
text

### Technical Analysis

The documented installation command retrieves `requests`, `beautifulsoup4`, and their transitive dependencies without version constraints or integrity hashes. Consequently, the exact code installed can change between installations even when the audited project remains unchanged.

The package names correspond to established packages, and the audit found no evidence of dependency confusion, typosquatting, an unsafe custom package index, or an intentionally malicious dependency. Nevertheless, unconstrained resolution creates a supply-chain exposure: a compromised upstream release, compromised package-publishing account, or unexpectedly incompatible future version could introduce malicious or vulnerable code.

Python package installation can execute package build logic under the privileges of the user running `pip`. Imported dependencies also execute Python module initialization code when the article-generation script starts.

### Attack Path

1. An upstream package or one of its transitive dependencies is compromised, or a malicious release is published under a trusted package name.
2. A user follows the documented `pip install requests beautifulsoup4` command.
3. The package resolver selects the affected release because no approved version or hash is specified.
4. Malicious code may execute during package installation, build processing, or subsequent import by `scripts/generate_articles.py`.
5. The code runs with the filesystem, network, and other privileges of the invoking user.

This path depends on an external package or package-distribution compromise; the reviewed pro
...[truncated 854 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin direct dependencies to reviewed versions in a requirements file, for example:

    text
    requests==<reviewed-version>
    beautifulsoup4==<reviewed-version>
    
  2. Generate and verify cryptographic hashes for direct and transitive dependencies, using a lockfile or a hash-enforced installation command such as:

    bash
    pip install --require-hashes -r requirements.txt
    
  3. Produce the lockfile with a trusted dependency-management tool and commit it to the project so installations are reproducible.

  4. Periodically update pinned versions through a controlled review process that includes vulnerability scanning and testing.

  5. Install dependencies inside an isolated virtual environment using an unprivileged account. Do not run the installation command as an administrator or root user.

  6. Use only an explicitly trusted package index and configure package-index allowlisting where the deployment environment supports it.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file title, runtime messages, generated article templates, and HTTP Accept-Language header are all fixed to Chinese/zh-CN behavior. This imposes a specific language and locale without opt-in or explanation that the tool is intentionally limited to a region-specific audience.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate_articles.py (reported line 134)May include surrounding context.

python
"""腾讯新闻"""
        topics = []
        try:
            r = self.session.get('https://api.inews.qq.com/event/1.0/getHotRecommendList?page=1&pageSize=20', timeout=8)
            if r.ok:
                data = r.json()
                for item in data.get('data', {}).get('list', [])[:15]:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code creates an output directory and writes multiple files, including dated article text files and progress JSON state, but provides no upfront disclosure in comments/docstrings or confirmation before modifying the filesystem. The later success prints only report file paths after the writes occur, which does not warn users in advance about persistent local changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations in natural-language content. The skill title, instructions, and generated article naming conventions all assume Chinese-language公众号 content, but the document does not indicate that this is optional, user-selected, or narrowly justified as a region-specific tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This is a markdown file, so SQP-2 applies to omissions in user-facing warnings. The document states that the tool prioritizes grabbing real-time legal hot topics from Weibo, Baidu, Zhihu, and Tencent News, yet the usage section provides no explicit warning that running the skill will make outbound network requests to third-party services.

Content

No source excerpt is available for this finding.