Back to skill

Security audit

Tensorslab Image

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill is mostly coherent, but it needs review because it uploads user images/prompts to an external service and has local download/write safety gaps.

Install only if you are comfortable sending prompts and any selected images to TensorsLab for processing. Avoid confidential, regulated, copyrighted, or identity-sensitive images unless you have reviewed the provider terms and have permission to edit them. Treat watermark removal and face replacement requests carefully, and prefer running the script in a limited working directory until filename and download validation are improved.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tensorslab_image.py:76
Finding

Unvalidated API-Provided URLs Permit Arbitrary Network Requests and Unbounded Downloads

Content
View full analysis
Path: """Download an image from URL to local path.""" try: response = _SESSION.get(url, timeout=30) response.raise_for_status() content_type = response.headers.get('content-type', '').split(';')[0].strip() ext = mimetypes.guess_extension(content_type) if ext == '.jpe': ext = '.jpg' if not ext: ext = Path(urlparse(url).path).suffix if not ext or len(ext) > 6: ext = '.png' final_path = output_path.with_suffix(ext) with open(final_path, 'wb') as f: f.write(response.content) return final_path except Exception as e: logger.warning(f"Warning: Failed to download image from {url}: {e}") return None ``` The URL is obtained from API-controlled task data and passed directly to the download function: ```python for i, url in enumerate(urls): filename = f"{task_id}_{i}" output_path = output_dir / filename logger.info(f"📥 Downloading image {i+1}/{len(urls)}") final_path = download_image(url, output_path) if final_path: downloaded_files.append(str(final_path)) ``` ### Technical Analysis The application trusts image URLs returned by the remote task-status API. It does not validate: - The URL scheme. - The destination hostname or resolved IP address. - Whether the destination belongs to an approved image-storage domain. - Redirect destinations. - Whether the resolved address is loopback, private, link-local, or otherwise internal. - The response body size. - Whether the response is actually a valid image. The `Content-Type` header is used only to determine the output extension. I ...[truncated 1637 chars]
Remediation
View remediation
MAX_IMAGE_BYTES: raise TensorsLabAPIError("Downloaded image exceeds size limit") output.write(chunk) ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tensorslab_image.py:178
Finding

API-Controlled Task Identifier Is Used in an Output Path Without Sanitization

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:116
Finding

Dependency Installation Instructions Use an Unpinned Package

Content
View full analysis
Remediation
View remediation
\ --hash=sha256: ``` All transitive dependencies should also be pinned and hash-verified in the lock or requirements file. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description overstates the skill's functionality. The implemented code clearly supports generating images from text, optional image-to-image generation via local files or image URLs, polling for completion, and saving outputs locally. It also correctly relies on the TENSORSLAB_API_KEY environment variable. However, there is no code for dedicated avatar generation, watermark removal, object erasure, face replacement, or broader editing workflows. Those would require separate parameters, endpoints, or processing logic not present here. The only partial match to 'automatic prompt enhancement' is a model-specific prompt_extend flag for zimage, which does not justify the broad advanced-editing claims. This is a description-to-behavior mismatch due to significant declared capabilities not actually implemented.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/tensorslab_image.py (reported line 59)May include surrounding context.

python
def get_api_key() -> str:
    """Get API key from environment variable."""
    api_key = os.environ.get("TENSORSLAB_API_KEY")
    if not api_key:
        raise TensorsLabAPIError(

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares operational behavior that requires environment access, network access, and shell execution, but it does not define any tool scope or permission boundaries. This can cause an agent runtime to grant broader capabilities than users expect, increasing the chance of unintended secret access, external data transmission, or command execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs users to provide prompts and local source images to an external API, but it does not clearly warn that this content leaves the local environment. Users may unknowingly upload sensitive images, personal data, or confidential prompts to a third-party service, creating privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file instructs the agent to display a fixed Chinese message when the API key is missing, and additional required user-facing text elsewhere is also Chinese. This imposes a specific language on users without opt-in or any stated region-specific justification, 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
93% confidence
Finding

The error-handling table and completion message specify fixed Chinese-language strings for user communication. Since the file does not offer language selection or explain a necessary locale constraint, these hardcoded templates violate the requirement not to force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file documents authenticated API requests and later describes sending prompts, source images, and image URLs to a remote third-party service, but it does not warn users that their content and credentials are transmitted off-system. For markdown files, omission of warnings about behaviors affecting privacy or user data is in scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown describes a delete endpoint that removes image tasks, but it provides no caution that the action is destructive or may be irreversible. For markdown files, destructive behaviors that can affect user data should be accompanied by an explicit warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented scenarios explicitly support watermark removal, object erasure, and face replacement without any warnings to verify ownership, consent, or legal authorization before editing images. In this skill context, those capabilities materially increase misuse risk because they can facilitate copyright circumvention, deceptive media creation, and unauthorized biometric/identity manipulation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill documents automatic local file saving but does not clearly warn users that generated outputs will be written to disk. This can create privacy, storage, and operational issues, especially in shared workspaces or environments handling sensitive generated content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file specifies a user message entirely in Chinese for insufficient credits, which imposes a specific language in natural-language content. Because no opt-in, fallback, or justification for a Chinese-only locale is provided, this is a language-policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The file presents user inputs, trigger keywords, and prompt guidance in both Chinese and English, but does not state that language is user-selectable or otherwise document a locale policy. Per the policy rule, language behavior should not be implicitly forced or assumed without opt-in or clear justification.

Content

No source excerpt is available for this finding.