T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:153- Finding
Execution of Unpinned Code Retrieved from a Mutable Remote Repository
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:153-159; mirrored inSKILL-cn.md:153-159
Vulnerability Type: Remote payload retrieval and execution
Risk Level: HighVulnerable Code
SKILL.md:bash git clone https://github.com/RaymondYHH/mtg-skill.git cd mtg-skill/magic-skilltext After installing, run `python3 raw/tools/mtg_wiki/build_indices.py` to build local indices.SKILL-cn.mdcontains the equivalent commands:bash git clone https://github.com/RaymondYHH/mtg-skill.git cd mtg-skill/magic-skilltext 安装后运行 `python3 raw/tools/mtg_wiki/build_indices.py` 构建本地索引。Technical Analysis
The Skill directs users to clone the current default branch of an external GitHub repository and then execute
build_indices.pyfrom the downloaded content. The repository is not pinned to a reviewed commit hash or signed release, and the instructions do not require signature or checksum verification.Consequently, the effective executable payload can change after this Skill has been reviewed. The referenced Python script and its imported modules are not included in the audited artifact, which contains only
SKILL.mdandSKILL-cn.md; their behavior therefore cannot be statically verified as part of this audit.This is a remote payload retrieval and execution weakness rather than evidence that the current remote repository is malicious. The security issue arises because mutable, externally controlled code is trusted and executed without integrity validation.
Attack Path
- An attacker compromises the repository owner, a maintainer account, or another mechanism capable of modifying the repository's default branch.
- The attacker modifies
raw/tools/mtg_wiki/build_indices.pyor a Python module imported by that script. - A user follows the Skill instructions and clones the repository without selecting a known, reviewed revision.
- The user runs `python3 ...[truncated 989 chars]
- Remediation
View remediation
Remediation Suggestions
- Include all required scripts and data-processing code directly in the published Skill so that the complete executable implementation can be reviewed with the package.
- If remote retrieval is unavoidable, pin the repository to a specific reviewed commit hash rather than cloning and executing the mutable default branch.
- Publish cryptographic checksums or signed release artifacts and verify them before any downloaded file is executed.
- Review the pinned
build_indices.pyfile and all local modules it imports, because pinning only the top-level command is insufficient if dependencies remain mutable. - Use a detached checkout of the approved commit and reject execution if the checked-out revision or file hashes differ from expected values.
- Run the indexing process in a sandbox or container with minimal filesystem access, no unnecessary credentials, restricted network access, and no administrative privileges.
- Keep the English and Chinese instructions synchronized so that both variants enforce the same integrity-verification and least-privilege controls.
