Back to skill

Security audit

Laozhangapi Image

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real image-generation API helper, but users should review it because its billing/output behavior and remote-download handling are not fully aligned with the documentation.

Install only if you are comfortable sending prompts, image URLs, and your API token to api.laozhang.ai. Use a restricted token file with tight permissions instead of --token on the command line, avoid sensitive/private images, use --no-save when you do not want local files written, and explicitly choose the model so billing matches your expectation.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.py:83
Finding

Unrestricted Retrieval of API-Controlled URLs in Image Generation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/edit_image.py:85
Finding

Unrestricted Retrieval of API-Controlled URLs in Image Editing

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_image.py:127
Finding

API Token Exposure Through Command-Line Arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:12
Finding

Plaintext Token File Permissions Are Not Enforced

Content
View full analysis
~/.laozhang_api_token ``` The generation script reads the file without checking its ownership or mode: ```python TOKEN_PATH = Path.home() / ".laozhang_api_token" def get_token(): if TOKEN_PATH.exists(): return TOKEN_PATH.read_text().strip() return None ``` The editing script uses the same behavior: ```python TOKEN_PATH = Path.home() / ".laozhang_api_token" ``` ```python def get_token(): if TOKEN_PATH.exists(): return TOKEN_PATH.read_text().strip() return None ``` ### Technical Analysis The API token is stored as plaintext in the user's home directory. The documented setup command relies entirely on the user's current umask to determine file permissions. Neither script verifies that the file belongs to the current user or rejects group-readable or world-readable permissions. On systems with a permissive umask, shared home directories, unsafe backup policies, or incorrectly inherited permissions, other local users or services may read the credential. ### Attack Path 1. The user creates `~/.laozhang_api_token` with the documented shell command. 2. A permissive umask or existing file mode leaves the file readable by a group or other users. 3. Another local account or process reads the plaintext token. 4. The attacker reuses the token for unauthorized API calls. ### Impact Assessment Successful exploitation exposes the API bearer token and enables actions within that token's API permissions, including possible quota consumption and charges. It does not directly provide operating-system privilege escalation. Exploitability depends on local file ...[truncated 63 chars]
Remediation
View remediation

other

Note
Location
scripts/generate_image.py:25
Finding

Implemented Default Model Conflicts With Documented Pricing and Output Behavior

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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This mismatch becomes security-relevant because the description omits material side effects: reading a local token file and saving/downloading images locally. When a skill understates resource access, users may expose local secrets or permit filesystem changes without informed consent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

This mismatch becomes security-relevant because the description omits material side effects: reading a local token file and saving/downloading images locally. When a skill understates resource access, users may expose local secrets or permit filesystem changes without informed consent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documentation instructs users to read a local token file, write image outputs to disk, and call an external API, but it does not declare any explicit tool scope or permissions. This creates a transparency and containment problem: an agent or user may invoke a skill with file and network side effects that were not clearly bounded in metadata.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Broad trigger phrases increase the chance the skill is invoked unintentionally during ordinary conversation about images or drawing. In this skill's context, accidental activation can cause external API requests, spend money, and transmit prompts or image URLs off-platform.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill does not clearly warn that prompts and image URLs/content will be sent to a third-party API and that results may be saved locally. This lack of data-handling disclosure can lead users to unknowingly transmit sensitive images, internal URLs, or confidential prompts to an external service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The skill transmits data to an external service, which is expected for an API-backed image tool, but it still introduces privacy, data-exposure, and billing risk. In this context the danger is elevated because prompts, image URLs, and possibly image content may leave the local environment, yet disclosure and consent language are weak.

Content

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

echo "sk-xxx" > ~/.laozhang_api_token

text

访问 [老张 API](https://api.laozhang.ai/register/?aff_code=lfa0) 注册获取 token。新注册自动获得 $0.5 测试额度。

### 2. 文生图

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The example explicitly shows supplying an API token on the command line (--token sk-xxx). Command-line arguments are commonly exposed through shell history, process listings, logging, CI job output, and telemetry, so this can leak credentials to other local users or systems that collect command invocations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script reads a bearer token from ~/.laozhang_api_token and later uses it for authenticated API access, but this credential access is not explained in the function via comments/docstrings. For code-file warnings, sensitive credential access should have some visible disclosure unless already clearly documented in the skill description, which is not present in this file beyond an error message when the token is missing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script transmits user-supplied image URLs and edit prompts to a third-party API, which may expose sensitive image contents or metadata to an external service without clear user-facing notice. In an agent-skill context, this matters because users may assume local-only processing unless explicitly told otherwise.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/edit_image.py (reported line 83)May include surrounding context.

python
}

    try:
        resp = requests.post(API_URL, headers=headers, json=payload, timeout=120)
        resp.raise_for_status()
        result = resp.json()

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language strings that present the skill exclusively in Chinese, including the top-level description and usage text. Under the policy, forcing a specific language without offering a user language choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/models.md (reported line 42)May include surrounding context.

md
print("需要安装 requests 库:pip install requests")
    sys.exit(1)

API_URL = "https://api.laozhang.ai/v1/chat/completions"

MODELS = {
    "sora_image": ("Sora Image", "$0.01/张", "url"),

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/edit_image.py (reported line 21)May include surrounding context.

python
print("需要安装 requests 库:pip install requests")
    sys.exit(1)

API_URL = "https://api.laozhang.ai/v1/chat/completions"

MODELS = {
    "sora_image": ("Sora Image", "$0.01/张", "url"),

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate_image.py (reported line 21)May include surrounding context.

python
print("需要安装 requests 库:pip install requests")
    sys.exit(1)

API_URL = "https://api.laozhang.ai/v1/chat/completions"

MODELS = {
    "sora_image": ("Sora Image", "$0.01/张", "url"),

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The script transmits user prompts and an API bearer token to a third-party service, which is an actual external data exposure point. In this skill context that behavior is expected for image generation, but it is still security-relevant because sensitive prompts may be sent off-host and the script also follows returned image URLs for download, expanding trust to remote content.

Content

Scanner excerpt · scripts/generate_image.py (reported line 73)May include surrounding context.

python
}

    try:
        resp = requests.post(API_URL, headers=headers, json=payload, timeout=120)
        resp.raise_for_status()
        result = resp.json()

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

整个技能说明及触发词均仅以中文呈现,没有说明这是面向特定中文场景的限定,也未提供用户语言选择。根据语言/地区策略,若技能隐含强制特定语言而无用户选择或合理依据,属于自然语言策略风险。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language content, examples, and comments are all presented in Chinese, which may impose a language constraint on users without explicitly offering alternatives. The file does not mention that the skill is Chinese-only or provide any opt-in or language selection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains all user-facing instructions and descriptions in Chinese only. Under the language/locale policy, forcing a single language without user opt-in or a documented regional justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest focuses on using the API to generate and edit images, but does not disclose that results are automatically persisted under ~/Pictures/laozhang. Saving files is a separate local-write capability that users may not expect from the high-level description alone.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest describes generating and editing images via the 老张 API, but does not mention local credential-file access. The code reads a token from ~/.laozhang_api_token, which is a local data-access capability beyond the user-facing image-editing function, even though it is a convenience mechanism rather than the core feature.

Content

No source excerpt is available for this finding.