T08 · Insecure Dependencies
- Location
package.json:18- Finding
Unpinned and Incorrectly Declared Third-Party Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
package.json:18-20;skill.md:30-34
Vulnerability Type: Supply-chain dependency confusion and mutable dependency resolution
Risk Level: MediumVulnerable Code
package.json:18-20:json "dependencies": { "baostock": "^1.0", "pandas": "^2.0" }skill.md:30-34:markdown ## Dependencies ```bash pip install baostock pandastext ### Technical Analysis The project uses Python modules, but declares `baostock` and `pandas` in the npm `dependencies` field. An npm-compatible installer can therefore attempt to resolve packages with these names from the npm registry rather than installing the intended Python packages from PyPI. This creates a package-ecosystem confusion risk and may install unrelated packages. The documented pip command also installs both Python packages without exact version constraints or integrity hashes. Consequently, installation results can change over time and will automatically trust whichever package versions the configured package index currently serves. No `requirements.txt`, `pyproject.toml`, lockfile, or hash verification is present to constrain dependency resolution to reviewed artifacts. Dependency installation can execute package lifecycle or build scripts. Thus, compromise of a resolved package, use of an untrusted package registry, or installation of a wrong-ecosystem package could cause attacker-controlled code to run before the stock-query script is executed. ### Attack Path 1. A user or automated deployment process installs the project dependencies. 2. If npm is used with `package.json`, npm resolves packages named `baostock` and `pandas` from the npm registry rather than the intended Python package ecosystem. 3. Alternatively, the documented unpinned pip command resolves the latest versions available from the configured Python package index. 4. An attacker compromises a dependency release, contr ...[truncated 1017 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the Python dependencies from the npm
dependenciessection ofpackage.json. Ifpackage.jsonis retained only as package metadata or a command wrapper, do not represent Python modules as npm packages. - Declare Python dependencies in a Python-native manifest such as
pyproject.tomlorrequirements.txt. - Pin every dependency and relevant transitive dependency to an explicitly reviewed version.
- Generate and verify cryptographic hashes for all resolved artifacts. For a requirements-based workflow, install with:
bash python3 -m pip install --require-hashes -r requirements.txt - Generate a lockfile using a suitable dependency-management tool and commit it to the repository.
- Configure installers to use an approved package index over TLS and avoid untrusted mirrors or unrestricted extra indexes.
- Add automated dependency vulnerability and integrity scanning to the release process.
- Install and run the Skill in a dedicated, least-privileged virtual environment or container without access to unrelated credentials or sensitive files.
- Update
skill.mdandREADME.mdso their installation instructions reference only the reviewed, hash-locked Python dependency manifest.
- Remove the Python dependencies from the npm
