T08 · Insecure Dependencies
- Location
SKILL.md:35- Finding
Automatic Execution of Mutable Third-Party npm Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:35, with repeated invocations atSKILL.md:127-130,SKILL.md:145-148,SKILL.md:165-249, and an unsafe upgrade instruction atSKILL.md:302
Vulnerability Type: Supply-chain exposure through unpinned or broadly pinned npm dependencies
Risk Level: MediumVulnerable Code
bash Automate web browsing using `npx -y @midscene/web@1`.Representative runtime commands include:
bash npx -y @midscene/web@1 connect --url https://example.com npx -y @midscene/web@1 act --prompt "click the Login button and fill in the email field with 'user@example.com'" npx -y @midscene/web@1 take_screenshot npx -y @midscene/web@1 closeThe troubleshooting section also recommends installing mutable latest releases:
bash npm i @midscene/web@latest @midscene/core@latest @midscene/shared@latestTechnical Analysis
The Skill repeatedly directs the Agent to execute
npx -y @midscene/web@1. The-yoption suppresses installation confirmation, and the major-version specifier@1does not identify an immutable, audited package release. npm can therefore retrieve and execute a newer matching package version than the one reviewed during this audit.The recommendation to install dependencies using
@latestis even less constrained because it resolves to whichever release the registry currently designates as latest. Neither instruction supplies a lockfile, exact version, package integrity hash, or other mechanism that binds execution to reviewed artifacts.npm packages can run code through package lifecycle hooks and their normal command entry points. If the publisher account, package distribution process, registry, or a future matching release is compromised, invoking the documented commands can execute attacker-controlled code with the privileges of the Agent process.
This finding identifies supply-chain exposure; the reviewed file does not itself establish that the named packages are currently ...[truncated 1311 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace
@1and@latestwith exact, reviewed package versions. - Maintain a committed lockfile and install dependencies using
npm cirather than resolving versions dynamically during Skill execution. - Verify package integrity through lockfile integrity metadata, trusted hashes, signatures, or an approved internal registry.
- Remove automatic
npx -yretrieval from normal runtime operation. Install audited dependencies during a controlled build or provisioning phase. - Disable npm lifecycle scripts where compatible, such as with
--ignore-scripts, and explicitly review any scripts that must remain enabled. - Pin
@midscene/web,@midscene/core, and@midscene/sharedto mutually compatible exact versions rather than recommending@latest. - Run browser automation in a restricted environment with least-privilege filesystem access, filtered network access, and only the secrets required for the current task.
- Separate authenticated CDP or Bridge sessions from dependency installation and update operations to reduce the impact of a supply-chain compromise.
- Establish a controlled dependency-update process that includes provenance verification, changelog review, vulnerability scanning, and security testing before changing pinned versions.
- Replace
