T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:14
- Finding
- Unpinned Package Execution Through npx## Vulnerability Details **File Location**: `SKILL.md`, lines 12-15; a second occurrence appears at lines 36-46 **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: Medium ### Vulnerable Code ```bash cd /Users/kendrick/projects/hauscout npx tsx scripts/collect.ts ``` The database inspection instructions similarly invoke the package without an explicit version: ```bash cd /Users/kendrick/projects/hauscout npx tsx -e " import { neon } from '@neondatabase/serverless'; import { drizzle } from 'drizzle-orm/neon-http'; import * as schema from './src/db/schema'; // .env.local 로드 필요 const sql = neon(process.env.DATABASE_URL!); const db = drizzle(sql, { schema }); const all = await db.select().from(schema.listings); console.log(JSON.stringify(all, null, 2)); " ``` ### Technical Analysis The Skill invokes `tsx` through `npx` without specifying an exact version or requiring a verified, locally installed dependency. If a suitable local executable is unavailable, `npx` may resolve and download a package from the configured npm registry. The resulting executable is then run with the current user's permissions. The command also executes `scripts/collect.ts` from the external absolute directory `/Users/kendrick/projects/hauscout`. That script and its dependency metadata were not included in the audited artifact, so their integrity and behavior cannot be verified from this project. This creates a supply-chain boundary in which execution may depend on mutable registry content, local npm configuration, dependency resolution, and an unaudited external project directory. ### Attack Path 1. An attacker compromises or influences the npm registry, configured registry mirror, package-resolution configuration, or the relevant package distribution. 2. Alternatively, an attacker with access to the external project modifies its dependency configuration or `scripts/collect.ts`. 3. The agent follow ...[truncated 975 chars]
- Remediation
- ## Remediation Suggestions 1. Declare `tsx` as a project dependency at an exact, reviewed version and commit the package manifest and lockfile. 2. Install dependencies using a lockfile-enforcing command such as `npm ci` rather than permitting ad hoc package resolution. 3. Invoke the verified local executable through a package script, for example `npm run collect`, instead of relying on an unversioned `npx` command. 4. Consider using `npx --no-install tsx ...` if `npx` remains necessary, so execution fails rather than downloading a missing package. 5. Verify package integrity and provenance, use a trusted registry, and protect npm configuration from unauthorized modification. 6. Include the referenced collection script, dependency manifests, and relevant source files within the auditable project boundary. 7. Run the collector with a least-privileged account and provide only the environment variables and filesystem access required for the task. 8. Replace the inline database command with a reviewed, version-controlled diagnostic script that limits output to necessary records and fields.
