Back to skill

Security audit

U2-doc-parser

Security checks for vulnerabilities and agentic risk

Overview

The skill clearly discloses that it uploads documents to an external UniDoc service, but its implementation has under-scoped network fetching and a force option that can delete directories.

Review before installing. Use only non-sensitive test documents, since files are uploaded to an external unauthenticated UAT service. Avoid --skip-security-check and do not set UNIDOC_BASE_URL or UNIDOC_API_KEY unless you fully trust the endpoint. Do not use --force with paths that may be directories until the recursive deletion behavior is fixed.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/unidoc_parse.py:343
Finding

Unrestricted Server-Controlled URL Enables Server-Side Request Forgery

Content
View full analysis
Remediation
View remediation
str: parsed = urlparse(value) if parsed.scheme != "https": raise ValueError("Export URL must use HTTPS") if parsed.username or parsed.password: raise ValueError("Credentials are not allowed in export URLs") if parsed.hostname not in ALLOWED_EXPORT_HOSTS: raise ValueError("Untrusted export hostname") for result in socket.getaddrinfo(parsed.hostname, parsed.port or 443): address = ipaddress.ip_address(result[4][0]) if ( address.is_private or address.is_loopback or address.is_link_local or address.is_reserved or address.is_multicast or address.is_unspecified ): raise ValueError("Export URL resolves to a prohibited address") return value ` ...[truncated 106 chars]

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/unidoc_parse.py:138
Finding

Force Option Can Recursively Delete an Arbitrary Existing Directory

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Tainted flow: 'SYNC_UPLOAD_URL' from os.getenv (line 31, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 230)May include surrounding context.

python
with open(file_path, 'rb') as file:
            files = {'file': file}
            response = requests.post(
                SYNC_UPLOAD_URL,
                data=body,
                files=files,

Tainted flow: 'ASYNC_UPLOAD_URL' from os.getenv (line 32, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 268)May include surrounding context.

python
with open(file_path, 'rb') as file:
            files = {'file': file}
            response = requests.post(
                ASYNC_UPLOAD_URL,
                data=body,
                files=files,

Tainted flow: 'STATUS_URL' from os.getenv (line 34, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 298)May include surrounding context.

python
raise TimeoutError("File conversion timed out after 5 minutes")

            params = {"fileId": file_id}
            response = requests.get(
                url=STATUS_URL,
                params=params,
                headers=headers,

Tainted flow: 'EXPORT_URL' from os.getenv (line 33, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 332)May include surrounding context.

python
headers['Authorization'] = f'Bearer {API_KEY}'

        params = {"fileId": file_id, "targetType": self.target_type}
        response = requests.get(
            url=EXPORT_URL,
            params=params,
            headers=headers,

Tainted flow: 'file_url' from requests.get (line 343, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
98% confidence
Finding

The code fetches a second URL returned by the remote API and only checks that it starts with http:// or https://. A malicious or compromised service can supply an arbitrary URL, turning this into SSRF that can make the host contact internal services or attacker infrastructure, and the use of plain HTTP also permits man-in-the-middle redirection or content tampering.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 352)May include surrounding context.

python
if not isinstance(file_url, str) or not file_url.startswith(('http://', 'https://')):
            raise ValueError(f"Invalid file URL returned: {file_url}")

        content = requests.get(file_url, timeout=60).content.decode('utf-8')
        return content

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 363)May include surrounding context.

python
func: str = "unisound",
    uid: Optional[str] = None,
    output_path: Optional[str] = None,
    skip_security_check: bool = False,
    force: bool = False
) -> str:
    """

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 374)May include surrounding context.

python
func: str = "unisound",
    uid: Optional[str] = None,
    output_path: Optional[str] = None,
    skip_security_check: bool = False,
    force: bool = False
) -> str:
    """

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 495)May include surrounding context.

python
func: str = "unisound",
    uid: Optional[str] = None,
    output_path: Optional[str] = None,
    skip_security_check: bool = False,
    force: bool = False
) -> str:
    """

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 513)May include surrounding context.

python
func: str = "unisound",
    uid: Optional[str] = None,
    output_path: Optional[str] = None,
    skip_security_check: bool = False,
    force: bool = False
) -> str:
    """

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Passing skip_security_check into check_environment_security allows callers to suppress the interactive safeguard that otherwise blocks plaintext HTTP use. In this tool's context, which uploads local documents to an external service and already warns that UAT lacks authentication, making it easy to bypass transport-security friction increases the risk of accidental document disclosure over insecure channels.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 379)May include surrounding context.

python
:return: 转换后的内容
    """
    # 安全检查
    check_environment_security(skip_interactive=skip_security_check)

    # 验证输入文件
    validate_input_file(file_path)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

The CLI exposes --skip-security-check, which lets users bypass safeguards before uploading files to a third-party endpoint. In a document-processing skill, this is more dangerous because the primary asset is user-provided document content, and bypassing transport or environment warnings can directly facilitate exfiltration of sensitive data to insecure or unauthenticated services.

Content

Scanner excerpt · scripts/unidoc_parse.py (reported line 481)May include surrounding context.

python
)

    parser.add_argument(
        "--skip-security-check",
        action="store_true",
        help="Skip security warnings (not recommended)"
    )

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language comments and metadata in the header are written entirely in Chinese, which reflects a fixed language choice in the skill content. There is no accompanying indication that the skill is region-specific or that users can opt into this locale, which can conflict with organizational language/locale policy requirements.

Content

No source excerpt is available for this finding.