T03 · Remote Payload Retrieval and Execution
Error
- Location
- handlers/latex.md:14
- Finding
- Mandatory execution of an unverified remote shell installer<![CDATA[ ## Vulnerability Details **File Location**: `handlers/latex.md:14-21` **Vulnerability Type**: Remote payload retrieval and immediate shell execution **Risk Level**: High ### Vulnerable Code ```markdown ### Step 1: Install Environment Tectonic is not pre-installed. Install it first: ```bash cd ~ && curl -fsSL https://drop-sh.fullyjustified.net | sh && ls -la tectonic ``` **Note**: Tectonic will be installed to `~/tectonic` (user home directory) ``` The same unsafe installation command is also presented by the environment-checking script: ```bash echo " Tectonic: curl -fsSL https://drop-sh.fullyjustified.net | sh" ``` This secondary occurrence is located at `scripts/setup.sh:452`. ### Technical Analysis The LaTeX workflow instructs the Agent to download a mutable shell script from `https://drop-sh.fullyjustified.net` and pass its contents directly to `sh`. There is no intervening inspection, version pinning, checksum verification, digital-signature validation, or trusted release manifest. Although HTTPS provides transport encryption, it does not guarantee that the server will continue returning the same reviewed payload. The effective code can change after the Skill package has been audited. Compromise of the remote server, domain, hosting account, certificate issuance process, or deployment pipeline would allow an attacker to replace the installer with arbitrary shell commands. The instruction is presented as the first mandatory step of the LaTeX route. This makes execution likely whenever a user explicitly requests LaTeX or Tectonic-based PDF generation. Installing a single PDF compiler does not require granting an unaudited remote response unrestricted shell execution. `scripts/setup.sh` only prints the command and does not directly execute it. Nevertheless, it promotes the same unsafe installation mechanism. ### Attack Path 1. An attacker compromises or gains control over the remote installer endpoint or its deployment pipeline. ...[truncated 1445 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove every `curl | sh` installation instruction, including the command printed by `scripts/setup.sh`. 2. Download an official, versioned Tectonic release artifact from a documented upstream release location. 3. Pin the exact Tectonic version and platform-specific artifact name. 4. Verify the artifact before execution using a pinned SHA-256 or stronger digest obtained through a separately authenticated release manifest. 5. Prefer upstream cryptographic signatures when available and verify them against a pinned maintainer key. 6. Download into a dedicated temporary directory with restrictive permissions rather than streaming into a shell. 7. Extract only the expected executable and install it into a Skill-specific directory or isolated environment. 8. Do not overwrite an existing executable without explicit user approval. 9. Run the compiler as an unprivileged user and, where possible, inside a sandbox with restricted filesystem and network access. 10. Require explicit user consent before installing any missing dependency. 11. Make the safe installation process fail closed if version, signature, checksum, filename, or destination validation fails. ]]>
