Back to skill

Security audit

SkillGuard - OWASP ASI Agent安全扫描器

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real local security scanner, but it handles untrusted ZIP files without size limits, which can exhaust disk or memory.

Review this skill before installing in sensitive or shared environments. If used, run it in a sandbox or with resource limits, especially when scanning third-party ZIPs, and treat its results as advisory because one permission cross-check can miss cases. Expect Chinese-language CLI output and reports.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
skillguard/orchestrator.py:25
Finding

Unbounded Extraction and Memory Loading of Untrusted ZIP Archives

Content
View full analysis

Vulnerability Details

File Location: skillguard/orchestrator.py, lines 25–43
Vulnerability Type: Uncontrolled resource consumption through archive extraction
Risk Level: High

Vulnerable Code

python
with tempfile.TemporaryDirectory() as tmpdir:
    try:
        with zipfile.ZipFile(zip_path, 'r') as zf:
            zf.extractall(tmpdir)
    except (zipfile.BadZipFile, FileNotFoundError) as e:
        ctx.skill_name = os.path.basename(zip_path)
        ctx.skill_description = f"ZIP extraction failed: {e}"
        return ctx

    # Walk extracted directory
    for root, dirs, files in os.walk(tmpdir):
        for filename in files:
            full_path = os.path.join(root, filename)
            rel_path = os.path.relpath(full_path, tmpdir)

            try:
                with open(full_path, 'rb') as f:
                    raw = f.read()
                ctx.all_files[rel_path] = raw
            except:
                continue

Technical Analysis

The scanner accepts an untrusted ZIP package and calls extractall() without first enforcing limits on the number of entries, individual uncompressed file size, aggregate uncompressed size, or compression ratio. A small, highly compressed archive can therefore expand into a volume of data that exhausts available disk space.

After extraction, every file is read in full through f.read() and retained in ctx.all_files. This duplicates the resource risk at the memory layer. Retaining all binary files is unnecessary for the declared static-analysis functionality because the detectors primarily use decoded Python files, SKILL.md, and requirements.txt.

The temporary directory provides cleanup after normal completion, but it does not prevent disk, memory, or CPU exhaustion while extraction and loading are in progress.

Attack Path

  1. An attacker prepares a ZIP bomb or an archive containing numerous large files with a ...[truncated 1478 chars]
Remediation
View remediation

Remediation Suggestions

  1. Inspect every ZipInfo entry before extraction and reject archives exceeding explicit limits for:

    • Total entry count.
    • Maximum uncompressed size per entry.
    • Maximum aggregate uncompressed size.
    • Maximum compression ratio.
    • Maximum path depth and filename length.
  2. Extract entries individually instead of using unrestricted extractall(). Track the number of bytes written and abort immediately when a configured quota is exceeded.

  3. Stream supported files with bounded reads rather than calling unrestricted f.read(). Reject or truncate files exceeding the scanner's per-file analysis limit.

  4. Do not retain every extracted binary in ctx.all_files. Store only files required by enabled detectors, or retain metadata and bounded content for supported file types.

  5. Apply process-level memory, disk, CPU, and execution-time limits when scanning attacker-controlled packages.

  6. Return a clear scan failure when any quota is exceeded, and ensure partially extracted temporary content is cleaned up.

  7. Add regression tests using high-compression archives, oversized entries, excessive entry counts, deeply nested archives, and large collections of small files.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language content in the manifest description and the body of the markdown consistently forces Chinese as the interaction language. Under the stated policy, this is a language/locale constraint that should either provide user opt-in or be clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains multiple user-facing description and remediation strings written only in Chinese, such as danger descriptions and fix guidance. The file provides no indication that Chinese is optional or that users can choose their preferred language, which can violate a language/locale policy requiring user choice or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The detector’s finding descriptions and remediation text in this section are written in Chinese, while the rest of the file structure and identifiers are English. This imposes a specific language on downstream users without any opt-in, locale selection, or justification that the skill is intended only for Chinese-speaking environments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The title, description, and remediation for the 'too many dependencies' finding are also hard-coded in Chinese. Because these strings are presented as detector output and there is no documented locale constraint or user choice, they violate the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file contains multiple user-facing natural-language strings in Chinese, including finding descriptions and remediation text, which would force a specific language on downstream users or analysts. The file does not offer language selection or indicate that the detector is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The cognitive attack pattern descriptions are emitted as Chinese-only finding titles, which creates a language-policy issue for users who have not opted into that locale. Because the file is not documented as region-specific, this appears to impose a language choice implicitly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The remediation guidance embedded in generated findings is natural-language output intended for users, but it is only written in Chinese. Without user opt-in or locale scoping, this violates the language/locale policy described in the audit criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The detector embeds natural-language finding titles/messages in Chinese string literals, such as the descriptions for suspicious URL patterns. This imposes a specific language on users without offering opt-in or documenting that the skill is intentionally Chinese-only, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The network call descriptions and later finding/remediation text are generated in Chinese, which forces a specific language for outputs. Because there is no visible user choice or justification for a Chinese-only locale, this 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
92% confidence
Finding

The detector constructs user-visible titles, descriptions, and remediation guidance in Chinese for network findings and the summary output. This enforces a specific language regardless of user preference and lacks any documented opt-in or regional justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The permission labels are hard-coded in Chinese, and the detector later surfaces these strings in findings shown to users. This imposes a specific language/locale in natural-language output without opt-in or any documented region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The finding title, description, and remediation text are all emitted in Chinese and there is no indication that users can choose another language or that the detector is region-specific. This is a natural-language policy issue because it forces a locale in generated messages.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The detector aggregates permissions across all Python files, but the later has_critical check is computed only from file_perms after the loop, which means it reflects only the last scanned file. This creates a logic flaw in the security scanner itself: a skill using critical operations in an earlier file may avoid the undocumented-critical-permission warning if the final file is benign, weakening detection coverage and allowing risky skills to be under-reported.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code embeds user-facing descriptions for findings entirely in Chinese across multiple detection patterns, and the remediation string is also Chinese. The file does not indicate that the skill is intentionally region-specific or that users can choose locale, which creates a natural-language policy issue under the language/locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code hard-codes user-facing titles and descriptions in Chinese across the secret-pattern definitions, and the remediation strings later in the file are also Chinese-only. That creates a language/locale constraint without user opt-in, which matches the policy-violation category for natural-language locale requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The finding title, description, and remediation for high-entropy detection are emitted only in Chinese, with no indication that users can choose another language. This is a natural-language policy issue because the skill enforces a specific locale in generated output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code embeds user-facing/descriptive strings exclusively in Chinese, such as finding titles and remediation text, without offering a language choice or documenting that the detector is intentionally Chinese-only. That can violate a language/locale policy if the surrounding skill ecosystem is expected to be language-neutral or user-selectable.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file hard-codes Chinese natural-language output such as rating labels and descriptions, rather than offering a language choice. The policy explicitly flags locale or language restrictions when they are forced without user opt-in, and the file does not document a region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The generated Markdown report consists of Chinese headings, labels, descriptions, and footer text, which enforces a specific language in user-facing output. Because no opt-in, fallback, or locale selection is provided, this matches the natural-language policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The CLI description, examples, command help, and later status output are presented in Chinese, which imposes a specific language on all users. The file does not provide any opt-in, locale selection, or documented region-specific justification for this language constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The string literal assigned on ZIP extraction failure is hard-coded in Chinese: "ZIP提取失败". This imposes a specific language for user-visible output without any apparent locale selection or opt-in, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
skillguard/detectors/code_execution.py:13