T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:34- Finding
Mutable Remote Python Payload Downloaded and Subsequently Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:34
Vulnerability Type: Remote payload retrieval and execution
Risk Level: Mediumbash # Requires Python 3.8+. No pip install needed. curl -O https://raw.githubusercontent.com/itsPremkumar/agent-cost-tracker/main/agent_cost_tracker.py # Or copy the file anywhere — it's self-contained.The downloaded filename is subsequently used by the documented quick-start commands:
bash python agent_cost_tracker.py self-test # prove it works end-to-end python agent_cost_tracker.py tally --help # tally subcommand python agent_cost_tracker.py estimate --help # estimate subcommandTechnical Analysis
The installation instructions retrieve executable Python code from the mutable
mainbranch of a repository controlled through a personal GitHub account. The command does not pin an immutable commit, validate a cryptographic checksum, or verify a signature.Consequently, the code users execute can differ from the version included in and reviewed as part of this skill package. This behavior is unnecessary for the declared local cost-estimation functionality because
agent_cost_tracker.pyis already shipped in the package and has no runtime dependency requiring a network download.HTTPS protects the transfer in transit but does not protect against repository compromise, maintainer-account compromise, or a malicious future modification to the referenced branch.
Attack Path
- An attacker compromises the repository, its maintainer account, or another mechanism authorized to update the
mainbranch. - The attacker replaces
agent_cost_tracker.pyon that branch with a malicious Python payload. - A user follows the installation command in
SKILL.md. curlsaves the attacker-controlled response asagent_cost_tracker.py, potentially overwriting a local file of the same name.- The user follows the quick-start instructions and invoke ...[truncated 543 chars]
- An attacker compromises the repository, its maintainer account, or another mechanism authorized to update the
- Remediation
View remediation
Remediation Suggestions
- Remove the remote-download instruction and direct users to execute the reviewed
agent_cost_tracker.pyalready included in the skill package. - If remote installation must remain supported, use an immutable URL pinned to a specific commit rather than the mutable
mainbranch. - Publish a trusted SHA-256 digest and require verification before execution, for example with
sha256sum --check. - Prefer signed release artifacts and document signature verification.
- Download to a newly created temporary file, verify it, and only then move it into place to avoid silently overwriting an existing script.
- Ensure CI verifies that the pinned artifact is byte-for-byte identical to the packaged and audited implementation.
- Remove the remote-download instruction and direct users to execute the reviewed
