T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:49
- Finding
- Unpinned Third-Party Package Execution via npx## Vulnerability Details **File Location**: `SKILL.md:49` **Vulnerability Type**: Unsafe execution of an unpinned third-party dependency **Risk Level**: Medium ### Vulnerable Code ```bash npx get-graphql-schema http://localhost:4000/graphql > schema.json ``` The same command is repeated in generated guidance at `SKILL.md:97`. ### Technical Analysis The documented command invokes `get-graphql-schema` through `npx` without specifying a package version, lockfile, integrity hash, or trusted package source. If the package is not already available locally, `npx` may retrieve it and execute its code with the invoking user's permissions. Although the GraphQL endpoint is limited to `localhost`, that restriction applies only to the command's intended schema request. It does not restrict the downloaded package or its transitive dependencies. Package code can access files, environment variables, credentials available to the user, local network services, and external network destinations. This is unnecessary for the Skill's declared local static-analysis functionality. Users can provide an existing SDL or introspection JSON file, or the documentation can require a pinned and reviewed local dependency. ### Attack Path 1. An attacker compromises, replaces, or otherwise gains control over the referenced npm package or one of its transitive dependencies. 2. A user follows the Skill's documented `npx get-graphql-schema` instruction. 3. `npx` resolves and downloads the currently published, unpinned package code. 4. The retrieved package or dependency executes with the user's privileges. 5. Malicious code can read accessible project data or credentials, execute commands, modify files, or transmit information over the network. ### Impact Assessment Successful exploitation would provide code execution under the account running the command. The accessible scope may include the current project, other user-readable files, environment va ...[truncated 502 chars]
- Remediation
- ## Remediation Suggestions 1. Do not recommend dynamically executing an unversioned package through `npx`. 2. Pin a reviewed package version as a project development dependency and commit the package manifest and lockfile. 3. Invoke the installed local binary in a way that prohibits fallback downloads, such as `npx --no-install`, after verifying the package is installed. 4. Use package-manager integrity verification and automated dependency scanning. 5. Prefer a GraphQL server's built-in schema export or introspection mechanism where practical, avoiding dynamically retrieved executable tooling. 6. Clearly inform users that introspection output may reveal sensitive schema metadata and should remain local unless they explicitly authorize disclosure. 7. Apply the same correction to the repeated command at `SKILL.md:97`.
