Back to skill

Security audit

PSD Batch Export

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real PSD batch tool, but it needs review because optional AI/network helpers can expose API keys or prompt data and legacy paths can write outside chosen output folders.

Install only if you are comfortable with local PSD/image processing, file creation under output folders, optional external font downloads, and optional AI provider calls. Avoid using the LLM features with sensitive design content or valuable API keys until provider selection, custom endpoint validation, and explicit consent are fixed; use fresh output directories and trusted spreadsheets/JSON configs.

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/design_llm.py:39
Finding

Provider-Confused API Credential Disclosure to Arbitrary Endpoints

Content
View full analysis
Optional[str]: if not self._available: return None try: if self.provider == "openai" or self.base_url: from openai import OpenAI client_kwargs = {"api_key": self.api_key} if self.base_url: client_kwargs["base_url"] = self.base_url client = OpenAI(**client_kwargs) ``` ### Technical Analysis The implementation does not bind credentials to their intended providers. It selects the first available value from `OPENAI_API_KEY` and `ANTHROPIC_API_KEY`, regardless of the configured provider. Because the default provider is `openai`, an Anthropic credential can consequently be passed to the OpenAI client. The condition `self.provider == "openai" or self.base_url` also forces the OpenAI-compatible client path whenever any custom base URL is present. `DESIGN_LLM_BASE_URL` is accepted without HTTPS enforcement, hostname validation, or an allowlist. The selected API key is then provided to that endpoint as an authentication credential. This behavior can expose either provider's API key to an unintended or attacker-controlled server. A plaintext HTTP base URL would additionally ex ...[truncated 1614 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/psd_style_editor.py:158
Finding

JSON-Controlled Path Traversal in Batch Style Output

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/psd_text_editor.py:245
Finding

Spreadsheet-Controlled Path Traversal in Legacy PSD Batch Editor

Content
View full analysis
= len(row): break val = row.iloc[col_idx] if pd.isna(val): skip = True; break text_map[original] = str(val) if skip or not text_map: continue out = output_dir / f"版本_{version}.psd" r = patch_psd_text(input_psd, out, text_map) ``` ### Technical Analysis The first value in every spreadsheet row is used as part of an output pathname. It is not restricted to a filename-safe identifier. A value containing separators and parent-directory components can therefore create a path that escapes `output_dir`. Although the fixed `版本_` prefix prevents a simple leading `../` from immediately becoming a parent component, it does not prevent traversal after an inserted path component. For example, a version value resembling `x/../../target` produces a path equivalent to: ```text output_dir/版本_x/../../target.psd ``` `patch_psd_text()` creates the output path's parent directories and writes the file, so crafted spreadsheet content can direct the generated PSD outside the intended directory. ### Attack Path 1. An attacker prepares an Excel file accepted by the legacy batch editor. 2. The first cell of a processable row is set to a value such as `x/../../target`. 3. The remaining cells contain valid replacement text so the row is not skipped. 4. The victim invokes `batch_edit_psd_by_excel()` through the legacy PSD text editor workflow. 5. The generated pathname includes attacker-controlled directory components. 6. Parent-direct ...[truncated 934 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
fonts/download_fonts.py:34
Finding

