T09 · Insecure Skill Coding Practices
- Location
scripts/company_list_search.py:27- Finding
Billable API operations do not enforce explicit user confirmation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/company_list_search.py:27-33, 109-114; equivalent billable request paths exist inscripts/trade_list_search.py:27-33, 104-109,scripts/company_get_contact.py:16-24, 42-49, andscripts/company_get_details.py:16-22, 40-47
Vulnerability Type: Missing authorization gate for fee-incurring operations
Risk Level: MediumComplete Code Snippets
scripts/company_list_search.py:27-33:python request_params = params.copy() if cursor: request_params['cursor'] = cursor # 不传 cursor 表示首次请求 # 发起API请求 response = make_request('/agent/customs/company/list', request_params)scripts/company_list_search.py:109-114:python while total_retrieved < args.query_count: try: # 搜索当前批次 response = search_company_list(params, current_cursor)scripts/trade_list_search.py:27-33:python request_params = params.copy() if cursor: request_params['cursor'] = cursor # 不传 cursor 表示首次请求 # 发起API请求 response = make_request('/agent/customs/trade/list', request_params)scripts/company_get_contact.py:16-24:python params = { 'companyIds': company_ids } response = make_request('/agent/customs/company/contact/batch', params) return responsescripts/company_get_details.py:16-22:python params = {'companyIds': company_ids} response = make_request('/agent/customs/company/detail/batch', params) return responseTechnical Analysis
SKILL.md:120-128establishes an authorization boundary requiring the Skill to inform the user about fees and wait for explicit confirmation in a separate message before performing any fee-incurring operation. The executable scripts do not enforce that boundary.The search entry points immediately issue authenticated API requests and may repeat them in a loop until
query_countrecords have been requested. The contact and detail entry po ...[truncated 1857 chars]- Remediation
View remediation
Remediation Suggestions
- Add a mandatory confirmation mechanism to every billable executable path, such as
--confirm-fee, and reject execution when it is absent. - Bind confirmation to the exact operation, requested record or ID count, expected number of API calls, current pricing, and a short expiration period. A generic reusable flag should not authorize unrelated future requests.
- Implement a dry-run mode that calculates and displays the expected call count and fee before any authenticated request is sent.
- Require fresh confirmation before continuation calls using
--task_id, additional cursor batches, or any change to the original parameters. - Apply the same enforcement to company contact and detail requests, including single-ID requests if all API calls incur fees as documented.
- Enforce a configurable maximum charge or call count per confirmed operation and stop when the approved limit is reached.
- Keep the documentation-level confirmation instructions, but treat them as supplementary guidance rather than the sole authorization control.
- Add a mandatory confirmation mechanism to every billable executable path, such as
