T08 · Insecure Dependencies
- Location
scripts/ocal_bootstrap.py:14- Finding
Automatic Runtime Installation of Unpinned Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
scripts/ocal_bootstrap.py:14-15, 38-49
Vulnerability Type: Unverified and unpinned runtime dependency installation
Risk Level: MediumVulnerable Code
python # Dependencies: requests (Graph requests), msal (authentication renewal), # and tzdata (Windows timezone data) REQUIRED = ("requests", "msal", "tzdata") def ensure_deps(): """Check dependencies and install missing packages automatically.""" missing = _missing() if not missing: return pkgs = " ".join(missing) print(t("deps_missing", pkgs=pkgs), file=sys.stderr) print(t("deps_installing"), file=sys.stderr) try: proc = subprocess.run( [sys.executable, "-m", "pip", "install", "--disable-pip-version-check", *missing], capture_output=True, text=True, timeout=300, )Technical Analysis
The application automatically invokes
pip installwhenrequests,msal, ortzdatais absent. No exact versions, package hashes, lockfile, trusted index, or repository verification is specified. Installation also occurs as part of ordinary login and calendar-command execution rather than through a separate, explicit setup process.The package names appear legitimate and no typo-squatting was identified. Nevertheless, dependency resolution uses the Python environment's currently configured package indexes and selects whatever compatible versions are available at execution time. Consequently, the effective code executed by the Skill can change after the Skill package has been audited.
This is a supply-chain weakness rather than direct command injection: package names are fixed constants and
subprocess.runuses an argument list withoutshell=True. Exploitation would require compromise or unsafe configuration of the package source, a malicious package release, or compromise of a transitive dependency.Atta
...[truncated 1512 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove automatic package installation from normal login and calendar operations.
- Move dependency installation to a separate, explicit setup step that requires user approval.
- Pin all direct and transitive dependencies to reviewed versions in a lockfile.
- Generate and verify cryptographic hashes for every distributable package, then install with
pip install --require-hashes. - Configure an explicit trusted package index or an internally controlled package mirror instead of inheriting arbitrary environment-level index configuration.
- Install dependencies in an isolated virtual environment with only the permissions required by the Skill.
- Add automated dependency vulnerability and integrity scanning to the release process.
- Document the reviewed dependency versions and update them through a controlled, auditable process.