Mutable Font Download Without Integrity Verification

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (51)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description centers on a comprehensive PSD automation and batch design workflow. The supplied code chunk does not implement any PSD handling or batch graphics workflow. Instead, it is a font downloader/installer helper for a fonts directory, using network access to fetch font files or printing manual download instructions. While font dependency support could be tangentially related to a larger PSD toolchain, this code chunk’s actual primary purpose is materially different and far narrower than the declared skill purpose. Therefore, this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description centers on PSD automation and batch template production workflows. The supplied code does not interact with PSD files, Photoshop layers, spreadsheets, templates, OCR, or export pipelines. Its actual purpose is color analysis and palette recommendation using PIL image loading and CLI arguments. While some recommendation categories overlap superficially with design contexts like tickets or certificates, that is not sufficient to match the claimed PSD batch workflow. This is a clear material mismatch in primary purpose and capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied code chunk does not implement any PSD-related workflow or image/template automation. Its sole behavior is to adjust console output encoding for CLI streams, which is a generic support utility unrelated to the declared primary purpose. This is a materially different purpose rather than a minor supporting detail, because the chunk contains none of the core advertised PSD-processing capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description centers on PSD batch automation: analyzing PSD text layers, replacing layer text from Excel/CSV, preview/export workflows, validation, dependency checks, and template-driven PSD/PNG generation. This code chunk does not implement those behaviors. Instead, its primary purpose is an LLM integration layer for design assistance: it connects to external model providers using API keys, sends prompts, parses JSON, and exposes functions for palette generation, layout suggestion, copywriting, and design evaluation. Those are materially different capabilities from PSD batch processing and represent undeclared external network/API access. While such AI design assistance could be a supporting component in a larger PSD system, this specific chunk's behavior is not accurately represented by the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code is clearly related to PSD automation, but the declared description substantially overstates and mischaracterizes its capabilities. The script opens a PSD, inspects text-layer style metadata, applies per-layer text/style overrides during rendering, and saves PNG outputs. Batch mode is driven by a JSON file, not Excel/CSV. The docstring explicitly says it does not alter the PSD binary, which conflicts with the declared editable PSD export capability. There is no implementation of template libraries, OCR checks, result validation, or a richer production workflow beyond style inspection and PNG rendering. This is therefore a meaningful description-behavior mismatch rather than a minor omission.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared description presents a broad production workflow covering PSD analysis, Excel/CSV mapping, previewing, validation, PNG export, dependency checks, and built-in templates for several asset classes. The supplied code chunk is much narrower: it finds and patches "Txt TEXT" entries inside PSD binaries, supports replacement by layer-name mapping via psd-tools, and batch-generates edited PSD files from Excel rows. This partially aligns with PSD text replacement and Excel-driven PSD generation, but several prominently declared capabilities are absent from the code: there is no PNG export, no preview, no validation stage, no font/OCR checks, no CSV handling in this snippet, and no built-in templates. Additionally, the code’s notable direct binary-patching behavior is undeclared. Because the actual implementation is a narrower and materially different subset of the declared production workflow, this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description describes a much broader production workflow centered on PSD automation with spreadsheet-driven text replacement, editable PSD export, validation, dependency checks, and packaged templates. The supplied code does not implement those core behaviors. Instead, it only reads PSD files, extracts existing text-layer styles, tries to match fonts from local/system font directories, composites non-text layers into a cached background, redraws the PSD text onto that background, and saves PNG outputs. While PSD analysis and batch PNG export are partially aligned with the description, the primary workflow and several major claimed capabilities are absent. Additionally, the code scans local font directories, which is a resource access behavior not mentioned in the declared permissions/description, though it is related to rendering support.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description centers on a full PSD automation pipeline: analyzing PSD text layers, mapping spreadsheet data to editable layers, previewing and exporting PSD/PNG batches, validating results, and checking font/OCR dependencies. The supplied code does none of that. It implements a command-line typography/layout utility that estimates font sizes and coordinates for text on a canvas, with a few hardcoded presets such as ticket, certificate, badge, and invitation. It does not read, inspect, modify, or export PSD files; does not load CSV/Excel data; does not perform batch generation; and does not interact with OCR, fonts, or Photoshop resources in the manner described. While some preset names overlap with the declared template categories, this is superficial and does not make the behavior consistent with the declared PSD batch workflow.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad, production-oriented PSD automation workflow with batch processing, spreadsheet-driven mapping, exports, validation, dependency checks, and template support. The supplied code does not implement those capabilities. It is a unit test module focused narrowly on verifying behavior of a text replacement helper (patch_psd_text) against synthetic byte patterns. While this low-level text replacement behavior is loosely related to PSD text editing, the actual code chunk is far narrower than the declared purpose and does not demonstrate the claimed workflow features. Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 9)May include surrounding context.

