T09 · Insecure Skill Coding Practices
- Location
initiate_audit.py:654- Finding
Dry-run mode performs remote API submissions despite claiming no data is submitted
- Content
View full analysis
Vulnerability Details
File Location:
initiate_audit.py, lines 654–695
Vulnerability Type: Privacy-control bypass caused by incorrect dry-run sequencing
Risk Level: MediumComplete Code Snippet
python session = client.initiate_audit( agent_name=agent_name, platform=platform, public_key=keys['public_key'], agent_version=version ) audit_id = session.get('audit_id') challenge = session.get('challenge') print(f"✓ Audit initiated: {audit_id}") # Step 3: Complete challenge (using client) print(f"\n🔑 Authenticating...") try: # Sign challenge locally signature = sign_challenge(keys['private_key'], challenge) # Submit via client (maintains session) auth_result = client.complete_challenge(audit_id, signature) print(f"✓ Authentication successful") except Exception as e: print(f"✗ Authentication failed: {e}") sys.exit(1) # Step 4: Run security tests print(f"\n🧪 Running security tests...") test_results = run_security_tests(audit_id, system_prompt=args.system_prompt) # DRY-RUN MODE: Show what would be submitted, then exit if args.dry_run: print("\n" + "="*70) print("🔍 DRY RUN MODE - NO DATA WILL BE SUBMITTED")Technical Analysis
The
--dry-runcondition is evaluated only after the client initiates and authenticates a remote audit. Before reaching the condition, the program:- Calls
client.initiate_audit(), which sends the agent name, platform, optional version, and public key to the configured API. - Receives a remote challenge.
- Signs that challenge with the locally stored private key.
- Calls
client.complete_challenge(), sending the audit identifier and signature to the API.
This conflicts with the displayed claim that no data will be submitted and with the documented purpose of dry-run as a way to inspect the payload before making an API call.
The private key itself is not transmitted, and the detailed security-test results are not submitted on this path. The issue i ...[truncated 1726 chars]
- Calls
- Remediation
View remediation
Remediation Suggestions
- Check
args.dry_runbefore creating remote audit state or invoking any network-capable client method. - In dry-run mode, construct a local preview using a placeholder audit identifier and run the local tests without calling
initiate_audit()orcomplete_challenge(). - Refactor the workflow into separate local-preview and remote-submission functions so the dry-run path cannot accidentally share network side effects.
- Add automated tests that replace the HTTP session with a failing mock and assert that zero requests occur when
--dry-runis set. - Update the displayed and documented guarantees if any network connectivity is intentionally retained. If a connectivity check is desired, expose it through a separate, explicitly named option requiring informed user choice.
- Check
