Back to skill

Security audit

bailian-tts

Security checks for vulnerabilities and agentic risk

Overview

This TTS skill is coherent, but it can automatically install an unpinned global npm package, which users should review before running.

Review the npm dependency before running the smoke test. Prefer installing a pinned, reviewed version locally or in an isolated environment, and only provide BAILIAN_API_KEY and text you are comfortable sending to Aliyun Bailian for speech synthesis.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/quick-test.sh:19
Finding
Automatic Installation and Execution of an Unpinned Global npm Package<![CDATA[ ## Vulnerability Details **File Location**: `scripts/quick-test.sh:19-23`; also documented in `SKILL.md:14-24` **Vulnerability Type**: Unpinned third-party dependency with automatic global installation **Risk Level**: Medium ### Vulnerable Code From `scripts/quick-test.sh:19-23`: ```bash if ! npm ls -g --depth=0 @hackerpl/bailian-cli >/dev/null 2>&1; then npm i -g @hackerpl/bailian-cli fi ``` From `SKILL.md:14-24`: ```bash npm ls -g --depth=0 @hackerpl/bailian-cli ``` ```bash npm i -g @hackerpl/bailian-cli ``` ### Technical Analysis The smoke-test script automatically installs `@hackerpl/bailian-cli` from the npm registry when the package is not already available. No exact version, package integrity hash, lockfile, provenance requirement, or reviewed artifact is specified. As a result, the code installed and subsequently executed can change without any modification to this project. npm installation may execute package lifecycle scripts, and the installed `bailian` command later runs with the invoking user's permissions and environment. Global installation also places the package outside an isolated project dependency tree, increasing its reach and making reproducible review more difficult. The project does not contain evidence that the named package is currently malicious. The risk arises from trusting an unpinned external package and automatically installing it before execution. ### Attack Path 1. An attacker compromises the npm publisher account, package distribution process, or a future package release. 2. The attacker publishes a modified version of `@hackerpl/bailian-cli` containing a malicious lifecycle script or CLI payload. 3. A user runs `scripts/quick-test.sh` on a system where the package is not globally installed. 4. The script executes `npm i -g @hackerpl/bailian-cli` and retrieves the current uncontrolled package version. 5. Malicious lifecycle code may execute during installation, or malicious code executes when the script ...[truncated 893 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the dependency to an exact reviewed version rather than installing the latest available release: ```bash npm install --save-exact @hackerpl/bailian-cli@REVIEWED_VERSION ``` 2. Manage the CLI as a local project dependency with a committed lockfile instead of installing it globally. 3. Use `npm ci` against the committed lockfile to obtain reproducible dependency resolution and integrity verification. 4. Remove automatic installation from the smoke-test script. If the dependency is missing, terminate with clear installation instructions and require explicit user approval before downloading executable code. 5. Review the selected package version, its transitive dependencies, lifecycle scripts, publisher provenance, and registry metadata before adoption. 6. Where supported, verify npm package provenance and use an allowlisted registry. Consider disabling lifecycle scripts during installation unless the reviewed package requires them: ```bash npm ci --ignore-scripts ``` 7. Execute the CLI from an isolated, least-privileged environment with access only to the required API key, input text, network destination, and output directory. 8. Avoid running the installation or TTS script as root or another privileged account. Rotate `BAILIAN_API_KEY` immediately if dependency compromise is suspected. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Session Persistence

Medium
Category
Rogue Agent
Content
[ -n "$BAILIAN_API_KEY" ] && echo SET || echo MISSING
```

If missing, ask user to create and configure key from the 阿里云百炼官方入口(控制台/平台):

- https://bailian.console.aliyun.com/
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
[ -n "$BAILIAN_API_KEY" ] && echo SET || echo MISSING
```

If missing, ask user to create and configure key from the 阿里云百炼官方入口(控制台/平台):

- https://bailian.console.aliyun.com/
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The script sets `LANG` to `Chinese` by default, which encodes a specific language/locale choice in the skill behavior. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the constraint is clearly justified or the user is explicitly offered a choice.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script automatically installs a global npm package when it is missing, without user confirmation, version pinning, or integrity verification. This creates a supply-chain risk: a compromised or typosquatted package, or an unexpected newer version, would be executed with the user's privileges and persist globally on the system.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
This markdown file is generally in English, but the available voices are annotated with Chinese gender markers '女' and '男'. That imposes a language-specific convention in the user-facing documentation without opt-in or explanation, which can conflict with language/locale policy expectations.

Static analysis

No suspicious patterns detected.