Back to skill

Security audit

Tomoviee Image Recognition

Security checks for vulnerabilities and agentic risk

Overview

This image-mask skill uses a real third-party API workflow, but it needs Review because it recommends exposing reusable API credentials and includes broader generation guidance than its stated purpose.

Install only if you are comfortable sending image URLs and prompts to Wondershare/Tomoviee and managing API credentials carefully. Do not run the documented token helper with real secrets in shared terminals, CI logs, or agent transcripts; prefer protected environment variables or a secret manager, and rotate any credentials already exposed through command-line history or printed output.

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

Warning
Location
scripts/generate_auth_token.py:27
Finding
Reusable API Credentials Exposed Through Command-Line Arguments and Standard Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/generate_auth_token.py:27-42` **Vulnerability Type**: Sensitive credential exposure **Risk Level**: Medium ### Vulnerable Code ```python credentials = f"{app_key}:{app_secret}" access_token = base64.b64encode(credentials.encode()).decode() return access_token if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: python generate_auth_token.py <app_key> <app_secret>") sys.exit(1) app_key = sys.argv[1] app_secret = sys.argv[2] token = generate_access_token(app_key, app_secret) print(f"Access Token: {token}") print(f"\nUse in Authorization header as: Basic {token}") ``` The insecure invocation is also explicitly recommended in `SKILL.md:19`: ```bash python scripts/generate_auth_token.py YOUR_APP_KEY YOUR_APP_SECRET ``` ### Technical Analysis The script accepts the application secret as a command-line argument and prints a Base64 representation of `app_key:app_secret` to standard output. Base64 is an encoding mechanism, not encryption. Any party that obtains the generated token can decode it to recover both credential values or replay it directly as an HTTP Basic Authorization credential. Printing the token therefore has substantially the same security implications as printing the original secret. Passing the secret through `sys.argv` can expose it through shell history, process inspection facilities, diagnostic tooling, terminal recording, and execution logs. Printing the generated token creates additional exposure through Agent transcripts, captured standard output, CI logs, shell scrollback, and other logging systems. The client-side Base64 construction in `scripts/tomoviee_recognition_client.py:17-25` is not independently classified as a vulnerability because it constructs a standard Basic-auth header in memory and sends it over HTTPS to the fixed, documented Wondershare API. The avoidable security issue is the separate helper's disclosu ...[truncated 1645 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the standalone workflow that prints the complete Basic-auth token. Construct the Authorization header only in memory immediately before an API request. 2. Do not accept application secrets through command-line arguments. Retrieve them from a protected secret manager, restricted environment variable, or hidden interactive input using `getpass.getpass()`. 3. If a token-generation utility must remain, do not print the token by default. Pass it directly to the consuming process through a protected channel. 4. Redact credentials and Authorization headers from all logs, exceptions, Agent responses, debug output, and telemetry. 5. Update `SKILL.md` so it no longer recommends placing secrets on the command line. 6. Minimize credential lifetime in memory and avoid storing the generated token as long-lived object state where practical. 7. Rotate any credentials that have already been used with this helper in logged, shared, or Agent-observed environments. 8. Apply least-privilege service permissions, quota limits, and service-side credential rotation policies to reduce the impact of future disclosure. ]]>
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
99% confidence
Finding
The declared purpose is image recognition/mask generation, but the documented behavior includes credential handling and token generation without clearly declaring those sensitive operations. This mismatch can mislead reviewers and users about the real security posture of the skill, potentially causing secrets to be handled or exposed in contexts where only image processing was expected.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The referenced guide instructs behavior for a wide range of video, image, and audio generation APIs, while the skill metadata says the skill is for image recognition and mask generation. This scope mismatch can cause an agent to perform unintended capabilities, increasing the chance of prompt injection, policy bypass, or unauthorized use of broader multimodal actions outside the declared trust boundary.

Credential Access

High
Category
Privilege Escalation
Content
def generate_access_token(app_key: str, app_secret: str) -> str:
    """
    Generate access token for Tomoviee API authentication.
    
    Args:
        app_key: Application key from Tomoviee console
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
app_secret = sys.argv[2]
    
    token = generate_access_token(app_key, app_secret)
    print(f"Access Token: {token}")
    print(f"\nUse in Authorization header as: Basic {token}")
Confidence
89% confidence
Finding
Although the PE3 label is broad, this specific line outputs the generated access token to stdout, which is a real secret-exposure issue rather than mere credential-related text. Because this skill is for image-recognition API use, leaked API credentials could allow abuse of the external service, quota exhaustion, or unauthorized access under the user's account.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill documentation describes use of an external API and bundled scripts that generate auth tokens and make remote requests, but it does not declare any explicit tool scope or allowed network capability. This creates a governance gap: an agent may invoke networked behavior without clear permission boundaries, increasing the risk of unintended data egress or unreviewed external communication.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger description says to use the skill for 'image_recognition operations or related tasks,' which is broad enough to match many generic image requests. Overly broad activation criteria can cause the skill to run in situations where users did not intend external API usage, increasing accidental transmission of image data or invocation of credential-dependent workflows.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The documentation instructs users to provide publicly accessible image URLs and optional callback URLs but does not warn that submitted images may contain sensitive personal or proprietary content, nor that callback endpoints can expose task metadata or results. In an image-processing skill, this omission can lead to unintended disclosure of private images, leaking of generated outputs, or unsafe webhook use if operators expose internal or untrusted endpoints.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The examples normalize workflows for removing people, segmenting persons, and editing identifiable image regions without any warning about consent, legality, or safe handling of personal images. In this skill's context, that increases the risk of misuse against real people and can facilitate privacy-invasive editing or processing of biometric/identifying content without adequate user notice.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script prints a credential-bearing Basic auth token directly to stdout, which can expose secrets through terminal scrollback, shell logging, CI job logs, screen recording, or copied command output. In this skill context, the token is derived from the app key and secret and is effectively reusable authentication material, so disclosure can enable unauthorized API access.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The code handles application credentials and constructs an authorization token for outbound API access, but there is no disclosure that the skill depends on sensitive third-party credentials or that misuse could expose access to a remote service. While the code does not hardcode secrets, silent credential handling in a skill increases operational risk because users or deployers may not understand the trust boundary, secret-management requirements, or consequences of leakage.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This client sends image-processing requests and task polling data to a third-party external API, but the code provides no user-facing disclosure, consent check, or indication that potentially sensitive user images or metadata leave the local environment. In an image recognition skill, that matters because users may assume processing is local, and undisclosed transfer of images to an external service can create privacy, compliance, and data-governance risks.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The title presents the skill name in Chinese and English, which signals a language preference or localization choice, but the document does not explain whether the skill requires or defaults to a particular language. For organization-wide language policy, skills should either offer a language choice or clearly justify any locale-specific constraint.

Static analysis

No suspicious patterns detected.