T09 · Insecure Skill Coding Practices
- Location
scripts/cw_client.cjs:17- Finding
Hardcoded Shared API Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This diagramming skill is mostly purpose-aligned, but it sends diagram content to a fixed remote service and has unsafe local file-writing and credential practices that warrant review before installation.
Review this before installing if your diagrams may include proprietary systems, code structure, customer workflows, or secrets. The skill uploads selected diagram/request content to https://pptx.chenxitech.site, may use a bundled shared API key, and writes returned diagram code locally. Use only in a workspace where remote processing is acceptable, prefer your own API key, and avoid running the included E2E test or trusting backend-returned filenames until the path and command-injection issues are fixed.
scripts/cw_client.cjs:17Hardcoded Shared API Credential
scripts/generate_contextweave.cjs:89Server-Controlled Path Traversal in Generated CW Output
scripts/edit_contextweave.cjs:67Server-Controlled Path Traversal in Edited CW Output
scripts/test_link_e2e.cjs:13Shell Command Injection Through Backend-Controlled Session Identifier
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
- **特殊场景(导入已有文件)**:当用户在输入中明确提供了现成的绘图文件(如 `.cw`)并要求导入或绘图时,**禁止**重新生成结构化意图文件或调用 `generate_contextweave.cjs`,也**禁止**仅以文本形式输出命令,必须直接使用工具调用 `node scripts/import_cont
Referenced artifact was not completely inspected
2. **第二步(属性注入)**:在用户确认生成的结构满足预期后,发起第二次编辑调用(使用 `edit_contextweave.cjs`),明确指示“请为图中的某某节点添加对应的 `link: <绝对文件路径>` 属性”。这种做法可利用后端的精确路由,将链接修改任务交由更适合处理结构化属性的工具完成。
Referenced artifact was not completely inspected
2. **第二步(属性注入)**:在用户确认生成的结构满足预期后,发起第二次编辑调用(使用 `edit_contextweave.cjs`),明确指示“请为图中的某某节点添加对应的 `link: <绝对文件路径>` 属性”。这种做法可利用后端的精确路由,将链接修改任务交由更适合处理结构化属性的工具完成。
Referenced artifact was not completely inspected
2. **第二步(属性注入)**:在用户确认生成的结构满足预期后,发起第二次编辑调用(使用 `edit_contextweave.cjs`),明确指示“请为图中的某某节点添加对应的 `link: <绝对文件路径>` 属性”。这种做法可利用后端的精确路由,将链接修改任务交由更适合处理结构化属性的工具完成。
Referenced artifact was not completely inspected
- `scripts/cw_client.cjs`:用于统一后端请求与响应适配;承载鉴权、错误归一和返回结构解析
The client embeds a fallback API key directly in source code and automatically uses it when the environment variable is absent. This exposes a reusable credential to anyone with code access and enables unauthorized use of the remote service under the vendor's account, creating both abuse risk and hidden outbound authenticated access.
The manifest description is written entirely in Chinese and the document provides no indication that users may choose another language or locale. This creates a natural-language policy issue because the skill appears to impose a specific language experience without documented opt-in or justification.
The skill documents automatic local persistence of generated cw_code into <session_id>.cw files, but this write behavior is not clearly disclosed in the main description. Silent local writes can leave sensitive architecture data on disk unexpectedly, increasing exposure to other local users, backup systems, or later unintended sharing.
The skill explicitly supports exporting or recovering stored CW code by session ID, which expands its capability from diagram generation into retrieval of previously stored server-side content. If session IDs are exposed, guessed, or reused across contexts, this can enable unauthorized access to prior diagram data that may contain sensitive architecture or business information.
The skill states that it sends drawing data and API credentials to a hard-coded remote server, while this network behavior is not clearly disclosed in the top-level description. This creates a material data exfiltration risk because user-provided architecture diagrams, file-derived content, and credentials are transmitted to an external service outside the local environment.
Network transmission of drawing data and API credentials to an external server is only disclosed deep in the skill body rather than prominently in the top-level description. Because the skill can process architecture and workflow information, insufficient disclosure materially increases the risk of users unknowingly sending sensitive internal data to a third party.
Several recovery hints and error messages are hardcoded in Chinese, including messages like '内部错误: 基础URL缺失' and '请使用官方域名', with no indication that the user can choose language or locale. This creates a language policy concern because the skill imposes a specific language for user-facing output without opt-in or documented locale scope.
The request method sends payloads containing user input and, in other code paths, local file contents to an external host. The skill description emphasizes diagram generation but does not clearly disclose that data is transmitted off-host to third-party infrastructure, which creates a privacy and data-handling risk for sensitive prompts or documents.
When an input file is provided, the code reads its contents and places them into payload.user_request and payload.initial_cw_code for remote submission. This can exfiltrate confidential local material to the external service without a clearly stated disclosure in the skill metadata, which is especially risky in an agent environment that may process proprietary documents.
This flow packages file-derived content and user request data and transmits it to the remote /run endpoint without any user-facing warning in the code path. In the context of a diagramming skill, this is dangerous because users may assume local transformation while sensitive architecture, code, or business-process details are actually sent to a third-party service.
The importCode path reads diagram.cw from the local filesystem and sends its contents to /session/import on the remote service without presenting any warning or disclosure. Even if the file is 'just diagram code,' it may encode proprietary architecture or business logic, so silent upload is a real confidentiality concern.
The error message and recovery hint are hard-coded in Chinese, which imposes a specific language on users without offering a choice or documenting a locale-specific constraint. This is a natural-language policy issue because the skill does not provide language selection or opt-in.
The missing-arguments message and recovery hint are presented only in Chinese, forcing a locale choice on all users. The file does not indicate that this is a region-specific tool or offer any language opt-in.
Detected: suspicious.dangerous_exec