T09 · Insecure Skill Coding Practices
- Location
scripts/tensorslab_image.py:169- Finding
API-Controlled Task Identifier Allows Output Path Traversal
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This image-generation skill mostly matches its stated purpose, but it needs review because it uploads user images to TensorsLab, gives unsafe watermark and face-replacement workflows, and has downloader validation flaws.
Install only if you are comfortable sending prompts and any source images to TensorsLab. Avoid using it on confidential or personal images unless you have approval, and do not use the watermark-removal or face-replacement workflows except for clearly authorized, consensual cases. The bundled downloader should be hardened before routine use in sensitive environments by validating task IDs, restricting download hosts, disabling unsafe redirects, and limiting download size.
scripts/tensorslab_image.py:169API-Controlled Task Identifier Allows Output Path Traversal
scripts/tensorslab_image.py:75Unvalidated API-Controlled Download URLs Enable Server-Side Request Forgery from the Client Host
scripts/tensorslab_image.py:75Unbounded and Unverified Image Downloads Permit Memory and Disk Exhaustion
The skill description overstates implemented functionality, including sensitive editing use cases like watermark removal and face replacement, while the actual behavior apparently does not fully implement them and only partially supports prompt enhancement. This mismatch is dangerous because users and orchestrators may trust the skill to perform controlled, documented actions when actual behavior is incomplete or different, undermining informed consent, policy enforcement, and safe routing decisions.
This scenario incrementally guides the agent through creating an undetectable face swap under the guise of normal image editing, including blending, lighting, and realism instructions that directly optimize deception. In context, this is a substantive safety vulnerability because the workflow lowers the barrier to producing convincing manipulated identity content.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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(
The skill documents capabilities that require environment-variable access, shell execution, and outbound network use, but it does not declare any tool scope or permissions. This creates an authorization and transparency gap: a host agent may expose broader capabilities than users expect, increasing the chance of unintended command execution, secret access, or data transfer during image-processing workflows.
The file includes mandated Chinese-language setup and completion/error messages, and example user requests are also presented in Chinese, but there is no indication that the skill is region-specific or that users may choose another language. This creates a locale policy issue because the skill appears to impose a specific language without opt-in.
The skill instructs users to provide local image files and prompts for processing by TensorsLab, but it does not warn that this content may be uploaded to an external third-party API. This is a real privacy and data-handling issue because users may unknowingly send sensitive images, metadata, or confidential prompts off-device, which is especially risky in an image-editing context involving personal photos.
This markdown file describes a Delete Task endpoint that removes tasks, but it provides no warning about the destructive nature of the operation or its impact on user data. Under the markdown-specific missing-warning criteria, destructive behavior that could affect user data or system integrity should be disclosed to users.
The watermark-removal scenario explicitly instructs the agent to remove ownership indicators and preserve seamless realism, which facilitates copyright evasion, provenance stripping, and deceptive reuse of images. In this skill context, the danger is elevated because the document provides operational prompts and commands, not merely abstract discussion, and it lacks any policy guardrails or lawful-use limitations.
The watermark-removal section provides a procedural workflow and optimized prompt for stripping ownership/provenance markers while preserving realism, which can help users conceal attribution and redistribute content deceptively. The risk is heightened by the concrete command example and absence of guardrails limiting use to authorized restoration scenarios.
The face-replacement scenario provides detailed instructions for identity manipulation while emphasizing natural, undetectable results, which can enable impersonation, harassment, fraud, and non-consensual deepfake creation. The skill context makes this more dangerous because it operationalizes multi-image face swapping with target selection guidance and no consent, privacy, or anti-deception safeguards.
The manifest claims support for advanced editing such as avatar generation, watermark removal, object erasure, face replacement, and general image editing. In this file, the documented and implemented functionality is limited to text-to-image and image-to-image submission, task polling, and downloading results, with no code paths for those specialized editing operations.
The script uploads local image files or a provided image URL to a third-party remote API, but it gives no explicit user-facing warning at the point of use about external transmission. In a skill context, this can cause inadvertent disclosure of sensitive local images, especially if users assume processing is local or do not realize source content leaves their environment.
The documented user message is written only in Chinese, which imposes a specific language on users without offering a language choice or explaining a region-specific requirement. This is a natural-language policy issue because the file presents a fixed locale-specific message without opt-in.
The file uses Chinese trigger examples and Chinese keyword/style extraction guidance as part of the invocation logic, but it does not state that language selection is optional or that the skill is intentionally limited to Chinese users. This can be a natural-language policy issue when a skill appears to force or assume a specific language without opt-in.
The script creates an output directory and later saves downloaded images to disk. Although output paths are configurable and implied by the tool's behavior, there is no prominent warning or disclosure in the main description that files will be created locally, which this rule treats as a missing warning for file writes.
The manifest presents automatic prompt enhancement as a feature of the skill, but this script only sets prompt_extend when model == "zimage". For the default seedreamv4 and seedreamv45 paths, no prompt-enhancement behavior is implemented, so the advertised capability is not generally reflected in code.