Back to skill

Security audit

Tensorslab Video

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its video-generation purpose, but its helper script trusts remote API values enough to download arbitrary URLs and write files outside the intended output folder.

Review before installing. Use a low-privilege account or isolated workspace, set the API key through `TENSORSLAB_API_KEY` rather than `--api-key`, avoid sensitive source images unless you trust the provider, and prefer a patched version that validates download URLs, enforces download size limits, pins dependencies, and sanitizes task IDs before writing files.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/tensorslab_video.py:70
Finding

Unvalidated API-Controlled Video URL Enables Server-Side Request Forgery and Unbounded Downloads

Content
View full analysis
bool: """Download a video from URL to local path.""" try: response = _SESSION.get(url, timeout=300, stream=True) response.raise_for_status() total_size = int(response.headers.get('content-length', 0)) with open(output_path, 'wb') as f: if total_size > 0: downloaded = 0 for chunk in response.iter_content(chunk_size=8192): if chunk: f.write(chunk) downloaded += len(chunk) percent = (downloaded / total_size) * 100 logger.info(f"\r📥 Downloading: {percent:.1f}%") else: f.write(response.content) logger.info(f"\r✅ Download complete: {output_path}") return True except Exception as e: logger.warning(f"\r⚠️ Failed to download video from {url}: {e}") return False ``` The URL passed into this function comes directly from the task-status API response: ```python urls = task_data.get("url", []) if not urls: logger.warning("⚠️ No videos returned") return downloaded_files for i, url in enumerate(urls): url_path = urlparse(url).path ext = Path(url_path).suffix if not ext or len(ext) > 5: ext = ".mp4" filename = f"{task_id}_{i}{ext}" output_path = output_dir / filename logger.info(f"📥 Downloading video {i+1}/{len(urls)}: {output_path}") if download_video(url, output_path): downloaded_files.append(str(output_path)) ``` ### Technical Analysis The client trusts download URLs supplied by the remote task-status service and sends requests to them without validating the URL scheme, hostname, res ...[truncated 2027 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/tensorslab_video.py:295
Finding

API-Controlled Task Identifier Can Escape the Intended Output Directory

Content
View full analysis
5: ext = ".mp4" filename = f"{task_id}_{i}{ext}" output_path = output_dir / filename logger.info(f"📥 Downloading video {i+1}/{len(urls)}: {output_path}") if download_video(url, output_path): downloaded_files.append(str(output_path)) ``` The resulting path is opened for writing in the download function: ```python with open(output_path, 'wb') as f: ``` ### Technical Analysis The filename incorporates `task_id`, which originates from an API response, without restricting it to a safe identifier character set. The code does not reject absolute paths, directory separators, `..` components, or platform-specific path prefixes. With `pathlib`, joining an absolute second path can discard the intended `output_dir`. Traversal components can likewise resolve outside that directory. The subsequent use of `open(..., "wb")` creates or truncates the selected file. The extension is derived from another API-controlled value, the download URL. Although extensions longer than five characters are replaced with `.mp4`, this is not a sufficient filename or destination validation mechanism. ### Attack Path 1. An attacker gains control over the task creation response and returns a crafted `taskid`, or compromises the API state associated with the task. 2. The crafted identifier contains an absolute path or traversal components, such as `../../target`. 3. The task-status response reaches the completed state and supplies attacker-controlled downloadable content. 4. The client constructs `output_path` from the unsafe identifier. 5. `open(output_path, "wb")` creates or truncates a file outside the configured outp ...[truncated 673 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tensorslab_video.py:390
Finding

API Key Can Be Exposed Through Command-Line Arguments

Content
View full analysis
`. 2. The complete command is retained in shell history or exposed in the process command line. 3. Another local user, administrator, monitoring service, log reader, or compromised process retrieves the argument. 4. The attacker reuses the Bearer token against the TensorsLab API. 5. The attacker consumes account credits or accesses API functions available to that credential. ### Impact Assessment An exposed key grants the attacker the TensorsLab API privileges associated with the victim account. Likely consequences include unauthorized video-generation requ ...[truncated 282 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:119
Finding

Dependency Installation Instruction Is Unpinned and Lacks Integrity Verification

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

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_video.py (reported line 60)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
92% confidence
Finding

The skill documents and encourages use of environment variables, network access, and shell/Python execution, but it does not declare any explicit tool scope or permissions. This weakens sandboxing and review controls because an agent may invoke broader capabilities than a user or platform policy expects, increasing the chance of unintended command execution, data access, or outbound requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file instructs the agent to display a fixed Chinese message when the API key is missing, and similar fixed Chinese user-facing messages appear elsewhere. This imposes a specific language on users without documenting a locale requirement or offering an alternative, which is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The progress-tracking section includes Chinese-only status text that the agent is told to print every 60 seconds, and the completion message later is also Chinese-only. Because the skill does not offer language selection or justify a Chinese-only locale, it violates the language/locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation specifies a user message entirely in Chinese for the insufficient credits case, with no indication that language is configurable or limited to a Chinese-speaking audience. This is a natural-language locale policy issue because it imposes a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file documents a task deletion operation but provides no warning that the action removes tasks, nor any note about its effects or reversibility. Under the markdown-specific warning rule, descriptions of operations that could affect user data or system state should disclose that impact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code emits a progress message entirely in Chinese, which imposes a specific language on users without opt-in or documented locale constraints. The stated policy flags language/locale restrictions when the skill does not offer a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The final success message is presented entirely in Chinese, with no mechanism for the user to choose or configure output language. This is a natural-language policy issue because it enforces a locale-specific user experience without justification or opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.