Back to skill

Security audit

X-ray

Security checks for vulnerabilities and agentic risk

Overview

This is a mostly coherent project-scanning skill, but its generated HTML report can include unescaped repository-derived content.

Review before installing if you plan to scan untrusted repositories. Use it only on an intended project path, avoid sensitive workspaces unless you are comfortable with a file inventory being generated, and be cautious opening the generated HTML report until the renderer escapes HTML or adds a restrictive Content Security Policy.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/render_report.py:38
Finding

Unescaped Report Data Allows Stored HTML Injection

Content
View full analysis
{item['path']} —— " f"{item['reason']}" ) # Replace placeholders in the HTML template template = template.replace( "{{PROJECT_NAME}}", project["project_name"] ) template = template.replace( "{{TOTAL_FILES}}", str(project["total_files"]) ) template = template.replace( "{{TOTAL_DIRECTORIES}}", str(project["total_directories"]) ) template = template.replace( "{{COMPLEXITY_SCORE}}", str(complexity["score"]) ) template = template.replace( "{{TECH_STACK}}", tech_stack ) template = template.replace( "{{KEY_FILES}}", key_files_text ) ``` ```python output_path.write_text( template, encoding="utf-8" ) ``` ### Technical Analysis The report renderer loads values from a caller-selected JSON file and inserts them directly into an HTML template without HTML escaping or schema validation. Affected values include: - `project["project_name"]` - Entries in `stack["technology_stack"]` - `item["path"]` - `item["reason"]` Because these values are inserted into HTML text and markup contexts verbatim, a crafted value containing elements such as `
Remediation
View remediation
{path} —— {reason}" ``` 2. Prefer an auto-escaping template engine rather than manual `str.replace()` operations. Ensure auto-escaping is enabled for HTML templates. 3. Validate the input JSON against a strict schema: - Require expected objects and arrays. - Enforce primitive field types. - Reject unexpected properties where appropriate. - Set reasonable length limits. 4. Treat all repository-derived values, including directory and file names, as untrusted input. 5. Add a restrictive Content Security Policy to the report template, for example: ```html ``` 6. Add regression tests using payloads containing HTML elements, event-handler attributes, quotes, and encoded markup. Verify that the generated report displays these values as literal text and does not create executable DOM elements. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个较全面的陌生项目扫描与理解工具,涵盖项目类型、技术栈、架构、文件结构、复杂度和学习价值等多维分析。但实际代码行为非常有限:它只读取目标目录下若干常见清单文件是否存在,并解析 package.json 的 dependencies/devDependencies 来推断部分技术栈,然后输出 technology_stack。代码没有遍历分析项目结构、没有评估架构或复杂度、没有判断学习价值,也没有对项目类型进行更高层次识别。因此,实际行为仅覆盖声明中的一小部分(且是简化版技术栈检测),与声明的主要用途存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

代码确实执行了对代码仓库的基础扫描,并能部分反映技术栈(通过文件后缀统计语言)和文件结构(输出文件列表、目录数)。但声明中承诺的核心能力范围更广,包括识别项目类型、架构、复杂度和学习价值;这些能力在代码中均未体现。代码的实际功能更接近“基础仓库清点/语言统计器”,而不是完整的陌生项目快速分析器。未发现额外的敏感或越权能力,但描述明显夸大了实现范围,因此属于描述与行为不一致。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to read project files and generate an HTML report, which implies file read/write capability, but it does not declare any explicit tool scope such as allowed-tools or permissions. In a security-sensitive agent environment, missing scope boundaries increases the chance of broader-than-necessary filesystem access and makes it harder to enforce least privilege.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire natural-language description and operating instructions are written only in Chinese, with no indication that the user can choose another language or locale. This can violate language/locale policy where skills must not force a specific language absent user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation criteria are broad and underspecified: 'analyze the current software project' could trigger on many repositories without user confirmation of scope, output location, or sensitivity level. In combination with project scanning and file reading, ambiguous triggering can lead to unintended analysis of sensitive codebases or generation of reports from data the user did not mean to process.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file is entirely written as Chinese-language operating instructions, with no indication that the user may choose another language or that the skill is intentionally limited to Chinese-speaking users. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The string values in KEY_FILE_RULES are user-facing natural-language descriptions written entirely in Chinese, such as "项目说明" and "容器部署". Because the file does not indicate that the skill is region-specific or provide any user opt-in for language selection, it appears to impose a specific language/locale by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template explicitly sets the document language to zh-CN and uses Chinese labels throughout the report, which imposes a specific language/locale on all users. The file does not indicate any user opt-in, language selection, or documented region-specific justification for this constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script emits natural-language classification values such as "简单" and "非常复杂" directly in Chinese. This is a language-policy concern because the tool does not provide a locale choice or explain why output is restricted to Chinese.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The usage message is hard-coded in Chinese, which imposes a specific language on users. The file also returns Chinese complexity labels later, with no indication that the tool is region-specific or that users can opt into another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file contains a natural-language comment in Chinese ('去重,同时保持顺序') while the rest of the file is in English, which effectively imposes a language assumption on readers without opt-in or justification. The policy specifically allows locale constraints only when documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code contains natural-language comments and a printed status message in Chinese only, with no indication that the skill is China-specific or that users can choose a language. That can violate a language/locale policy requiring user opt-in or documented justification for a fixed locale.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes the skill as quickly identifying project type, stack, architecture, file structure, complexity, and learning value for understanding an unfamiliar repository. In this file, the skill persists results to xray-data.json, which is behavior beyond pure scanning/inspection and is not indicated in the description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script prints status messages in Chinese only, which imposes a specific language on all users. The file provides no option to select locale and no documented reason that the tool is intended solely for a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.