T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Mutable Python Dependencies and Unofficial npm Registry Mirror Create Supply-Chain Exposure
- Content
View full analysis
=4.10.0 lxml>=4.6.0 html5lib>=1.1 ``` `SKILL.md:68-72`: ```bash pip install python-pptx beautifulsoup4 lxml ``` `package-lock.json:12-19`: ```json "node_modules/@types/node": { "version": "18.19.130", "resolved": "https://registry.npmmirror.com/@types/node/-/node-18.19.130.tgz", "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } } ``` The remaining npm packages are likewise resolved from `registry.npmmirror.com`. ### Technical Analysis The Python dependency declarations use lower-bound constraints rather than exact versions. A new release satisfying these constraints can therefore be selected without any corresponding source-code review. The installation command in `SKILL.md` is even less restrictive and does not verify artifact hashes. The npm lockfile pins versions and includes integrity hashes, which provides protection against an artifact being silently modified while retaining the same expected hash. However, all observed npm artifacts are downloaded from a third-party registry mirror instead of the official npm registry. Integrity hashes verify that downloaded artifacts match the lockfile, but they do not independently establish that the originally locked artifacts or the mirror are trustworthy. No dependency was confirmed to be malicious during this audit. The vulnerability is the avoidable supply-chain exposure caused by mutable Python resolution and reliance on an unofficial npm package source. ### Attack Path 1. An attacker compromises a permitted upstream Python package release, ...[truncated 1557 chars]- Remediation
View remediation
lxml== html5lib== python-pptx== ``` 2. Generate a reproducible Python lockfile containing hashes, such as with `pip-compile --generate-hashes`, and require hash verification during installation: ```bash python -m pip install --require-hashes -r requirements.lock ``` 3. Ensure `python-pptx`, which is imported by `src/convert.py`, is declared in the authoritative Python dependency file rather than only mentioned in documentation. 4. Update `SKILL.md` to direct users to the reviewed lockfile instead of installing unconstrained packages by name. 5. Regenerate `package-lock.json` using the official npm registry or an explicitly approved, authenticated organizational registry: ```bash npm config set registry https://registry.npmjs.org/ npm install --package-lock-only ``` 6. Remove the npm manifest and lockfile entirely if the Node.js implementation is obsolete. The current executable implementation is Python, while `package.json` references a missing `html2pptx.js` entry point. 7. Run dependency scanning in CI, review lockfile changes, use automated update pull requests, and test updates before accepting new versions. 8. Install dependencies and execute conversion in a least-privileged, isolated environment without unnecessary credentials or access to sensitive host paths. ]]>
