Back to skill

Security audit

tencentcloud-trtccopilot-sdk-log-analysis

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local SDK log-analysis skill with a localhost preview server, with one dependency fallback that users should treat cautiously.

Install only if you are comfortable letting the skill read the specific logs you provide and expose decoded log contents through a localhost-only viewer. Prefer the vendored decoder path, avoid setting CLOG_DECODER_BIN, CLOG_DECODER_PACKAGE, or CLOG_DECODER_REGISTRY unless you trust them, and stop the preview server when finished.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
scripts/lib/decoder.js:27
Finding
Unpinned Remote Package Download and Execution via npx Fallback## Vulnerability Details **File Location**: `scripts/lib/decoder.js`, lines 27–49 **Vulnerability Type**: Unpinned dependency retrieval and execution **Risk Level**: Medium ### Vulnerable Code ```js const args = ['--yes']; if (env.CLOG_DECODER_REGISTRY) args.push('--registry', env.CLOG_DECODER_REGISTRY); args.push(env.CLOG_DECODER_PACKAGE || DEFAULT_PUBLIC_PACKAGE); return { mode: 'npx', command: 'npx', args, description: 'npm decoder fallback', }; } export function decodeFile(inputPath, outputPath, { skillDir, env = process.env, timeoutMs } = {}) { const resolved = resolveDecoderCommand({ skillDir, env }); const result = spawnSync(resolved.command, [...resolved.args, inputPath, outputPath], { env, encoding: 'utf-8', timeout: timeoutMs, }); ``` The fallback is reached from `scripts/analyze-local.js`, lines 172–174: ```js if (inputBinary) { const decodedPath = path.join(runDir, `${path.basename(inputPath)}.log`); decoded = decodeFile(inputPath, decodedPath, { skillDir: SKILL_DIR, timeoutMs: decodeTimeoutMs }); textLogPath = decodedPath; } ``` ### Technical Analysis The decoder resolver expects a vendored executable at `vendor/clog-decoder/dist/cjs/node/cli.js`. The audited project structure does not contain that file; the vendored directory only includes `package.json`. Consequently, analysis of a binary `.clog`, `.xlog`, or other file detected as binary reaches the `npx` fallback. The fallback invokes: ```text npx --yes @tencent/sdk-log-decoder ``` No exact package version or package-integrity digest is specified. The effective executable can therefore change after the Skill has been reviewed. In addition, the inherited `CLOG_DECODER_PACKAGE` and `CLOG_DECODER_REGISTRY` environment variables can replace the package name and registry without source-code changes. `npx` installs and executes the selected package. This crosses a security boundary from processing untrusted log data to executing remotely retrieved dependency ...[truncated 1681 chars]
Remediation
## Remediation Suggestions 1. Include the documented vendored decoder entry point at `vendor/clog-decoder/dist/cjs/node/cli.js` and fail closed if that trusted artifact is missing. 2. Verify the vendored decoder against a maintained cryptographic checksum before execution. 3. If remote fallback must remain available, pin an exact immutable package version rather than resolving the latest package: ```js const DEFAULT_PUBLIC_PACKAGE = '@tencent/sdk-log-decoder@1.0.0'; ``` 4. Enforce package integrity through a lockfile or explicit integrity verification and use a fixed, trusted registry. 5. Do not inherit `CLOG_DECODER_PACKAGE` or `CLOG_DECODER_REGISTRY` by default. Permit overrides only through an explicit trusted configuration mechanism with strict allowlists. 6. Require explicit user authorization before downloading or executing a decoder that is not bundled with the Skill. 7. Run any downloaded decoder in a restricted subprocess or sandbox with minimal filesystem access, a sanitized environment, no unnecessary credentials, and blocked outbound network access. 8. Log the selected decoder mode, exact package version, registry, and verified digest to the analysis manifest for auditability.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (134)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
声明描述的是一个较完整的日志分析与预览 skill,而当前代码仅实现了一个辅助性质的 evidence 导出脚本:解析 --lines 参数、读取本地文本文件、抽取指定行及上下文,并以安全 Markdown 代码块输出。它没有展示 .clog/.xlog 类型识别、二进制解码、时间线分析或 Web 服务相关行为。虽然读取本地日志文件与“日志分析”大方向相关,但该片段的实际功能与声明中的核心能力明显不一致,属于材料性描述不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared purpose is a log analysis and local web preview tool for SDK client logs. However, the supplied code chunk does not analyze logs, decode binary formats, parse timelines, or serve preview content. It only performs HTML minification as a template/build helper in Node.js. While such code could be a supporting implementation detail for a web UI, this isolated chunk is generic template tooling and does not reflect the declared primary functionality. Therefore this chunk is a description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose is a specialized local log analysis and web preview skill for SDK client logs. The supplied code chunk does not implement log recognition, binary log decoding, timeline parsing, or a web preview server. Instead, it configures a generic template compiler/runtime used for rendering templates. While a web preview feature in the broader skill might legitimately depend on a template library, this chunk itself is unrelated support code from a third-party templating package and does not reflect the declared primary functionality. Therefore, this code chunk materially differs from the declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
声明描述聚焦于本地日志分析与 Web 预览,而实际代码并未实现任何日志文件识别、二进制日志解码、TRTC/IM/TUI 时间线解析或日志预览逻辑。相反,这段代码是一个通用模板引擎编译器的实现,属于前端/服务端渲染基础设施。虽然模板引擎可能作为 Web 预览的底层依赖存在,但就该代码块本身而言,其直接功能与日志分析的声明用途不一致,因此应判定为描述与行为不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared skill is focused on local log analysis and web preview for SDK client logs. The supplied code instead implements a low-level tokenizer for a templating engine, converting template text into tokens based on regex rules and recording source positions. This is not log-analysis logic, binary decoding, or timeline parsing. While such a library could be used as incidental infrastructure for a web UI, the code chunk itself has a materially different purpose and exposes unrelated capability (template compilation support) that is not represented in the description. Therefore this chunk does not accurately match the declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description is for a specialized SDK client log analysis skill with web preview features. The supplied code chunk is a minimal module export wrapper from a third-party template library (`art-template`) and, by itself, does not exhibit the claimed purpose or capabilities. While this could be a supporting dependency within a larger project, evaluating this chunk alone shows behavior unrelated to the declared primary purpose, so it should be flagged as a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose is focused on local log analysis and web preview for SDK client logs. The supplied code does not perform log parsing, decoding, timeline analysis, file handling, or web preview serving. Instead, it exposes a general-purpose template engine interface for compiling and rendering templates. While such a library could be a supporting dependency for a web preview UI, this specific code chunk's behavior is not representative of the declared skill functionality and reflects an unrelated capability at the code level.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description is about local log analysis and a web preview service for SDK client logs. The supplied code does not analyze logs, decode binary log formats, parse TRTC/IM/TUI timelines, or serve a web preview. Instead, it is a vendor library implementing template precompilation using acorn/escodegen/estraverse and source-map utilities. This is a materially different primary purpose and introduces undeclared capabilities related to template compilation and code transformation, so the description does not accurately represent this code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description is for a specialized SDK client log analysis skill with web preview features. The supplied code chunk is a minimal vendor library entry point that simply exports another module from an art-template runtime. Based on this chunk alone, the actual behavior is unrelated to the declared purpose and provides none of the described capabilities. Therefore, this is a description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
该代码块的核心能力与声明中的一部分相符:它确实对本地 .clog/.xlog/文本日志进行类型判断,并对 clog/xlog 二进制内容进行解码,尤其是 TRTC/xlog 相关帧和压缩载荷的处理。但声明还包含两个重要能力:1)‘TRTC/IM/TUI 客户端日志时间线解析’,而代码中只看到 clog/xlog 解码与简单帧顺序检查,没有 IM/TUI 专项解析或时间线构建逻辑;2)‘本地日志 Web 预览服务’,代码中没有 HTTP 服务器、Web UI、静态资源服务或浏览器预览相关实现。实际代码主要是命令行解码工具,输入文件/目录,输出 .log 文件。因此描述夸大了实现范围,存在实质性不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description is specifically about SDK client log analysis and local web preview for .clog/.xlog/text logs. However, this code chunk is clearly a generic Monaco editor worker asset. It manages in-memory text models and provides standard editor operations such as computing diffs, finding words, validating positions/ranges, link detection, and suggestion generation. There is no evidence in this snippet of log format recognition, binary decoding, TRTC/IM/TUI timeline parsing, or serving/rendering a local log preview. While a web preview feature could internally use an editor component, this chunk’s behavior is generic editor infrastructure and does not match the declared specialized log-analysis functionality.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared purpose is specifically about local log analysis and web preview for SDK client logs. However, this code chunk does not show log-format recognition, .clog/.xlog decoding, timeline parsing for TRTC/IM/TUI logs, or logic specific to log analysis. Instead, it contains generic bundled viewer/editor infrastructure consistent with Monaco or similar text editing/viewing components. While such editor utilities could support a web preview UI, the chunk’s actual primary behavior is unrelated low-level text editing and analysis support rather than log-analysis functionality itself. Therefore, for this supplied code chunk, the description does not accurately represent what the code actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The code shown does not implement log-type recognition, binary log decoding, TRTC/IM/TUI timeline parsing, or a web preview service specific to logs. Instead, it is generic editor UI infrastructure from a bundled web asset, likely for displaying text in a browser. While a web preview for logs might reasonably include a text editor/viewer component, this chunk’s actual behavior is purely low-level editor interaction/rendering logic and does not substantively reflect the declared primary purpose of log analysis. Therefore, this code chunk is behaviorally mismatched relative to the description.

