T08 · Insecure Dependencies
Error
- Location
- scripts/setup.sh:18
- Finding
- Unpinned Automatically Upgraded Dependency Handles Portal Credentials## Vulnerability Details **File Location**: `scripts/setup.sh:18-21` **Additional Locations**: `README.md:11,45`; `skill.json:15-17`; `ku_query.py:39-40,337` **Vulnerability Type**: Unpinned privileged third-party dependency **Risk Level**: High **Complete Vulnerable Code Snippet**: ```bash # 2) pip upgrade and package installation echo "📥 $PKG installation/update in progress..." "$VENV_DIR/bin/pip" install --upgrade pip -q "$VENV_DIR/bin/pip" install --upgrade "$PKG" -q ``` The dependency is declared without a version constraint: ```json "requires": [ "python3", "pip:ku-portal-mcp" ] ``` The installed package subsequently receives the user's credentials: ```python os.environ["KU_PORTAL_ID"] = creds["id"] os.environ["KU_PORTAL_PW"] = creds["pw"] ``` ```python lms_session = await lms_login(os.environ["KU_PORTAL_ID"], os.environ["KU_PORTAL_PW"]) ``` ### Technical Analysis The setup script installs the latest available `ku-portal-mcp` package and explicitly upgrades it each time setup is run. It does not pin a reviewed version, verify package hashes, or use a dependency lock file. Consequently, the code executed by this Skill can change after the Skill itself has been audited. This dependency is central to the declared portal functionality, so using it is functionally justified. However, automatically trusting every future package release is not the minimum safe privilege necessary for a component that imports executable Python code and handles institutional account credentials. Imported Python packages execute with the same operating-system privileges as the Skill process. The wrapper also places the KUPID identifier and password into environment variables and passes them directly to the dependency's LMS login function. A compromised package release would therefore have immediate access to those credentials and to all other files and resources accessible to the user running the Skill. ...[truncated 1623 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `ku-portal-mcp` to an exact, reviewed version instead of installing the latest release. 2. Maintain a locked requirements file containing cryptographic hashes, and install it with: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Remove automatic dependency upgrades from normal setup. Perform upgrades only through a deliberate review and release process. 4. Pin and verify transitive dependencies where practical. 5. Record the reviewed dependency version consistently in `scripts/setup.sh`, `README.md`, and `skill.json`. 6. Test package updates in an isolated environment before distributing them. 7. Minimize credential exposure to the dependency and avoid placing credentials in global process environment variables unless required by a verified API.
