T08 · Insecure Dependencies
- Location
SKILL.md:26- Finding
Mutable Third-Party npm Package Is Automatically Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:26,SKILL.md:84-164,SKILL.md:190-198, andSKILL.md:226
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumVulnerable Code
markdown Automate iOS devices using `npx -y @midscene/ios@1`.Representative commands used throughout the skill include:
bash npx -y @midscene/ios@1 connect npx -y @midscene/ios@1 runwdarequest --method GET --endpoint /wda/screen npx -y @midscene/ios@1 take_screenshot npx -y @midscene/ios@1 act --prompt "type hello world in the search field and press Enter" npx -y @midscene/ios@1 assert --prompt "there is a login button visible" npx -y @midscene/ios@1 disconnect npx -y @midscene/ios@1 report-tool --action to-markdown --htmlPath ./midscene_run/report/.../index.html --outputDir ./output-markdownThe troubleshooting guidance also recommends installing mutable latest releases:
bash npm i @midscene/ios@latest @midscene/core@latest @midscene/shared@latestTechnical Analysis
The skill repeatedly directs the agent to invoke
npxwith the-yoption. This option automatically accepts package installation, allowing code obtained from the npm registry to be executed without an interactive confirmation step.The dependency selector
@midscene/ios@1pins only the major version rather than an exact audited release. It can therefore resolve to different version 1.x releases over time. The recommendation to install packages using@latestis even less constrained and can resolve to any release currently associated with the mutable npm distribution tag.The audited project contains only
SKILL.md; it provides no lockfile, integrity hashes, vendored dependency code, package-signature validation, or other mechanism that binds execution to a previously reviewed artifact. Consequently, the effective code executed by these instructions can change after the skill itself has been reviewed.This is a supply-chain weakness rather than ev ...[truncated 2073 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace mutable dependency selectors with exact, reviewed versions:
bash npx -y @midscene/ios@1.2.3 connectThe actual version should be selected only after review; the example version above is illustrative.
-
Prefer installing dependencies in advance with a committed lockfile rather than downloading them at each invocation:
bash npm ci ./node_modules/.bin/midscene-ios connect -
Commit
package.jsonandpackage-lock.json, and require lockfile integrity verification in deployment and CI workflows. -
Remove the recommendation to install
@latest. Upgrades should use an exact proposed version and require dependency review, changelog inspection, and security testing before adoption. -
Where operationally compatible, install dependencies with lifecycle scripts disabled:
bash npm ci --ignore-scriptsIf lifecycle scripts are required, review them explicitly before permitting execution.
-
Run the automation package in a restricted environment with least-privilege filesystem access, minimal environment variables, constrained outbound network access, and no unrelated credentials.
-
Keep API credentials outside the project directory and expose only the credentials required for the current run. Rotate credentials if dependency compromise is suspected.
-
Add package provenance, registry allowlisting, checksum verification, and dependency vulnerability scanning to the package-approval process.
-
