T08 · Insecure Dependencies
- Location
SKILL.md:29- Finding
Mutable Third-Party Package Is Automatically Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 29
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumVulnerable Code Snippet:
markdown Automate Android devices using `npx -y @midscene/android@1`. Each CLI command maps directly to an MCP tool — you (the AI agent) act as the brain, deciding which actions to take based on screenshots.The command pattern is subsequently used throughout the file, including:
bash npx -y @midscene/android@1 connectTechnical Analysis
The Skill directs the agent to use
npx -yto retrieve and immediately execute@midscene/android. The-yoption suppresses the interactive installation confirmation, while the version selector@1restricts only the major version rather than pinning one immutable, audited release.Consequently, the effective code executed by the Skill can change without any corresponding change to the reviewed
SKILL.mdfile. A newly published compatible release, or one of its transitive dependencies, may be selected during a later invocation. npm packages can also execute installation lifecycle scripts, so package code may run before the requested Android CLI operation begins.This is a supply-chain exposure rather than evidence that the named package is currently malicious. No lockfile, integrity hash, vendored dependency, or other mechanism for reproducing the reviewed dependency set is included in the project.
Attack Path
- An attacker compromises the package publisher account, package distribution process, or a transitive dependency used by a release matching
@midscene/android@1. - The attacker publishes a malicious version that still satisfies the mutable major-version selector.
- An agent follows the Skill and invokes a documented
npx -y @midscene/android@1 ...command. npxretrieves the selected package and dependencies without requesting installation confirmation.- Malicious pa ...[truncated 1138 chars]
- An attacker compromises the package publisher account, package distribution process, or a transitive dependency used by a release matching
- Remediation
View remediation
Remediation Suggestions
- Replace the mutable major-version selector with an exact, reviewed package version, for example
@midscene/android@1.x.y. - Manage the dependency through a project manifest and commit a lockfile containing resolved versions and registry integrity hashes.
- Install dependencies in a controlled setup phase rather than automatically downloading them during each Skill invocation.
- Configure npm to use the expected official registry and reject unapproved registries or package sources.
- Verify package provenance, signatures, checksums, and publisher identity before approving upgrades.
- Review transitive dependency changes whenever the pinned package version is updated.
- Disable npm lifecycle scripts where operationally feasible, or explicitly audit every required lifecycle script before enabling it.
- Execute the automation CLI inside a sandbox or container with minimal filesystem and network access.
- Provide model credentials through short-lived, least-privilege secrets and prevent unnecessary environment variables from reaching the package process.
- Restrict ADB access to a dedicated test device or emulator containing no sensitive data, and disconnect the device after the task.
- Replace the mutable major-version selector with an exact, reviewed package version, for example
