T03 · Remote Payload Retrieval and Execution
- Location
scripts/update-skill.sh:72- Finding
Unauthenticated Remote Replacement of Executable Skill Code
- Content
View full analysis
/dev/null || echo "")}" REMOTE_SHA=$(curl -sf \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: Bearer $GH_TOKEN" \ "https://api.github.com/repos/fdarkaou/genviral-skill/commits/$REMOTE_BRANCH" \ | jq -r '.sha' 2>/dev/null || echo "") ``` ```bash for FILE in "${SKILL_OWNED_FILES[@]}"; do RAW_URL="https://raw.githubusercontent.com/fdarkaou/genviral-skill/$REMOTE_SHA/$FILE" TARGET="$SKILL_DIR/$FILE" if [[ "$DRY_RUN" == "true" ]]; then echo "[DRY RUN] Would update: $FILE" continue fi # Fetch and write atomically TMPFILE=$(mktemp) if curl -sf "$RAW_URL" -o "$TMPFILE"; then mkdir -p "$(dirname "$TARGET")" mv "$TMPFILE" "$TARGET" # Make scripts executable [[ "$FILE" == scripts/* ]] && chmod +x "$TARGET" ``` ### Technical Analysis The updater obtains the latest commit identifier from the upstream repository's mutable `main` branch and then downloads files from that commit. It overwrites local executable scripts, documentation, and `SKILL.md`, and explicitly marks downloaded scripts as executable. Using the remotely returned commit SHA ensures that all downloaded files come from one commit, but it does not establish that the commit is an authorized, reviewed release. There is no locally pinned expected commit, signed-release verification, trusted-key validation, or hash manifest independent of the same upstream repository. The files subject to replacement include `scripts/genviral.sh`, `scripts/update-skill.sh`, and `SKILL.md`. Consequently, the remotely supplied payload can alter both locally executed shell code and the instructions subsequently loaded by the AI a ...[truncated 1372 chars]- Remediation
View remediation
