T08 · Insecure Dependencies
Warning
- Location
- docs/Threejs-Guide.md:31
- Finding
- Unpinned gltf-transform Package Retrieval and Execution in Three.js Guide<![CDATA[ ## Vulnerability Details **File Location**: `docs/Threejs-Guide.md:31-35` **Vulnerability Type**: Unpinned third-party package retrieval and execution **Risk Level**: Medium ### Vulnerable Code ```bash npx gltf-transform resample input.glb tmp1.glb npx gltf-transform dedup tmp1.glb tmp2.glb npx gltf-transform prune tmp2.glb tmp3.glb npx gltf-transform quantize tmp3.glb tmp4.glb npx gltf-transform draco tmp4.glb output.glb ``` ### Technical Analysis The guide instructs users or an AI Agent to invoke `gltf-transform` through `npx` without declaring an exact package version, lockfile, integrity value, or local-only execution restriction. If the command is unavailable locally, `npx` may retrieve the package and its dependency graph from the configured package registry before executing its CLI code. Consequently, the code that runs can differ from the code originally reviewed with this Skill. Risks include a compromised package release, compromised transitive dependency, registry or configuration manipulation, and unexpected resolution to a newer package version. The package is not known to be malicious based on the audited files. The vulnerability is the unsafe and non-reproducible dependency execution pattern. ### Attack Path 1. A developer or Agent follows the documented GLB compression procedure. 2. `gltf-transform` is not already installed as a verified local dependency. 3. `npx` resolves and downloads the package and its dependencies from the configured registry. 4. An attacker-controlled or compromised package version is selected due to the absence of an exact version and verified lockfile. 5. The downloaded package's CLI or lifecycle code executes with the invoking user's permissions. 6. Malicious code can inspect accessible files, alter the project, invoke child processes, or make outbound network requests. ### Impact Assessment Successful exploitation would provide code execution within the security context of the user or Agent running ...[truncated 588 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Add the verified CLI package as an exact-version development dependency rather than resolving it dynamically: ```bash npm install --save-dev --save-exact @gltf-transform/cli@VERIFIED_VERSION ``` 2. Commit the package manifest and lockfile, and require lockfile-based installation such as: ```bash npm ci ``` 3. Invoke only the installed local binary: ```bash npx --no-install gltf-transform resample input.glb tmp1.glb ``` Alternatively, define reviewed package scripts in `package.json`. 4. Verify the correct package identity and review the selected version and its transitive dependencies before documenting it. 5. Enable dependency scanning and lockfile integrity checks in CI. 6. Run asset-processing tools in a restricted environment with minimal filesystem access, no unnecessary credentials, and outbound network access disabled where practical. 7. Update the guide to warn that package installation executes third-party code and should not occur automatically without user approval. ]]>
