T08 · Insecure Dependencies
- Location
references/astro.md:49- Finding
Unpinned Third-Party Dependency Installation and Execution
- Content
View full analysis
Vulnerability Details
File Locations:
references/astro.md:49-56references/pages-router.md:238-239references/react-helmet-async.md:15references/react-helmet-async.md:39-49
Vulnerability Type: Unpinned package installation and supply-chain exposure
Risk Level: MediumVulnerable Code Snippets
references/astro.md:49-56:bash npx astro add sitemapThe equivalent manual installation is:
bash npm install @astrojs/sitemapreferences/pages-router.md:238-239:bash npm install next-sitemapreferences/react-helmet-async.md:15:text Install the current compatible major: npm install react-helmet-asyncreferences/react-helmet-async.md:39-49:text | Lockfile | Command | | -------------------------- | -------------------------------- | | pnpm-lock.yaml | pnpm add react-helmet-async | | yarn.lock | yarn add react-helmet-async | | bun.lock / bun.lockb | bun add react-helmet-async | | package-lock.json / none | npm install react-helmet-async |bash npm uninstall react-helmet && npm install react-helmet-asyncTechnical Analysis
These instructions direct an agent to resolve and install mutable package versions from a third-party package registry. No exact reviewed versions or integrity values are specified.
Package managers may execute lifecycle scripts during installation. Consequently, a compromised package release, maintainer account, registry response, or transitive dependency could cause arbitrary code to run with the permissions of the user invoking the agent.
The
npx astro add sitemapcommand presents additional exposure becausenpxmay retrieve and execute a package when an appropriate trusted local binary is unavailable. The effective code executed can therefore differ from the cod ...[truncated 1785 chars]- Remediation
View remediation
Remediation Suggestions
- Pin every recommended dependency to an explicitly reviewed version, for example
package@x.y.z, rather than resolving the current registry release. - Prefer versions already recorded in the project's lockfile and preserve the project's established package manager.
- Require explicit developer confirmation before adding, removing, or upgrading any dependency.
- Avoid
npxbehavior that downloads missing packages. Invoke a verified project-local binary or use a package-manager mode that refuses implicit remote installation. - Review package provenance, maintainers, release history, integrity metadata, and lifecycle scripts before installation.
- In automated environments, use frozen-lockfile or immutable-installation modes so unresolved dependency changes fail rather than silently updating the dependency graph.
- Run dependency installation in a restricted environment with minimal filesystem access, no unnecessary credentials, and no elevated privileges.
- Where supported and operationally appropriate, disable lifecycle scripts during initial dependency retrieval and review any required scripts before enabling them.
- Separate package removal and installation into reviewed steps rather than presenting a compound command that immediately modifies the dependency graph.
- Pin every recommended dependency to an explicitly reviewed version, for example
