T08 · Insecure Dependencies
Warning
- Location
- scripts/gdocs-create.sh:38
- Finding
- Unverified Download and Execution of Pandoc Binary<![CDATA[ ## Vulnerability Details **File Location**: `scripts/gdocs-create.sh`, lines 38–57 **Vulnerability Type**: Unverified third-party executable download **Risk Level**: Medium ### Vulnerable Code ```bash # Setup pandoc PANDOC_BIN="/tmp/pandoc-3.1.11/bin/pandoc" if [ ! -f "$PANDOC_BIN" ]; then echo -e "${YELLOW}Downloading pandoc...${NC}" cd /tmp wget -q https://github.com/jgm/pandoc/releases/download/3.1.11/pandoc-3.1.11-linux-amd64.tar.gz tar xzf pandoc-3.1.11-linux-amd64.tar.gz rm pandoc-3.1.11-linux-amd64.tar.gz echo -e "${GREEN}Pandoc installed to $PANDOC_BIN${NC}" fi # Create temp docx file TMP_DIR=$(mktemp -d) DOCX_FILE="$TMP_DIR/${DOC_TITLE// /_}.docx" echo -e "${YELLOW}Converting Markdown to DOCX...${NC}" "$PANDOC_BIN" "$MD_FILE" -o "$DOCX_FILE" ``` ### Technical Analysis The script downloads a precompiled Pandoc archive and subsequently executes the extracted binary without verifying a cryptographic checksum or digital signature. The URL points to Pandoc's official GitHub release rather than a personal paste or code-hosting account, and the version is pinned to `3.1.11`; however, pinning a URL does not verify the integrity or authenticity of the downloaded bytes. If the release artifact, hosting account, network trust chain, or local certificate trust store is compromised, an altered archive could install attacker-controlled executable code. The archive is extracted immediately, and the resulting binary is trusted solely because it exists at the expected path. Automatic executable acquisition supports the declared conversion workflow, but it is not the minimum-risk design. Requiring a trusted system installation or verifying the downloaded release would reduce the supply-chain exposure. ### Attack Path 1. An attacker compromises the upstream release asset, its hosting account, or the victim's network or TLS trust environment. 2. The victim invokes the Skill on a system where `/tmp/pandoc-3.1.11/bin/pandoc` does ...[truncated 768 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Prefer a Pandoc installation supplied by a trusted operating-system package manager, or require users to install Pandoc before invoking the Skill. 2. If automatic downloading is retained, pin and verify an official SHA-256 or stronger checksum before extraction. 3. Where upstream signatures are available, verify the release signature against a pinned, trusted signing key. 4. Download the archive into a private directory created with `mktemp -d`, rather than directly into shared `/tmp`. 5. Use strict download options such as `wget --https-only` and fail closed on download or verification errors. 6. Extract the archive only after successful integrity verification. 7. Keep the checksum and version update process explicit and reviewable. ]]>
