T08 · Insecure Dependencies
- Location
package.json:16- Finding
Unpinned and Unlocked Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
package.json:16-18; related installation guidance atREADME.md:16-21andPUBLISH.md:27-28
Vulnerability Type: Supply-chain exposure caused by non-reproducible dependency resolution
Risk Level: MediumVulnerable Code and Configuration
package.json:16-18:json "dependencies": { "tesseract.js": "^7.0.0" },README.md:16-21:bash # Manual installation git clone https://github.com/openclaw/skill-ocr.git ~/.openclaw/workspace/skills/ocr cd ~/.openclaw/workspace/skills/ocr npm installPUBLISH.md:27-28explicitly states that the lockfile was removed:text - ❌ package-lock.json - Let users use the latest versionTechnical Analysis
The dependency uses the caret version range
^7.0.0, which permits npm to install later compatible releases rather than the exact version reviewed with this skill. The project also deliberately omitspackage-lock.jsonand directs users to runnpm install.Consequently, installation is not reproducible: the resolved direct and transitive dependency graph may change over time without any modification to the audited project files. This creates a supply-chain trust gap between the reviewed artifact and the code ultimately installed on a user's system.
No evidence shows that the current
tesseract.jspackage is malicious. The vulnerability is the unsafe dependency-management practice, which would allow a compromised, malicious, or unexpectedly changed release satisfying the declared range to enter installations without project-level review.Attack Path
- An attacker compromises an npm publisher account, an allowed future
tesseract.jsrelease, or one of its transitive dependencies. - The attacker publishes a release that satisfies
^7.0.0, or causes npm resolution to include a compromised transitive package. - A user follows the documented instructions and runs `npm instal ...[truncated 1278 chars]
- An attacker compromises an npm publisher account, an allowed future
- Remediation
View remediation
Remediation Suggestions
- Replace the version range with an exact reviewed version:
json "dependencies": { "tesseract.js": "7.0.0" } - Generate and commit
package-lock.jsonso direct and transitive dependency versions and integrity hashes are recorded. - Change installation and deployment instructions from
npm installtonpm ci, which enforces the committed lockfile. - Do not remove the lockfile to obtain newer packages automatically. Update dependencies through an explicit review process and regenerate the lockfile only after testing.
- Review dependency release notes, package ownership changes, lifecycle scripts, and transitive dependency changes before accepting updates.
- Run automated dependency and provenance checks in CI, such as
npm audit, lockfile-diff review, and registry integrity verification. - Where operationally possible, install dependencies with lifecycle scripts disabled using
npm ci --ignore-scripts, then enable only installation behavior demonstrated to be necessary. - Avoid running installation or OCR commands as root or another privileged account, and isolate processing of untrusted images in a restricted environment.
- Replace the version range with an exact reviewed version:
