T03 · Remote Payload Retrieval and Execution
Error
- Location
- skill.md:40
- Finding
- Unpinned Remote Source and Dependencies Are Built and Executed## Vulnerability Details **File Location**: `skill.md`, lines 40-42 **Vulnerability Type**: Remote payload retrieval and insecure dependency execution **Risk Level**: High **Complete Code Snippet**: ```bash 1. Clone: `git clone https://github.com/citrineos/citrineos-core` 2. Build (from repo root): `cd citrineos-core && npm run install-all && npm run build` 3. Start: `cd Server && docker-compose -f docker-compose.yml up -d` ``` ### Technical Analysis The installation procedure clones the mutable default branch of an external Git repository without pinning or verifying a reviewed release, tag, or commit hash. It then invokes `npm run install-all`, which may download third-party packages and execute package lifecycle scripts, before building the retrieved code and starting its Docker services. The effective code executed by this skill can therefore change after the skill itself has been reviewed. HTTPS authenticates the connection to GitHub but does not establish that the current repository contents or transitive dependencies match a previously audited version. No commit verification, release-signature verification, lockfile enforcement, dependency integrity review, or container image digest verification is required by the instructions. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or a transitive npm dependency. 2. The attacker adds malicious code to the default branch, an installation script, a package lifecycle hook, or a dependency release. 3. A user asks the skill to install CitrineOS. 4. The skill clones the current mutable upstream content. 5. `npm run install-all` downloads dependencies and may execute attacker-controlled lifecycle scripts. 6. The resulting code is built, and Docker Compose starts the affected services. 7. Malicious code executes with the permissions available to the invoking user, npm process, or containers. ### Impact Asse ...[truncated 768 chars]
- Remediation
- ## Remediation Suggestions 1. Pin installation to a reviewed release tag and immutable commit SHA rather than cloning the default branch. 2. Verify that the checked-out commit exactly matches the expected SHA before running any npm or Docker command. 3. Where upstream signing is available, verify signed release tags or artifacts against a documented trusted maintainer key. 4. Require a committed lockfile and use a lockfile-enforcing installation command such as `npm ci` instead of an unconstrained dependency installation. 5. Review package lifecycle scripts and consider disabling them during installation with `--ignore-scripts`, enabling only explicitly required scripts after review. 6. Pin container images by immutable digest and verify signatures or provenance where supported. 7. Run builds in an isolated, non-privileged environment without production credentials or sensitive host mounts. 8. Document the exact reviewed CitrineOS version, dependency-lockfile hash, and expected artifact checksums.
