Back to skill

Security audit

LiblibAI

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a LiblibAI image-generation client, but it can send credentials and user content to an unvalidated custom API endpoint.

Review this skill before installing. Use only the official LiblibAI endpoint unless you fully trust and control the alternative endpoint, avoid uploading sensitive images or confidential prompts, and consider rotating LiblibAI keys if they were ever used with an unknown mirror.

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
lib/client.js:5
Finding
Unvalidated Custom API Endpoint May Expose Credentials and User Content<![CDATA[ ## Vulnerability Details **File Location**: `lib/client.js:5-15` **Vulnerability Type**: Arbitrary credential-bearing API endpoint configuration **Risk Level**: Medium ### Vulnerable Code ```js this.accessKey = options.accessKey || process.env.LIBLIBAI_ACCESS_KEY; this.secretKey = options.secretKey || process.env.LIBLIBAI_SECRET_KEY; this.baseURL = options.baseURL || process.env.LIBLIBAI_BASE_URL || 'https://openapi.liblibai.cloud'; if (!this.accessKey || !this.secretKey) { throw new Error('LiblibAI credentials not found. Set LIBLIBAI_ACCESS_KEY and LIBLIBAI_SECRET_KEY environment variables or pass them as options.'); } this.client = new LiblibAI({ apiKey: this.accessKey, apiSecret: this.secretKey, baseURL: this.baseURL, }); ``` The related documentation in `SKILL.md:27-31` exposes `LIBLIBAI_BASE_URL` as a configurable endpoint: ```yaml - name: LIBLIBAI_BASE_URL description: API endpoint URL (default: https://openapi.liblibai.cloud) default: https://openapi.liblibai.cloud optional: true ``` The documentation also recommends switching to an unspecified mirror in `SKILL.md:211-213`: ```markdown ### Network timeout Users in China may need a proxy to access the international API. **Solution**: Set `LIBLIBAI_BASE_URL` to a domestic mirror, if available, or use a stable network. ``` ### Technical Analysis The client reads an arbitrary base URL from constructor options or the `LIBLIBAI_BASE_URL` environment variable without validating its scheme or hostname. It then initializes the third-party SDK with that endpoint and the user's LiblibAI access key and secret key. Authentication against the official LiblibAI API is necessary for the declared image-generation functionality. However, allowing credentials to be associated with any caller-selected endpoint exceeds the minimum privilege required. The vague recommendation to use an unspecified mirror increases the likelihood that users will direct authenticated requests to an untrusted ...[truncated 2069 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Use the official endpoint by default and enforce an allowlist.** Accept only explicitly trusted HTTPS hostnames, such as `openapi.liblibai.cloud`. 2. **Validate URLs before client initialization.** Reject malformed URLs, embedded credentials, non-HTTPS schemes, unexpected ports, IP literals, localhost, private-network destinations, and unapproved hostnames. ```js const OFFICIAL_HOSTS = new Set(['openapi.liblibai.cloud']); const parsedBaseURL = new URL(this.baseURL); if ( parsedBaseURL.protocol !== 'https:' || !OFFICIAL_HOSTS.has(parsedBaseURL.hostname) || parsedBaseURL.username || parsedBaseURL.password ) { throw new Error('Untrusted LiblibAI API endpoint'); } ``` 3. **Do not attach production credentials to arbitrary endpoints.** If custom enterprise endpoints are required, maintain a separate administrator-controlled allowlist and require explicit approval before credentials are used. 4. **Remove the unspecified mirror recommendation.** Documentation should identify only officially operated and verified endpoints. It should warn that custom endpoints can receive authentication data, prompts, and uploaded files. 5. **Require explicit confirmation for endpoint overrides.** For interactive use, display the destination hostname and require confirmation. In automated environments, require a separate opt-in setting controlled by an administrator. 6. **Avoid insecure transport and redirects.** Enforce TLS certificate validation and ensure the SDK does not forward authentication information across redirects to a different origin. 7. **Rotate potentially exposed credentials.** Users who previously configured unknown mirrors should revoke and recreate their LiblibAI access and secret keys, then review account usage for unauthorized activity. 8. **Add security tests.** Verify rejection of HTTP URLs, look-alike domains, embedded credentials, localhost, private IP ranges, unexpected ports, and redirects to untrusted ...[truncated 15 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README advertises file upload and remote image-generation features but does not clearly warn that user prompts and uploaded local files are sent to an external third-party service. In a skill context, users may assume operations are local or confined to OpenClaw, which creates a real privacy and data-handling risk if sensitive images, prompts, or metadata are transmitted off-host.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explicitly supports uploading local images and submitting prompts to the LiblibAI cloud service, but the documentation does not clearly warn that local file contents, prompt text, and potentially generated outputs are transmitted to a third-party API. This creates a real privacy and data-handling risk because users may unknowingly send sensitive local images, proprietary prompts, or confidential project material off-device.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This code presents user-facing comments, help text, status messages, and errors entirely in Chinese, with no option to select another language or indication that the tool is intentionally limited to a Chinese-speaking region or audience. That creates a natural-language locale policy concern because the skill effectively forces a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The skill documentation is presented entirely in Chinese, including usage instructions and parameter explanations, with no indication that other languages are supported or that Chinese is required for a region-specific reason. This can violate language/locale policy when users are not given a choice or informed of the constraint.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"license": "MIT",
  "type": "commonjs",
  "dependencies": {
    "commander": "^14.0.3",
    "liblibai": "^0.0.11"
  }
}
Confidence
89% confidence
Finding
The dependency uses a caret range, which allows newer compatible versions to be installed over time instead of an exact reviewed version. This creates supply-chain risk because future upstream releases could introduce malicious code or breaking behavior without any change to this repository.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"type": "commonjs",
  "dependencies": {
    "commander": "^14.0.3",
    "liblibai": "^0.0.11"
  }
}
Confidence
92% confidence
Finding
The liblibai dependency is also specified with a caret range, so installs may resolve to different future versions than the one originally tested. For a skill that interfaces with an external image-generation library, this increases supply-chain exposure because compromised or unsafe upstream updates could be pulled in automatically.

Static analysis

No suspicious patterns detected.