T07 · Tool Hijacking and Spoofing
Error
- Location
- SKILL.md:91
- Finding
- Unbundled Relative Script Entry Points Can Execute Unverified Local Code<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:91-108` - `INSTALL.md:21-29` - `README.md:18-26` **Vulnerability Type**: Unverified relative script execution **Risk Level**: High ### Vulnerable Code `SKILL.md:91-108`: ```markdown ## Project Scripts - `scripts/pbft-submit-all-condition-results.mjs` - `scripts/pbft-submit-results-from-skills-once.mjs` - `scripts/pbft-submit-real-results-1605.mjs` - `scripts/pbft-submit-real-results-c427-confirmed.mjs` - `scripts/pbft-submit-real-results-ba0c-resolved-only.mjs` - `scripts/pbft-submit-remaining-no-ba0c.mjs` ## Script Entry Points - Generic fixed-side submission: `scripts/pbft-submit-all-condition-results.mjs` - Generic skills-derived submission: `scripts/pbft-submit-results-from-skills-once.mjs` - `node scripts/pbft-submit-all-condition-results.mjs --help` - `node scripts/pbft-submit-all-condition-results.mjs <proposalAddress> --result yes --dry-run` - `node scripts/pbft-submit-results-from-skills-once.mjs --help` - `node scripts/pbft-submit-results-from-skills-once.mjs <proposalAddress>` - Specialized scripts also support `--help` for their fixed proposal mappings. ``` `INSTALL.md:21-29`: ```markdown ## Post-install check If the local project scripts are available, verify the public entrypoints first: ```bash node scripts/pbft-submit-results-from-skills-once.mjs --help node scripts/pbft-submit-all-condition-results.mjs --help node scripts/pbft-submit-all-condition-results.mjs <proposalAddress> --result yes --dry-run ``` Restart the agent runtime after installation. ``` `README.md:18-26`: ```markdown Script entry: - `scripts/pbft-submit-results-from-skills-once.mjs` - `scripts/pbft-submit-all-condition-results.mjs` - `node scripts/pbft-submit-results-from-skills-once.mjs --help` - `node scripts/pbft-submit-results-from-skills-once.mjs <proposalAddress>` - `node scripts/pbft-submit-all-condition-results.mjs <proposalAddress> --result yes --dry-run` ``` ### Technical Analysis The aud ...[truncated 3027 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Bundle all required scripts** - Include every supported script in the published skill package. - Remove references to specialized scripts that are not distributed and reviewed. 2. **Resolve scripts from a trusted installation directory** - Determine the canonical skill directory at runtime. - Invoke scripts using a canonical absolute path under that directory. - Do not resolve transaction entry points against an arbitrary current working directory. 3. **Verify integrity before execution** - Publish cryptographic hashes or signed manifests for executable files. - Verify script integrity immediately before execution. - Abort when a script is missing, replaced, symlinked outside the trusted directory, or fails verification. 4. **Pin external source material** - If scripts must come from the referenced repository, pin an immutable commit identifier rather than a mutable branch. - Verify the downloaded artifact against a trusted digest or signature. - Do not automatically execute newly downloaded code. 5. **Apply transaction-specific safeguards** - Validate the chain ID and require an explicit contract allowlist. - Validate proposal and condition addresses using the expected address format. - Display the signer, chain, destination contract, result mapping, calldata, and expected fees before signing. - Require explicit user confirmation before broadcasting any non-dry-run transaction. - Preserve evidence, generated calldata, and transaction hashes in an audit log. 6. **Use least privilege** - Run evidence collection without access to signing keys. - Isolate transaction signing in a narrowly scoped component. - Avoid exposing seed phrases or raw private keys to the Node.js process. - Restrict filesystem and network access to what is necessary for the operation. 7. **Fail closed** - Do not fall back to similarly named local scripts. - If the verified implementa ...[truncated 137 chars]
