T08 · Insecure Dependencies
- Location
scripts/setup.sh:14- Finding
Unpinned Global Package Installation and Dynamic Component Retrieval
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup.sh:14, 21-23
Vulnerability Type: Unpinned third-party dependency and dynamically retrieved components
Risk Level: MediumVulnerable Code
bash npm install -g agent-browserbash if [[ "$(uname)" == "Linux" ]]; then agent-browser install --with-deps 2>/dev/null || agent-browser install else agent-browser install fiTechnical Analysis
The setup script globally installs
agent-browserwithout specifying an exact version or validating package integrity. It then immediately executes the newly installed tool to retrieve Chromium and, on Linux, potentially install operating-system dependencies.Because neither the npm package version nor the retrieved browser components are pinned and verified, the effective installation behavior can change after this Skill has been reviewed. A compromised package release, maintainer account, transitive dependency, registry response, or browser download source could introduce arbitrary code into the installation process.
The global installation also modifies the host environment rather than isolating the dependency to the project. If setup is executed with elevated privileges, npm lifecycle scripts and dependency-installation operations may inherit those privileges.
Attack Path
- An attacker compromises the upstream
agent-browserpackage, one of its transitive dependencies, its maintainer account, or a component-download source. - The attacker publishes or serves a malicious version under the expected package or component identity.
- A user runs
scripts/setup.sh. npm install -g agent-browserresolves and installs the uncontrolled current release, including any applicable npm lifecycle scripts.- The script executes the newly installed
agent-browserbinary throughagent-browser install. - Malicious installation code executes with the permissions of the invoking user.
- If the setup process is run with adminis ...[truncated 725 chars]
- An attacker compromises the upstream
- Remediation
View remediation
Remediation Suggestions
-
Pin
agent-browserto an exact, reviewed version rather than resolving the latest release:bash npm install --global --ignore-scripts agent-browser@X.Y.ZConfirm first whether disabling lifecycle scripts is compatible with the package.
-
Prefer a project-local dependency managed by a committed lockfile instead of a global installation:
bash npm install --save-exact agent-browser@X.Y.Z -
Use deterministic installation mechanisms such as
npm ciwith a reviewed and committed lockfile. -
Verify package provenance and integrity through trusted registry configuration, lockfile integrity hashes, npm provenance where available, and organizational artifact signing or mirroring.
-
Pin the Chromium revision and verify its checksum or signature before installation. Document all expected package registries and component-download domains.
-
Avoid running the setup script as root. If operating-system packages are required, separate that step, explicitly list the packages, and require deliberate administrator approval.
-
Execute browser tooling in a sandboxed container or similarly restricted environment with minimal filesystem, credential, and network access.
-
Add an explicit version check so an already installed but unexpected
agent-browserversion is rejected rather than trusted solely because the command exists.
-
