T08 · Insecure Dependencies
- Location
references/package-template.json:7- Finding
Unpinned npm Dependencies Use Mutable Latest Versions
- Content
View full analysis
Vulnerability Details
File Location:
references/package-template.json, lines 7–12
Vulnerability Type: Supply-chain risk caused by unpinned third-party dependencies
Risk Level: MediumVulnerable Code
json "@gltf-transform/core": "latest", "@gltf-transform/extensions": "latest", "@gltf-transform/functions": "latest", "draco3dgltf": "latest", "meshoptimizer": "latest", "sharp": "latest"Technical Analysis
All runtime dependencies use npm's mutable
latestdistribution tag rather than reviewed, exact versions. Consequently, a new installation can retrieve package releases that were not available when the Skill was audited. Without an accompanying lockfile, installations are also non-reproducible and cannot reliably enforce previously reviewed dependency versions and integrity hashes.Several dependencies are loaded directly by
references/optimize-glb.mjs. Package installation may additionally execute npm lifecycle scripts. Therefore, compromise of an upstream package or its publishing account could introduce attacker-controlled code into the installation or optimization process.This finding does not establish that any currently published dependency is malicious. It identifies an avoidable supply-chain exposure caused by automatically trusting future releases.
Attack Path
- An attacker compromises an upstream dependency's maintainer account, publishing pipeline, or package distribution process.
- A malicious release becomes the version referenced by the
latesttag. - A user creates a Node.js project from
references/package-template.jsonand runs an npm installation. - npm resolves the mutable tag to the malicious, previously unaudited release.
- Attacker-controlled code executes through an installation lifecycle script or when the optimization script imports and invokes the dependency.
- The code runs with the operating-system permissions of the user executing npm or the optimizer.
Impact Assessment
Suc ...[truncated 547 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace every
latesttag with an exact, reviewed version, without caret or tilde ranges. For example:
json { "dependencies": { "@gltf-transform/core": "REVIEWED_EXACT_VERSION", "@gltf-transform/extensions": "REVIEWED_EXACT_VERSION", "@gltf-transform/functions": "REVIEWED_EXACT_VERSION", "draco3dgltf": "REVIEWED_EXACT_VERSION", "meshoptimizer": "REVIEWED_EXACT_VERSION", "sharp": "REVIEWED_EXACT_VERSION" } }- Generate and commit
package-lock.jsonso resolved transitive versions and integrity hashes are recorded. - Use
npm ciin development and CI rather than allowing dependency resolution to change implicitly. - Review changelogs, provenance, maintainer changes, and lifecycle scripts before updating pinned versions.
- Run vulnerability and dependency-policy checks in CI, while reviewing findings rather than applying unverified automatic upgrades.
- Where operationally feasible, perform package installation and asset processing in a sandbox or least-privileged build environment with no unnecessary credentials.
- Replace every
