T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/setup.sh:7
- Finding
- Mutable Remote Repository Is Downloaded and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup.sh`, lines 7 and 39-51 **Vulnerability Type**: Unverified remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash REPO="https://github.com/murtiurti4/quantumos.git" ``` ```bash # Clone or update repo if [ -d "$INSTALL_DIR" ]; then echo "📁 QuantumOS already exists at $INSTALL_DIR" cd "$INSTALL_DIR" echo " Pulling latest..." git pull --ff-only 2>/dev/null || echo " (skipped pull - may have local changes)" else echo "📥 Cloning QuantumOS..." mkdir -p "$(dirname "$INSTALL_DIR")" git clone "$REPO" "$INSTALL_DIR" cd "$INSTALL_DIR" fi # Install dependencies echo "📦 Installing dependencies..." npm install --no-audit --no-fund 2>&1 | tail -1 ``` ### Technical Analysis The setup script clones or updates a mutable branch from a personal GitHub repository and then immediately invokes `npm install`. It does not pin an immutable commit, verify a release signature, compare a checksum, or validate the fetched repository against reviewed content. `npm install` can execute package lifecycle hooks such as `preinstall`, `install`, and `postinstall`. Consequently, code that was not present when this Skill was reviewed can execute with the privileges of the user running the setup script. The same risk recurs whenever setup performs `git pull` or the documented update workflow is used. The `--no-audit` option also suppresses npm's dependency vulnerability audit, reducing visibility into known dependency issues. It is not itself the execution vector, but it weakens supply-chain monitoring. ### Attack Path 1. An attacker compromises the referenced GitHub account, repository, npm dependency, or dependency maintainer. 2. The attacker adds a malicious lifecycle script or modifies application code on the tracked branch. 3. A user runs the Skill's setup script or follows its update instructions. 4. `git clone` or `git pull` retrieves the modifie ...[truncated 830 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin installation to an immutable, reviewed commit hash rather than a mutable branch. - Distribute signed releases and verify signatures or cryptographic checksums before execution. - Commit and enforce a lockfile, then use `npm ci` rather than unconstrained `npm install`. - Use `npm ci --ignore-scripts` when lifecycle scripts are unnecessary. - If lifecycle scripts are required, enumerate and audit them before allowing execution. - Do not automatically update and execute new upstream content. Show the proposed version and obtain explicit user approval. - Run dependency installation and the application inside a sandbox or container with narrowly scoped filesystem and network access. - Retain dependency auditing rather than using `--no-audit`, and integrate lockfile and provenance checks. ]]>