md
batch generation. Resolve all paths relative to the directory containing this `SKILL.md`; do not rely on machine-specific absolute paths.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'network' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The script reads and modifies process environment state via os.environ when --tessdata-dir is supplied, which introduces undeclared environment access capability. In an agent/skill setting, undeclared env access is security-relevant because environment variables can influence subprocess/library behavior, leak sensitive runtime configuration, or create hidden side effects outside the expected PSD/Excel processing scope.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_cli.py (reported line 21)May include surrounding context.

python
def run_cli(*args: str, check: bool = True) -> subprocess.CompletedProcess[str]:
    env = os.environ.copy()
    env["PYTHONUTF8"] = "1"
    result = subprocess.run(
        [sys.executable, str(CLI), *args],

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The activation text is very broad, including many generic terms and multiple platforms, which can cause the skill to be invoked in contexts beyond the user's actual intent. In an agent environment with Bash, Read, Write, and Edit permissions, unintended invocation increases the chance of unnecessary file access, command execution, or workflow confusion that could expose or modify data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes PSD analysis, Excel/CSV-driven text replacement, preview/export, validation, and dependency checking for a PSD automation workflow. This helper script performs direct HTTP downloads from external sites to fetch fonts, which is a separate acquisition capability rather than an obvious requirement of checking local font dependencies.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes PSD analysis, Excel/CSV-to-layer mapping, preview/export, validation, dependency checks, and built-in templates for batch graphics workflows. This module instead reads API credentials from environment variables and sends prompts to OpenAI/Anthropic-compatible services for palette generation, layout advice, copywriting, and design evaluation, which are broader AI-generation capabilities not stated in the manifest.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module sends user-supplied descriptions, design context, and possibly embedded business content to external LLM providers without any disclosure, consent flow, redaction, or classification checks at the call sites. In a PSD batch-export context, prompts may contain sensitive marketing assets, event data, names, or certificate content, so silent transmission to third parties creates a real confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring, usage examples, and command help text are written entirely in Chinese, which imposes a specific language on users without opt-in. The file does not indicate that the skill is intentionally region-specific or provide an alternative locale, matching 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
95% confidence
Finding

This Python file contains natural-language documentation entirely in Chinese, including the module description and usage context. Under the policy rule for language or locale constraints, this is a violation because the skill presents a fixed language without user choice or documented regional justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The argparse help text is user-facing natural language and is written only in Chinese. Because the file does not offer a language selection mechanism or document a region-specific constraint, it forces a specific locale in violation of the natural-language policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The top-level descriptive text is entirely in Chinese and presents the tool's purpose and features in a single fixed language. Under the policy, forcing a specific language without user opt-in or a documented regional justification is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The executable entrypoint accepts only a source PSD directory, output directory, and rendering-related options, then batch-generates PNG files. Nothing in this file reads spreadsheet data, writes editable PSDs, validates outputs, performs OCR/dependency checks, or manages the manifest-described built-in template workflows, so the code behavior is materially narrower than the stated skill description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains multiple Chinese docstrings, CLI descriptions, help text, and printed messages, indicating the skill is designed to communicate in a specific language by default. The policy requires flagging language or locale constraints when the skill does not provide user opt-in or a documented justification for being region-specific.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_cli.py (reported line 23)May include surrounding context.

python
def run_cli(*args: str, check: bool = True) -> subprocess.CompletedProcess[str]:
    env = os.environ.copy()
    env["PYTHONUTF8"] = "1"
    result = subprocess.run(
        [sys.executable, str(CLI), *args],
        cwd=ROOT,
        text=True,

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This is a markdown file, so SQP-2 applies to missing user warnings in the skill description. The README clearly documents file-writing behavior for preview, export, and verification outputs, but it does not include any caution about modifying the filesystem, creating directories, or potential overwrites in out/ paths.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.