Ae1

High
Category
analysis-evasion
Content
- references/trtc-analysis-playbook.md
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- references/trtc-analysis-playbook.md
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- references/trtc-analysis-playbook.md
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
本版本包含 `viewer/` 静态页面与 `scripts/serve-viewer.js` 本地预览服务,适用于 WorkBuddy / 本地 CodeBuddy 等可访问 `127.0.0.1` 端口的平台。若 Agent 平台无法访问本地端口或不允许常驻服务,请改用 `sdk-log-analysis-no-p
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
本版本包含 `viewer/` 静态页面与 `scripts/serve-viewer.js` 本地预览服务,适用于 WorkBuddy / 本地 CodeBuddy 等可访问 `127.0.0.1` 端口的平台。若 Agent 平台无法访问本地端口或不允许常驻服务,请改用 `sdk-log-analysis-no-p
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
本版本包含 `viewer/` 静态页面与 `scripts/serve-viewer.js` 本地预览服务,适用于 WorkBuddy / 本地 CodeBuddy 等可访问 `127.0.0.1` 端口的平台。若 Agent 平台无法访问本地端口或不允许常驻服务,请改用 `sdk-log-analysis-no-p
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
本版本包含 `viewer/` 静态页面与 `scripts/serve-viewer.js` 本地预览服务,适用于 WorkBuddy / 本地 CodeBuddy 等可访问 `127.0.0.1` 端口的平台。若 Agent 平台无法访问本地端口或不允许常驻服务,请改用 `sdk-log-analysis-no-p
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
本版本包含 `viewer/` 静态页面与 `scripts/serve-viewer.js` 本地预览服务,适用于 WorkBuddy / 本地 CodeBuddy 等可访问 `127.0.0.1` 端口的平台。若 Agent 平台无法访问本地端口或不允许常驻服务,请改用 `sdk-log-analysis-no-p
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
本版本包含 `viewer/` 静态页面与 `scripts/serve-viewer.js` 本地预览服务,适用于 WorkBuddy / 本地 CodeBuddy 等可访问 `127.0.0.1` 端口的平台。若 Agent 平台无法访问本地端口或不允许常驻服务,请改用 `sdk-log-analysis-no-p
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/analyze-local.js \
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/analyze-local.js \
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/analyze-local.js \
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Static analysis

Detected: suspicious.dangerous_exec, suspicious.dynamic_code_execution, suspicious.install_untrusted_source

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/analyze-local.js:123

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/lib/decoder.js:48

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/serve-viewer.js:276

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
vendor/art-template/lib/compile/compiler.js:314

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
vendor/art-template/lib/template-web.js:2

Install source points to URL shortener or raw IP.

Warn
Code
suspicious.install_untrusted_source
Location
data/api/log-rule.json:4210