Back to skill

Security audit

Cmdb Query

Security checks for vulnerabilities and agentic risk

Overview

This CMDB query skill matches its stated purpose, but it exposes reusable credentials, disables TLS checks, and can query sensitive internal asset models.

Do not install this skill as published unless the CMDB password has been rotated and removed, TLS verification is fixed with a trusted internal CA, and the skill is restricted to approved non-sensitive resource labels and safe output fields. Treat the exposed credential as compromised.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
lib/query.py:16
Finding
Hard-Coded Shared CMDB Credentials<![CDATA[ ## Vulnerability Details **File Location**: `lib/query.py:16-19`; duplicated in `SKILL.md:14-18` **Vulnerability Type**: Hard-coded plaintext credentials **Risk Level**: High ### Vulnerable Code ```python # 配置 BASE_URL = "https://10.255.227.233/cmdb/v1/api" USERNAME = "openclaw_read" PASSWORD = "JzXCxTaDxE" ``` The same credentials are also disclosed in the Skill documentation: ```markdown ## 认证方式 通过 username/password 获取 Token,Token 有效期 8 小时。 - **登录接口**: `POST /cmdb/v1/api/oauth/token` - **用户名**: `openclaw_read` - **密码**: `JzXCxTaDxE` ``` ### Technical Analysis A reusable CMDB username and password are stored directly in both executable source code and documentation. Any person or system able to obtain the Skill package can recover the credentials without additional privileges. The credentials are submitted to the token endpoint to obtain an authentication token valid for eight hours. Because the account is shared and the secret is bundled with the Skill, access cannot be reliably attributed to an individual user. Repository history, package mirrors, backups, logs, and prior distributed copies may continue to expose the password even after it is removed from the current files. ### Attack Path 1. An attacker obtains a copy of the Skill package or reads its source. 2. The attacker extracts the `openclaw_read` username and plaintext password. 3. From a system with network access to the internal CMDB, the attacker sends the credentials to `/cmdb/v1/api/oauth/token`. 4. The attacker receives an eight-hour token. 5. The token is used to query asset models available to the shared account. 6. The attacker enumerates sensitive infrastructure records within the account's server-side permissions. ### Impact Assessment Successful exploitation can grant unauthorized access to the CMDB data readable by the shared account. Potentially exposed information includes host inventories, internal addresses, applications, databases, network resources, security g ...[truncated 437 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Immediately revoke and rotate the exposed CMDB password. Treat it as compromised because it appears in distributed Skill content. 2. Remove the username and password from source code, documentation, examples, repository history, release artifacts, and cached package copies. 3. Retrieve credentials at runtime from an approved secret manager or protected environment variables. 4. Prefer short-lived, workload-specific credentials over a shared static password. 5. Assign a separate service identity to this Skill and restrict it to explicitly approved asset models and fields. 6. Add automated secret scanning to development and release pipelines. 7. Review CMDB authentication and query logs for use of the exposed account from unexpected systems or at unexpected times. 8. Ensure exceptions and diagnostic output never include passwords, tokens, or complete authentication responses. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
lib/query.py:35
Finding
TLS Certificate Verification Disabled for Authentication and CMDB Queries<![CDATA[ ## Vulnerability Details **File Location**: `lib/query.py:35-40`, `lib/query.py:89-96`, and `lib/query.py:113-119` **Vulnerability Type**: Improper certificate validation **Risk Level**: High ### Vulnerable Code Authentication request: ```python # 注意:这个 API 需要跳过证书验证 response = requests.post( url, json=data, verify=False, # 跳过证书验证 timeout=30 ) ``` Authenticated resource query: ```python # 注意:跳过证书验证 response = requests.post( url, json=body, params=params, headers=headers, verify=False, # 跳过证书验证 timeout=60 ) ``` Authenticated model query: ```python response = requests.post( url, json={}, headers=headers, verify=False, timeout=30 ) ``` ### Technical Analysis Every network request explicitly sets `verify=False`, disabling TLS certificate and identity validation. Encryption without server authentication does not establish that the destination is the legitimate CMDB. This is especially dangerous for the token endpoint because the static username and password are transmitted in the request body. Authenticated CMDB requests also carry the eight-hour token in the `Authorization` header and may return sensitive infrastructure records. Use of a raw IP address can complicate certificate hostname verification, but disabling verification is not a safe workaround. The endpoint should use a certificate whose subject alternative names match the configured hostname or IP, chained to an approved internal certificate authority. ### Attack Path 1. An attacker obtains an on-path network position, compromises routing or DNS-related infrastructure, controls a proxy, or gains access to the relevant network segment. 2. The attacker redirects or intercepts traffic intended for `10.255.227.233`. 3. The attacker presents an arbitrary TLS certificate. 4. Because `verify=False` is configured, the client accepts the attacker's certificate. 5. During login, the attacker captures the CMDB username and password. 6 ...[truncated 742 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove every `verify=False` argument and enable certificate validation. 2. Configure `requests` with the approved internal CA bundle, for example: ```python response = requests.post( url, json=data, verify="/etc/ssl/certs/internal-cmdb-ca.pem", timeout=30, ) ``` 3. Prefer a validated DNS hostname whose certificate contains the correct subject alternative name rather than relying on a raw IP address. 4. Correct the CMDB certificate deployment instead of suppressing validation errors. 5. Rotate the exposed password and invalidate existing tokens after secure TLS validation is deployed. 6. Consider certificate or public-key pinning where operationally appropriate, while retaining normal expiration and rotation procedures. 7. Add tests that fail if TLS verification is disabled in authentication or resource-query code. 8. Suppress insecure-request warnings only after fixing verification; warning suppression must not be used as a substitute for validation. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
lib/query.py:60
Finding
Unrestricted Resource Label Permits Queries of Sensitive Credential Models<![CDATA[ ## Vulnerability Details **File Location**: `lib/query.py:60-96`; sensitive models documented at `SKILL.md:97-103` **Vulnerability Type**: Missing resource-model authorization and least-privilege restriction **Risk Level**: High ### Vulnerable Code The caller controls `label`, which is inserted directly into the CMDB resource path without an allowlist: ```python def query_resources( label: str, query_filter: Optional[Dict[str, Any]] = None, page: int = 1, page_size: int = 10 ) -> Dict[str, Any]: """ 查询资源实例 Args: label: 资源类型标识符(如 host, application, RDS_database) query_filter: 查询条件,例如 {"$or": [{"name": {"$regex": "test"}}]} page: 页码 page_size: 每页数量 Returns: 查询结果 """ url = f"{BASE_URL}/cloudresources/resource/instance/{label}" headers = { "Authorization": f"Token {get_token()}", "Content-Type": "application/json" } body = { "query_filter": query_filter or {}, "format_user_field": "true" } # 分页参数在 URL 上 params = {"page": page, "page_size": page_size} # 注意:跳过证书验证 response = requests.post( url, json=body, params=params, headers=headers, verify=False, # 跳过证书验证 timeout=60 ) ``` The declared model list includes sensitive authentication and account-related records: ```markdown ### 堡垒机/账号 - `baolj_data` - 非强国堡垒机资源 - `Y_baolj_data` - 强国_堡垒机资源 - `sshprivatekey` - 堡垒机远程登陆私钥 - `jw_front_computer` - 经纬前置机账号 - `ziyuan_models` - 资源账号申请模型 - `ziyuan_users` - 资源账号平台用户表单 - `yewu_model` - 业务账号申请模型 - `yewu_users` - 业务账号平台用户表单 ``` ### Technical Analysis The Skill's legitimate function is CMDB asset discovery, but the implementation accepts any caller-provided resource label and sends it to the CMDB. There is no client-side allowlist limiting queries to ordinary inventory models such as hosts, applications, or databases. The documentation explicit ...[truncated 1788 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Implement a strict allowlist containing only resource models required for the Skill's declared asset-query functionality: ```python ALLOWED_LABELS = { "host", "ali_host", "application", "product", "project", "RDS_database", } if label not in ALLOWED_LABELS: raise ValueError("Unsupported or restricted resource type") ``` 2. Explicitly deny credential-bearing and account-related models, including `sshprivatekey`, `jw_front_computer`, `ziyuan_users`, and `yewu_users`. 3. Enforce the restriction server-side as well. The Skill's service account should have no access to private keys, passwords, account forms, or unrelated models. 4. Apply field-level authorization so approved asset queries return only necessary inventory fields. 5. Replace automatic printing of all fields with an allowlist of safe output fields for each approved resource type. 6. Set conservative pagination limits and reject unbounded enumeration attempts. 7. Audit past requests by the shared account for access to credential or account models. 8. Add security tests confirming that restricted labels are rejected before any network request is made. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared purpose says this is a CMDB query skill, but the content also embeds authentication behavior, credentials, environment-based filtering, pagination, and broad asset-model enumeration that are not transparently disclosed. This mismatch can mislead reviewers and users about the skill's real reach, especially because it can authenticate into an internal system and retrieve more data than the description implies.

Missing User Warnings

High
Confidence
99% confidence
Finding
Publishing hardcoded authentication material without any warning or protection is a direct secret exposure. In this context the danger is elevated because the target is an internal CMDB containing high-value inventory and account-related metadata, so exposed credentials materially lower the barrier to reconnaissance and follow-on compromise.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The file exposes a hardcoded CMDB username and password in plaintext. Anyone with access to the skill can reuse those credentials to authenticate to an internal asset inventory system, potentially enumerating sensitive infrastructure such as hosts, databases, network assets, and even key-related records.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill performs authenticated network access to an internal CMDB but does not declare any explicit tool scope or allowed tools. That weakens reviewability and policy enforcement, making it easier for a consumer to invoke network behavior that is broader than the metadata suggests.

Natural-Language Policy Violations

Medium
Confidence
79% confidence
Finding
The manifest description and the operational instructions are presented entirely in Chinese, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. Under the stated policy, forcing a language without opt-in is a natural-language policy concern.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. 列出所有主机
```bash
curl -s -X POST "https://10.255.227.233/cmdb/v1/api/cloudresources/resource/instance/host" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query_filter": {}, "format_user_field": "true"}' | jq '.data.items[] | {name, ip, env}'
Confidence
87% confidence
Finding
This example sends authenticated requests to an internal CMDB endpoint and retrieves host inventory data. Network transmission alone is not always unsafe, but here it becomes security-relevant because it is coupled with exposed credentials and broad internal asset enumeration, enabling reconnaissance against sensitive infrastructure.

External Transmission

Medium
Category
Data Exfiltration
Content
### 2. 按名称模糊查询应用(含 cmdb 字样)
```bash
curl -s -X POST "https://10.255.227.233/cmdb/v1/api/cloudresources/resource/instance/application" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
85% confidence
Finding
This example performs authenticated transmission to query internal application asset data using regex filtering. In context, the risk is not the POST itself but that the skill enables structured enumeration of internal applications via an internal API, which is sensitive operational intelligence if accessed by unintended parties.

External Transmission

Medium
Category
Data Exfiltration
Content
### 3. 查询特定环境的数据库
```bash
curl -s -X POST "https://10.255.227.233/cmdb/v1/api/cloudresources/resource/instance/RDS_database" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
86% confidence
Finding
This example transmits authenticated queries for internal database asset information, including environment-based filtering that can help identify production systems. In the context of an internal CMDB and exposed credentials, such requests facilitate targeted reconnaissance and increase the value of any unauthorized access.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This Python code performs remote HTTP POST requests to authenticate with the CMDB and query resource data, including sending a username/password and authorization token, but it provides no user-facing confirmation, warning, or logging that sensitive system data will be transmitted over the network. The existing comments and docstrings are developer-oriented and do not disclose this behavior to the user at runtime.

External Transmission

Medium
Category
Data Exfiltration
Content
data = {"username": USERNAME, "password": PASSWORD}
    
    # 注意:这个 API 需要跳过证书验证
    response = requests.post(
        url,
        json=data,
        verify=False,  # 跳过证书验证
Confidence
97% confidence
Finding
This request transmits hardcoded CMDB credentials to an external service while TLS certificate verification is disabled in the same call path. In a CMDB context, intercepted credentials can grant access to sensitive infrastructure inventory, making this materially more dangerous than ordinary outbound network traffic.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
response = requests.post(
        url,
        json=data,
        verify=False,  # 跳过证书验证
        timeout=30
    )
Confidence
99% confidence
Finding
Disabling TLS certificate verification during authentication makes credential theft and session interception significantly easier via man-in-the-middle attacks. In this CMDB skill, the risk is amplified because the compromised account can reveal internal asset inventory and possibly broader environment structure.

External Transmission

Medium
Category
Data Exfiltration
Content
params = {"page": page, "page_size": page_size}
    
    # 注意:跳过证书验证
    response = requests.post(
        url,
        json=body,
        params=params,
Confidence
95% confidence
Finding
This outbound request sends CMDB query results and authorization tokens over a connection configured to skip certificate validation. Because the tool queries infrastructure asset data, a man-in-the-middle attacker could intercept or tamper with inventory responses, leading to disclosure or operational misuse.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
json=body,
        params=params,
        headers=headers,
        verify=False,  # 跳过证书验证
        timeout=60
    )
Confidence
99% confidence
Finding
Skipping certificate validation for authenticated CMDB queries allows attackers on the network path to read or alter sensitive asset data returned by the service. The context makes this especially dangerous because CMDB contents often include high-value infrastructure mapping information.

Description-Behavior Mismatch

Medium
Confidence
88% confidence
Finding
The manifest describes a query skill for asset data by resource type with name-based filtering. In addition to querying instances, the code implements `list_all_models()`, which calls a metadata endpoint to retrieve all resource model definitions, expanding behavior beyond asset-data querying into schema/model enumeration.

External Transmission

Medium
Category
Data Exfiltration
Content
"Content-Type": "application/json"
    }
    
    response = requests.post(
        url,
        json={},
        headers=headers,
Confidence
93% confidence
Finding
This request enumerates CMDB model definitions using an authorization token over a TLS session with verification disabled. Even though it may not transmit credentials directly, it can still expose authenticated metadata and permit traffic interception or response manipulation.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
url,
        json={},
        headers=headers,
        verify=False,
        timeout=30
    )
Confidence
98% confidence
Finding
Using verify=False for model-definition requests creates the same man-in-the-middle weakness for authenticated metadata retrieval. While model metadata may be somewhat less sensitive than full asset records, it still reveals internal schema and can be tampered with.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
User-facing strings such as the module description, CLI description, help text, and runtime output are in Chinese, but the file does not offer users a language option or explain that the tool is intended only for a Chinese-speaking environment. This can violate language/locale policy when a skill implicitly forces a specific language without user opt-in.

Static analysis

No suspicious patterns detected.