Back to skill

Security audit

Qwen Logo Designer

Security checks for vulnerabilities and agentic risk

Overview

This logo-generation skill is purpose-aligned overall, but it exposes an API key through process arguments and changes output directory permissions in a way users may not expect.

Review before installing. Use a tightly scoped DashScope API key with quota limits, prefer setting it through a protected environment or secret mechanism, and only save into a dedicated non-sensitive output directory because the helper may make that directory readable/traversable by other local users. There is no evidence of hidden persistence or intentional exfiltration beyond the documented API call.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_logo.py:71
Finding

DashScope API Key Exposed Through Process Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_logo.py, lines 71–77
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: Medium

Vulnerable Code

python
result = subprocess.run([
    "curl", "-s", "--max-time", "120",
    API_URL,
    "-H", "Content-Type: application/json",
    "-H", f"Authorization: Bearer {api_key}",
    "-d", json.dumps(payload, ensure_ascii=False)
], capture_output=True, text=True, timeout=150)

Technical Analysis

The DashScope API key is interpolated directly into a command-line argument passed to curl. Although subprocess.run() uses an argument array rather than a shell and therefore does not introduce shell command injection here, the bearer credential remains visible in the spawned process's argument list while the request is running.

Depending on the operating system and process-isolation configuration, command-line arguments may be observable through process-monitoring utilities or process metadata such as /proc. A local process with sufficient visibility—including another process running under the same account—could capture the authorization header and recover the API key.

Passing the key through the --api-key CLI option can also expose it in the Python process's own command line before it is forwarded to curl.

Attack Path

  1. A victim invokes the Skill with a valid DashScope API key.
  2. The script launches curl and embeds the key in an Authorization: Bearer ... command-line argument.
  3. While the request is active, a local attacker or compromised process with permission to inspect the victim's process metadata monitors process argument lists.
  4. The attacker extracts the bearer token from the curl arguments.
  5. The attacker uses the recovered key to make unauthorized requests to the DashScope API until the credential is revoked or expires.

This attack requires local process visibility an ...[truncated 585 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace the external curl invocation with an in-process HTTPS client that supplies the authorization header through the client API rather than process arguments.
  • Avoid accepting secrets through command-line options where possible. Prefer a protected environment variable, standard input, or a dedicated secret-management service.
  • If curl must be retained, provide sensitive configuration through a protected temporary configuration stream or file instead of command-line arguments.
  • Create any temporary credential-bearing file with owner-only permissions, such as 0600, and remove it reliably in a finally block.
  • Ensure error messages and diagnostic logs never include the authorization header or API key.
  • Revoke and rotate API keys that may previously have been exposed through process monitoring.
  • Apply least privilege, usage quotas, and billing alerts to DashScope API credentials.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_logo.py:217
Finding

Output Saving Unconditionally Widens Destination Directory Permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_logo.py, lines 217–218
Vulnerability Type: Unsafe modification of existing directory permissions
Risk Level: Medium

Vulnerable Code

python
# Ensure directory is accessible (755: rwxr-xr-x)
os.chmod(dir_path, 0o755)

Technical Analysis

After saving an image, the script unconditionally changes the destination directory mode to 0755. The destination may come from a caller-controlled --output path or from the LOGO_OUTPUT_DIR or WORKSPACE environment variables.

Mode 0755 grants all local users read and traversal permissions on the directory. If the selected directory already had a restrictive mode such as 0700 or 0750, this operation weakens its existing access policy. Image generation does not require changing the permissions of a pre-existing destination directory.

The permission change applies to dir_path, which is derived from the final output path. Consequently, the side effect is not limited to directories created by this script. The process can alter any selected directory for which the current account has sufficient permission to call chmod.

Attack Path

  1. A user runs the Skill under an account that owns or can change the mode of a private directory.
  2. The output destination is set inside that directory through --output, LOGO_OUTPUT_DIR, or WORKSPACE.
  3. Logo generation and file saving complete successfully.
  4. The script executes os.chmod(dir_path, 0o755), replacing the directory's restrictive mode.
  5. Other local users can traverse and list the directory, subject to the permissions of its parent directories.
  6. Those users may discover filenames or read files whose individual permissions permit access.

Exploitation requires influence over the output path or an otherwise unsafe destination configuration, successful image generation, and a local user able to benefit from the widened permissions. ...[truncated 648 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the unconditional os.chmod(dir_path, 0o755) operation.
  • Preserve permissions on all pre-existing directories.
  • Track whether the script created a directory and only assign permissions when creating a new one.
  • Create new output directories with a restrictive mode such as 0700 by default, or 0750 when controlled group access is explicitly required.
  • Respect the process umask and require explicit user configuration before enabling web-server-readable output.
  • If integration with nginx is required, grant access through a dedicated group or a narrowly scoped administrator-managed directory rather than making arbitrary output directories world-readable and traversable.
  • Validate and normalize caller-supplied output paths, and document that generated files should be stored in a dedicated output directory rather than a directory containing unrelated sensitive files.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/generate_logo.py (reported line 76)May include surrounding context.

python
}

    try:
        # Use curl for reliable connection handling
        result = subprocess.run([
            "curl", "-s", "--max-time", "120",
            API_URL,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents shell execution, environment variable use, and local file writing, but it does not declare any explicit tool scope or permissions boundaries. That creates an authorization gap: an agent may invoke capabilities broader than users expect, including writing files to disk or using sensitive environment-provided credentials, which increases the chance of unintended side effects or abuse.

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 · scripts/generate_logo.py (reported line 77)May include surrounding context.

python
try:
        # Use curl for reliable connection handling
        result = subprocess.run([
            "curl", "-s", "--max-time", "120",
            API_URL,
            "-H", "Content-Type: application/json",

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
88% confidence
Finding

The code downloads a URL returned by the remote model API and fetches it server-side with curl, without validating the destination host, scheme, or resolved IP. If the upstream service is compromised or returns attacker-controlled URLs, this can enable SSRF-like behavior to access internal services or local network resources from the agent environment.

Content

Scanner excerpt · scripts/generate_logo.py (reported line 171)May include surrounding context.

python
try:
        # Download using curl
        result = subprocess.run([
            "curl", "-s", "--max-time", "60",
            "-o", tmp_path,
            url

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises automatic local saving and default output-directory behavior, but it does not clearly warn the user at the action point that files will be written to disk and where. In an agent setting, silent or implicit file creation can surprise users, clutter shared workspaces, or place generated content in sensitive or synced directories.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes generating and saving logo images, but this helper also explicitly adjusts file and directory permissions "for nginx access." Making outputs world-readable/executable for a web-serving context is an additional deployment capability not justified by the skill's stated purpose of image generation and deduplicated saving.

Content

No source excerpt is available for this finding.