T08 · Insecure Dependencies
- Location
SKILL.md:20- Finding
Unpinned Git Dependency Allows Mutable Upstream Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 20
Vulnerability Type: Unpinned dependency installed from a mutable Git repository
Risk Level: MediumVulnerable Code:
bash pip install git+https://github.com/wayneweiqiang/GaMMA.gitTechnical Analysis
The documented installation command directs pip to retrieve and install executable Python package content from the repository's mutable default branch. It does not specify an immutable commit hash, an exact reviewed release, a lockfile, or artifact hashes.
Consequently, the code installed by this command can change after the Skill has been reviewed without any modification to
SKILL.md. Python package installation may invoke build backends or other package-controlled installation logic, while subsequent imports execute the installed library code.The document states that the Skill is derived from
AI4EPS/GaMMA, but the installation command referenceswayneweiqiang/GaMMA. Although this may be legitimate, the provenance relationship is not explained or verified in the reviewed file.Attack Path
- An attacker compromises the referenced GitHub repository, a maintainer account, or the repository's dependency publication process.
- The attacker adds malicious code to the repository's default branch, including package build logic or runtime modules.
- A user follows the installation command in
SKILL.md. - Pip retrieves the current attacker-controlled revision rather than an immutable, previously audited revision.
- Malicious code executes during package installation or when the package is subsequently imported and used.
Impact Assessment
Successful exploitation can result in arbitrary code execution with the privileges of the account running pip or the resulting Python package. Depending on that account's access, the payload could read or modify user-accessible files, access environment variables and credentials, alter Python ...[truncated 443 chars]
- Remediation
View remediation
Remediation Suggestions
- Verify the authoritative upstream repository and document why the selected repository is trusted, particularly because the stated derivative source and installation source differ.
- Pin installation to an immutable, reviewed full commit hash rather than the repository's default branch:
bash pip install "git+https://github.com/wayneweiqiang/GaMMA.git@FULL_REVIEWED_COMMIT_HASH" - Prefer an exact, verified release artifact from a trusted package registry when one is available.
- Record dependencies in a lockfile or requirements file and verify distribution hashes, for example by using pip's hash-checking mode for registry artifacts.
- Review the pinned package's build configuration, build backend, transitive dependencies, and installation hooks before approval.
- Install into an isolated virtual environment or container under an unprivileged account. Do not run the installation command as root.
- Establish a controlled update process in which dependency revisions are reviewed and tested before changing the pinned version.
