T09 · Insecure Skill Coding Practices
- Location
scripts/beam_transfer.py:386- Finding
Destructive and Billable Transfer Operations Lack Enforced User Confirmation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/beam_transfer.py:386-390, 507-511, 565-592; related authorization requirements inSKILL.md:171-187, 205-210
Vulnerability Type: Unenforced authorization for destructive and billable operations
Risk Level: MediumVulnerable Code
python prepared = await beam.transfers.create_transfer( sources=[spec.source_model], destinations=spec.destination_models, name=args.name, )python async def cmd_cancel(args: argparse.Namespace) -> int: api_key = require_api_key() async with beam_client(api_key) as beam: result = await beam.transfers.cancel(args.transfer_id) emit("cancel", transfer_id=args.transfer_id, success=result.success, message=result.message) return EXIT_OK if result.success else EXIT_FAILEDpython run = commands.add_parser("run", help="Create a transfer and wait for it to finish") endpoints(run) run.add_argument("--name", help="Transfer name shown in the Console") run.add_argument( "--timeout", type=positive_seconds, default=21600.0, help="Seconds to wait (default 21600)" ) run.add_argument( "--progress-interval", type=positive_seconds, default=30.0, help="Seconds between progress events (default 30)", ) run.add_argument("--hf-commit-message", help="Commit summary for hf:// destinations") run.add_argument( "--hf-create-pr", action="store_true", help="Open hf:// uploads as a pull request" ) run.add_argument( "--hf-allow-source-rehash", action="store_true", help="Let the SDK read the source once to hash it; required to upload a non-Hub source to hf://", ) run.add_argument( "--dry-run", action="store_true", help="Validate URIs and credentials without contacting anything", ) status = commands.add_parser("status", help="Read a transfer from the Beam API") status.add_argument("transfer_id") cancel = commands.add_parser("cancel", help="Cancel a transfer") cancel.add_argument("transfer_id")The ...[truncated 3435 chars]
- Remediation
View remediation
Remediation Suggestions
- Require an explicit confirmation artifact for live transfers and cancellations rather than relying solely on documentation.
- Have
estimateor--dry-rungenerate a short-lived, cryptographically random approval identifier bound to:- The exact source URI.
- Every destination URI.
- The transfer name and relevant options.
- The estimated size and credit cost.
- The intended operation and expiration time.
- Require
runto receive that approval identifier and reject execution if any bound parameter has changed. - Require
cancelto use a separate confirmation artifact bound to the exact transfer ID. - For interactive use, prompt for confirmation by default after displaying overwrite and cost information.
- Provide a non-interactive override only for trusted automation, with an explicit option such as
--approved-non-interactive, and require the orchestrator to record the corresponding user approval. - Prefer fail-closed behavior: if approval cannot be verified, do not create or cancel the transfer.
- Log approval metadata without recording API keys, storage credentials, invitation tokens, or other secrets.
