T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:1176
- Finding
- Unpinned Third-Party Package Retrieval and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 1176–1181 **Vulnerability Type**: Unpinned third-party dependencies and transient package execution **Risk Level**: Medium ### Vulnerable Code ```bash npx create-react-app ai-money-website cd ai-money-website npm install @radix-ui/react-slot @radix-ui/react-separator lucide-react class-variance-authority clsx tailwind-merge framer-motion npm install -D tailwindcss @tailwindcss/vite tw-animate-css ``` Related development instructions at lines 1567–1571: ```bash npm install # Install dependencies npm run dev # Start development server npm run build # Build for production npm run preview # Preview production build ``` ### Technical Analysis The setup procedure directs users or agents to retrieve packages from the npm registry without pinning exact versions. In particular, `npx create-react-app` can download and execute a registry-provided package immediately. The subsequent `npm install` commands also resolve mutable package versions and their transitive dependency trees. Although `SKILL.md` includes semver dependency examples elsewhere, the audited project contains no package lockfile or integrity metadata that would make installation reproducible. npm dependencies may also run lifecycle scripts during installation. Consequently, compromise of a named package, a transitive dependency, a newly resolved release, or the package registry could cause attacker-controlled code to execute with the privileges of the account performing setup. This is a supply-chain exposure rather than evidence that any currently named package is malicious. ### Attack Path 1. An attacker compromises a package or transitive dependency referenced by the setup commands, or causes a malicious version to be served through the configured registry. 2. A user or agent follows the instructions and invokes `npx create-react-app` or `npm install`. 3. npm resolves and downloads the mutable package version and de ...[truncated 916 chars]
- Remediation
- ## Remediation Suggestions 1. Replace transient package execution with an exact, reviewed version, for example: ```bash npx --yes create-react-app@EXACT_REVIEWED_VERSION ai-money-website ``` Prefer a maintained, locally declared scaffolding dependency or a checked-in template over runtime retrieval. 2. Pin every direct dependency to an exact version rather than using unbounded install commands or caret ranges. 3. Generate, review, and commit `package-lock.json`, then use: ```bash npm ci ``` This ensures installation follows the reviewed lockfile rather than performing fresh dependency resolution. 4. Verify lockfile integrity fields and use a trusted, explicitly configured npm registry. 5. Review dependency provenance, maintainers, release history, lifecycle scripts, and transitive dependencies before approving upgrades. 6. Run dependency installation and build steps in an isolated, least-privileged environment without production credentials, sensitive environment variables, or access to unrelated user files. 7. Consider disabling lifecycle scripts during initial inspection: ```bash npm ci --ignore-scripts ``` Enable only specifically reviewed scripts where functionality requires them. 8. Add automated dependency scanning and lockfile-change review to the development workflow.
