T08 · Insecure Dependencies
Warning
- Location
- README.md:127
- Finding
- Unpinned Third-Party Package Installation<![CDATA[ ## Vulnerability Details **File Location**: `README.md:127-133` **Vulnerability Type**: Unpinned dependency installation from external package repositories **Risk Level**: Medium ### Vulnerable Code ```r ### Installing Missing Packages ```r # Skill detects and installs missing packages install.packages("lme4") # For mixed models # Or Bioconductor BiocManager::install("DESeq2") ``` ``` ### Technical Analysis The documented workflow directs the agent to install third-party R packages without specifying package versions, validating package integrity, enforcing trusted repository URLs, or restoring dependencies from a reviewed lockfile. Both `install.packages()` and `BiocManager::install()` resolve packages and their transitive dependencies using the repositories configured in the active R environment. R package installation can execute package build or installation logic. Consequently, the effective code installed depends on mutable external repositories and local repository configuration at the time the command is run. The README is documentation rather than an executable script, so exploitation requires the skill or an operator to follow this workflow. Nevertheless, the skill explicitly claims that it detects and installs missing packages, making unsafe dependency installation part of the described operating procedure. ### Attack Path 1. An attacker compromises a configured package repository, publishes a malicious dependency through a dependency-confusion or similarly unsafe resolution path, or modifies the target project's R repository configuration. 2. The agent encounters a missing package while modifying or rendering the R project. 3. Following the documented workflow, the agent runs `install.packages("lme4")`, `BiocManager::install("DESeq2")`, or an equivalent unpinned installation command. 4. R resolves the requested package and transitive dependencies from the attacker-influenced source. 5. Malicious package code executes during inst ...[truncated 966 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace ad hoc package installation with a reviewed `renv.lock` file and use `renv::restore()` to reproduce approved dependency versions. 2. Pin exact package versions and review transitive dependency changes before installation. 3. Configure explicit, trusted HTTPS repository URLs rather than accepting repositories inherited from an uncontrolled project or user environment. 4. Require explicit user approval before installing or upgrading any package. 5. Run dependency installation and report rendering in an isolated container or sandbox with minimal filesystem access, no unnecessary credentials, and restricted network access. 6. Separate dependency restoration from analysis execution so package changes are visible and auditable. 7. Record package sources, versions, repository metadata, and lockfile changes in version control. 8. Where practical, verify downloaded package integrity using trusted repository metadata or approved artifact hashes. 9. Update the documentation to state that project-controlled repository configuration must be reviewed before any installation command is executed. ]]>
