Back to skill

Security audit

Alibaba Cloud AI Text Document Mind

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Alibaba Cloud DocMind helper, with expected cloud credential and document-processing behavior but some setup and validation quality caveats.

Install only if you intend to send selected documents or document URLs to Alibaba Cloud DocMind. Use least-privilege Alibaba Cloud credentials, avoid confidential or internal URLs unless approved for external processing, and treat the included validation section as unreliable until replaced with Node.js checks.

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

Note
Location
scripts/quickstart.js:8
Finding

Unvalidated Polling Controls Permit Unbounded and Excessive API Requests

Content
View full analysis
= maxPolls) { console.error('Polling timed out.'); process.exit(1); } await sleep(pollIntervalMs); } ``` ### Technical Analysis `DOCMIND_POLL_INTERVAL_MS` and `DOCMIND_MAX_POLLS` are converted with `Number()` but are not checked for finiteness, integer form, positivity, or safe bounds. For example, setting `DOCMIND_MAX_POLLS=NaN` produces JavaScript's `NaN` value. Every comparison of the form `polls >= NaN` evaluates to `false`, so the maximum-poll termination condition cannot be reached. Setting `DOCMIND_POLL_INTERVAL_MS=0`, a negative value, or a nonnumeric value can cause `setTimeout()` to use an effectively immediate delay. Combining these values allows the loop to issue rapid requests without enforcing its intended maximum. The issue is limited to users or automation able to control the script's environment; it does not independently grant access to the host or Alibaba Cloud credentials. ### Attack Path 1. An attacker or untrusted automation controls environment variables supplied to the process. 2. The attacker sets: ```bash DOCMIND_MAX_POLLS=NaN DOCMIND_POLL_INTERVAL_MS=0 ``` 3. The script converts these strin ...[truncated 914 chars]
Remediation
View remediation
max) { throw new Error( `${name} must be an integer between ${min} and ${max}` ); } return value; } const pollIntervalMs = readBoundedInteger( 'DOCMIND_POLL_INTERVAL_MS', 10000, 1000, 60000 ); const maxPolls = readBoundedInteger( 'DOCMIND_MAX_POLLS', 120, 1, 7200 ); ``` Additional hardening measures should include: 1. Rejecting invalid configuration before creating the API client or submitting a job. 2. Enforcing both a poll-count limit and an absolute elapsed-time deadline. 3. Applying exponential backoff with a maximum delay when transient API failures occur. 4. Catching API exceptions and terminating cleanly after a bounded number of retries. 5. Documenting the accepted numeric ranges for both environment variables. 6. Adding tests for `NaN`, `Infinity`, negative values, zero, fractional values, and excessively large integers. ]]>
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 (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs use of environment-based cloud credentials and code execution capabilities but does not declare any explicit tool scope or permission boundaries. In an agent setting, this can cause the skill to run with broader ambient privileges than intended, increasing the risk of unauthorized use of credentials or networked API actions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The validation section claims to validate a Node.js SDK skill, but the commands instead compile Python files from a scripts directory pattern that likely does not exist for this skill. This creates a false sense of assurance: broken, unsafe, or untested Node.js behavior could be accepted as 'validated' even though the actual implementation was never exercised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script takes a document URL from an environment variable and submits it to Alibaba Cloud DocMind, which sends document content or a provider-fetched reference to an external third-party service. In an agent workflow, this can cause unannounced exfiltration of sensitive documents if users or upstream tools supply confidential internal URLs or presigned links without clear consent or validation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.