T09 · Insecure Skill Coding Practices
- Location
api-key.json:1- Finding
Committed SaleSmartly API Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is purpose-related SaleSmartly automation, but it ships exposed credentials and grants broad, under-scoped authority over customer data, business actions, local commands, and external notifications.
Review before installing. Rotate and remove the packaged API key, delete any local agent permission file such as .claude/settings.local.json, restrict API and webhook destinations to approved SaleSmartly and DingTalk hosts, and require explicit confirmation for sends, imports, assignments, session endings, device changes, scheduled jobs, and any third-party posting. Treat generated scripts as untrusted until manually reviewed.
api-key.json:1Committed SaleSmartly API Credentials
scripts/generate-query-script.py:98Remote API Documentation Is Interpolated into Executable Python Source
scripts/lib/config.py:66Configurable Base URL Can Redirect Signed Business Requests to an Untrusted Host
scripts/get-customer-history.py:158Customer PII and Message Content Can Be Posted to Arbitrary Webhook Destinations
.claude/settings.local.json:3Project-Level Agent Configuration Grants Excessive Command and Business-API Permissions
The negative-feedback alert example forwards customer identifiers, conversation references, timestamps, and message content to DingTalk with no privacy warning or minimization guidance. This is particularly risky because it exports potentially sensitive customer communications to a third-party messaging service in real time.
The FAQ states that no data is uploaded to external servers except SaleSmartly, yet the same file describes DingTalk delivery and GitHub Issue submission. This contradictory security statement can cause users to make unsafe decisions based on false assurances, undermining informed consent and risk assessment.
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
该代码块的实际作用是一个 quickstart 示例脚本:检查本地配置文件与依赖、展示使用说明、列出可用脚本。它没有展示任何对 SaleSmartly API 的真实请求逻辑,也没有实现描述中声称的核心业务操作。虽然输出中提到其他脚本名称,暗示仓库可能包含相关功能,但就当前提供的代码块本身而言,其主要目的与声明的“全功能 API 技能”明显不一致。因此应判定为描述与实际行为不匹配。
该代码块的主要目的与声明存在明显偏差。声明描述的是一个可执行多类 SaleSmartly API 业务操作的“全功能 API 技能”;而代码实际实现的是一个 intent_router.py,用于把自然语言请求映射到预定义脚本名称,并提取非常有限的参数(如 days、tags、chat_user_id)。它没有网络请求、没有 API 客户端、没有调用这些脚本、没有客户/会话/营销/WhatsApp 的实际增删改查逻辑,因此不能视为所声明的完整技能实现。虽然代码中的意图列表与声明的触发词和业务范围高度相关,但这是“路由层/辅助层”而不是“全功能 API 技能”本体。因此应判定为描述与行为不匹配。
声明描述的是一个面向终端业务能力的 SaleSmartly API 技能集合,强调已有 29 个核心脚本可用于客户、销售、消息、会话、WhatsApp 等操作,并配有大量业务触发词。实际代码却是仓库内部的辅助开发工具,用于从远程文档自动生成脚本模板。它访问的主要资源是 Apifox 文档站点和本地文件系统,核心行为是代码生成,而不是按声明执行具体的客户管理、消息发送、会话分配或统计查询功能。因此其主要目的与行为和描述不一致,属于明显的 description-behavior mismatch。
There is a clear description-behavior mismatch. The declared purpose presents an end-user operational skill for managing SaleSmartly customers, sessions, messaging, sales, and WhatsApp devices across many scripts. However, the provided code chunk is specifically an internal utility named 'check-api-updates.py' that retrieves a documentation index from Apifox, parses API identifiers, checks local script existence, and reports implemented versus missing scripts. Its network access is to the documentation host, not to execute the claimed customer/chat/WhatsApp business actions. This is not merely a supporting detail; it is a materially different primary purpose.
声明描述的是一个面向终端业务使用的 SaleSmartly API 综合技能,覆盖客户、销售、会话、消息、WhatsApp 等具体操作;而该代码块的主要职责是根据 API 文档自动生成查询脚本,属于开发/构建辅助工具。虽然它与 SaleSmartly API 生态相关,但其直接行为与声明中的用户可触发业务能力明显不一致。代码访问的资源也主要是 API 文档地址而非声明暗示的业务数据接口,并且会在本地输出新脚本文件,这属于未在描述中体现的能力。因此应判定为描述与实际行为不匹配。
The code does interact with SaleSmartly and fits loosely under 'marketing', but the declared description and triggers focus on customer management, sessions, messaging, sales, chat history, assignment, feedback, and WhatsApp/device/member statistics. This specific script's primary function is querying 分流链接 (routing/distribution links) via a marketing endpoint, which is not clearly disclosed by the description or reflected in the trigger list. The mismatch is not about malicious or extra-sensitive behavior; it is about the supplied chunk having a more specific and different operational focus than the declared capabilities.
描述强调的是面向最终用户的 SaleSmartly 全功能 API 技能,核心能力应是客户/销售/消息/会话/WhatsApp 等管理操作;而代码片段是 tests/test-intent-recognition.py,一个开发/测试用途的脚本。其主要功能是验证不同模型下的意图识别准确率:构造 prompt、调用 LLM、解析 JSON、对测试结果打分并输出报告。虽然测试用例中提到了 query-customers.py、assign-session.py、query-whatsapp-apps.py 等脚本名,但该代码并未实际调用这些业务脚本或相关业务 API。故其主用途与声明的技能能力存在实质性不一致,属于描述与行为不匹配。
The declared description presents an end-user operational SaleSmartly skill with broad business functions across customers, chats, sales, follow-up, assignment, and WhatsApp management. However, the supplied code does not implement those business operations. It is a testing script focused on validating an intent router's classification accuracy using predefined utterances mapped to expected intents. While the test cases reference the same domain and triggers, the actual behavior is evaluation/reporting infrastructure, not the claimed full-featured API skill itself. This is a materially different primary purpose, so it should be flagged as a mismatch.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
rules = {}
for intent_name, intent_data in self.intent_map.items():
rules[intent_name] = intent_data["keywords"]
return rules
def _parse_skill_triggers(self, skill_md_path: str) -> Dict[str, List[str]]:
"""
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
`--id`, `--tags` | `--id 123 --tags VIP` |
| [batch-tags.py](#batch-tagspy) | 批量打标签 | `--customer-ids`, `--tags` | `--customer-ids 1,2,3 --tags VIP` |
| [import-orders.py](#import-orderspy) | 导入订单 | `--file` | `--file orders.csv` |
### 🔵 WhatsApp 管理
| 脚本 | 功能 | 常用参数 | 示例 |
|------|------|---------|------|
| [query-whatsapp-apps.py](#query-whatsapp-appspy) | 设备列表 | 无 | - |
| [add-whatsapp-device.py](#add-whatsapp-devicepy) | 添加设备 | `--name` | `--name 客服 1` |
| [delete-whatsapp-device.py](#delete-whatsapp-devicepy) | 删除设备 | `--app-id` | `--app-id 123` |
| [get-whatsapp-qrcode.py](#get-whatsapp-qrcodepy) | 获取二维码 | `--app-id` | `--app-id 123` |
| [set-whatsapp-proxy.py](#set-whatsapp-proxypy) | 设置代理 | `--app-id`, `--proxy` | `--app-id 123 --proxy http://proxy.com` |
### 🟣 反馈与报告
| 脚本 | 功能 | 常用参数 | 示例 |
|------|------|---------|------|
| [daily-feedback-report.py
The document advertises capabilities such as DingTalk push/report delivery that are outside the stated SaleSmartly API skill scope, which can mislead users about what the skill may do with data. Scope expansion in documentation is dangerous because operators may authorize or rely on external transmissions and automations they did not expect from the manifest.
The guide promotes automated DingTalk pushes of business reports without a clear warning that business data will be transmitted to an external platform. Users may unknowingly expose operational metrics, customer-related summaries, or internal performance data outside the primary system.
Claiming Excel import capability beyond the declared scope creates a trust and control problem because users may provide bulk customer data to a skill that has not clearly disclosed such ingestion behavior. Bulk import features materially increase the amount of sensitive data exposed and should not be implied unless formally declared and documented.
Promising automatic GitHub Issue creation from chat feedback extends the skill from internal CRM/API operations into external third-party publication. This is dangerous because feedback may contain customer data, internal business details, or incident context that could be transmitted to GitHub without explicit, informed approval.
Describing AI-created scheduled tasks exceeds the declared API-skill scope and introduces unattended execution risk. Scheduled jobs can repeatedly send reports or query data without fresh user review, increasing the chance of ongoing unauthorized disclosure or operational misuse.
Unattended scheduled report pushes increase the risk of repeated external disclosure because outbound messaging can continue without per-send review. Without a warning or approval controls, users may enable persistent data transfers they do not fully understand or later forget about.
This markdown file is entirely written in Chinese and uses imperative language throughout, but it does not state that the skill is region-specific or provide any user opt-in for language/locale preference. Under the policy, forcing a specific language without user choice or documented justification is a natural-language policy violation.
The README advertises operations that can modify or delete business data and infrastructure state, such as creating/updating customers, batch tagging, importing orders, assigning/ending sessions, and deleting WhatsApp devices, without emphasizing confirmation requirements or operator safeguards. In an agent skill context, vague natural-language triggers combined with destructive actions increase the chance of unintended execution, privilege misuse, or costly operational mistakes.
The README makes a strong security claim that there is 'no dynamic code generation or download,' yet elsewhere it documents AI-driven installation via cloning and includes tooling such as generate-query-script.py and batch-generate-scripts.py. This inconsistency can mislead users and reviewers about the actual trust boundary, causing them to approve or run a skill with more code-generation and supply-chain risk than advertised.
The skill documentation describes execution of local scripts that inherently require shell, file, environment, and network access, but it does not declare any explicit tool scope or permissions. This creates an over-privileged and ambiguous execution model where an agent may invoke powerful capabilities without clear boundaries or review, increasing the chance of unsafe operations against customer data and external APIs.
The trigger list includes broad everyday terms like '客户', '销售', '分配', and '反馈', which can cause the skill to activate on loosely related conversations. In a skill that can query data, assign sessions, end sessions, or manage devices, accidental activation raises the risk of privacy exposure and unintended state-changing actions.