Back to skill

Security audit

CloudQ

Security checks for vulnerabilities and agentic risk

Overview

Review is warranted because routine checks can expand cloud permissions without approval, and cleanup can delete a role the tool did not create.

Before using production credentials, require read-only environment checks, approved HTTPS destinations and deletion checks tied to the exact role created by this tool. Avoid --all --cloud on shared accounts. Keep secrets out of forwarded questions and protect passwordless login links. All bundled files were inspected, but remote service behavior and actual cloud-account effects were not tested; the evidence supports Review rather than a malicious verdict.

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 (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/check_env.py
Finding

Routine environment checks attach full-access policies without consent

Content
View full analysis

Impact

An existing role can gain full tag-management and Advisor permissions without the user's approval. Principals already allowed to assume that role can then exercise its expanded permissions. The fallback target can also cause a different advisor role to be modified.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cleanup.py
Finding

Cloud cleanup deletes a fixed role without checking ownership

Content
View full analysis

Impact

If the cloud API accepts deletion, unrelated users or workloads lose access through that role. When the Skill created advisor1 instead, cleanup can target the unrelated advisor role while leaving the actual managed role intact.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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 (38)

Tainted flow: 'req' from os.environ.get (line 164, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

OAuth POST requests carry authorization codes, access tokens, or refresh tokens, but CLOUDQ_OAUTH_ENDPOINT accepts arbitrary destinations and plaintext HTTP without validation. The default endpoint uses verified HTTPS, so this is not demonstrated malicious exfiltration; however, an insecure override exposes cloud authentication material to network interception, and an attacker-controlled override receives it directly.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 172)May include surrounding context.

python
)
    ctx = _get_ssl_context() if url.startswith("https://") else None
    try:
        with urlopen(req, context=ctx, timeout=timeout) as resp:
            result = json.loads(resp.read().decode("utf-8"))
            return _check_response(result)
    except HTTPError as e:

Tainted flow: 'req' from os.environ.get (line 186, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 189)May include surrounding context.

python
req = Request(url, headers={"Accept": "application/json"}, method="GET")
    ctx = _get_ssl_context() if url.startswith("https://") else None
    try:
        with urlopen(req, context=ctx, timeout=timeout) as resp:
            result = json.loads(resp.read().decode("utf-8"))
            return _check_response(result)
    except HTTPError as e:

Tainted flow: 'req' from os.environ.get (line 247, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/login_url.py (reported line 255)May include surrounding context.

python
)

    ctx = _get_ssl_context()
    with urlopen(req, context=ctx, timeout=30) as resp:
        result = json.loads(resp.read().decode("utf-8"))

    response_body = result.get("Response", {})

Tainted flow: 'req' from os.environ.get (line 232, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
98% confidence
Finding

Cloud authentication normally requires sending signed requests, but this request's destination is a caller-controlled host with no endpoint validation. An attacker able to influence that argument can receive the SecretId, request signature, optional session token, and request body; the SecretKey itself is not transmitted, and the signature is request-bound. The service allowlist does not constrain the destination, making this a real disclosure risk in an agent handling cloud credentials.

Content

Scanner excerpt · scripts/tcloud_api.py (reported line 241)May include surrounding context.

python
try:
        ctx = _get_ssl_context()
        with urlopen(req, context=ctx, timeout=30) as resp:
            response_body = resp.read().decode("utf-8")
    except HTTPError as e:
        try:

Tainted flow: 'req' from os.environ.get (line 334, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/tcloud_sse_api.py (reported line 342)May include surrounding context.

python
# ---- 发送请求并解析 SSE 流 ----
    try:
        ctx = _get_ssl_context()
        resp = urllib.request.urlopen(req, context=ctx, timeout=1200)
    except HTTPError as e:
        return _handle_http_error(e, action)
    except URLError as e:

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill mandates routine execution of check_env.py while representing role permission changes as separate, consent-gated operations. The supplied implementation contradicts that boundary by attaching QcloudTAGFullAccess and QcloudAdvisorFullAccess during ordinary checks, potentially expanding an existing role's permissions without approval.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The supplied code primarily performs configuration teardown rather than the advisory, inspection, and resource-management functions described. Although related to the same Tencent Cloud tool, deleting local authentication state and a cloud IAM role are material destructive capabilities not disclosed by the declared purpose. Local cleanup runs without confirmation with --all; cloud role deletion additionally requires --cloud and available credentials. Environment variables are not directly removed from the parent shell: the utility writes a script for the user to execute. The visible code does not establish malicious intent or credential exfiltration, but its teardown behavior is materially under-described.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 8)May include surrounding context.

md
-tools: Read,Write,Bash,Grep
metadata: {"openclaw": {"emoji": "☁️", "requires": {"bins": ["python3"]}, "permissions": ["network:https://*.tencentcloudapi.com", "network:https://cloud.tencent.com", "network:https://clawhub.ai", "network:https://cloudq.cloud.tencent.com", "fs:~/.tencent-cloudq/"], "security": {"iam_operations": ["cam:GetRole", "cam:CreateRole", "cam:AttachRolePolicy", "cam:DeleteRole", "cam:DescribeRoleList", "sts:AssumeRole", "sts:GetCallerIdentity", "advisor:CreateAdvisorAuthorization", "advisor:DescribeUserAuthorizationStatus"], "iam_note": "角色创建/删除为独立步骤,需用户明确同意后执行:create_role.py 创建角色(可选,仅影响免密登录),cleanup.py --cloud 删除角色;check_env.py 做环境检测(含智能顾问开通状态检测),--enable-advisor 参数开通智能顾问(需用户明确同意,必须开通才能使用 CloudQ);DescribeUserAuthorizationStatus 和 CreateAdvisorAuthorization 已集成到 check_env.py 中", "data_handling": "凭证保存在 ~/.tencent-cloudq/credential.json(权限600),OAuth 凭证自动刷新、Connector 凭证由 Agent 侧通过 MCP Tool 获取后写入;AK/SK 通过环境变量配置;配置文件仅保存角色 ARN,不保存长期密钥"}}}
---

# ☁️ CloudQ — 多云 AIOps 专家

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/tcloud_sse_api.py (reported line 72)May include surrounding context.

python
python3 scripts/login.py  # 登录后凭证自动保存

    方式三:CloudQ Connector 临时密钥(OneId 方案)
        由 Agent 通过 MCP Tool CloudQConnector_get_available_tmp_secret 获取并写入 credential.json

输出格式(统一 JSON):
    成功: {"success": true, "action": "...", "data": {...}, "requestId": "..."}

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 160)May include surrounding context.

md
### 2.3 Connector 临时密钥 — OneId 方案(CloudQ 托管环境,自动)

在支持 Connector 的 Agent 环境中,通过 MCP Tool `CloudQConnector_get_available_tmp_secret` 获取临时密钥,写入 `credential.json`(`type: "connector"`)。
连接成功后,Agent 无需在本地配置 OAuth 或 AK/SK。

首次使用请在 [CloudQ 控制台](https://console.cloud.tencent.com/advisor/cloudq) 的「拓展」→「Channels 集成」→「OneID」完成配置,并将返回的 MCP 配置粘贴到 WorkBuddy「连接器」→「自定义连接器」→「配置 MCP」,保存后点击「连接」。

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 169)May include surrounding context.

  1. 调用 MCP Connector Tool 获取临时密钥:secretId、secretKey、token、expiresAt、auditJwt

  2. 写入 credential.json(Python 一行命令):

    bash
    python3 -c "
    import json, sys
    

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 363)May include surrounding context.

md
| `sts:AssumeRole` | `login_url.py`(内部) | 敏感 |
| `cam:CreateRole` / `cam:AttachRolePolicy` / `cam:DeleteRole` | `create_role.py` / `cleanup.py` | 写入(需同意) |

- 凭证文件 `~/.tencent-cloudq/credential.json`(权限 600),存储 OAuth 或 Connector 凭证
- 网络仅连接 `*.tencentcloudapi.com`、`cloud.tencent.com`、`cloudq.cloud.tencent.com`、`clawhub.ai`
- 清理:`python3 {baseDir}/scripts/cleanup.py --all`(需 `--all` 参数)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/cleanup.py (reported line 15)May include surrounding context.

python
清理范围:
    1. 配置目录  ~/.tencent-cloudq/(含 config.json)
    2. 凭证(OAuth / Connector)  ~/.tencent-cloudq/credential.json
    3. 临时缓存  {系统临时目录}/.tcloud_advisor_uin_cache
    4. 环境变量  TENCENTCLOUD_* 系列环境变量
    5. 云端角色  CAM 角色 advisor(可选,需 AK/SK)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/cleanup.py (reported line 42)May include surrounding context.

python
# ============== 配置 ==============
CONFIG_DIR = Path.home() / ".tencent-cloudq"
CONFIG_FILE = CONFIG_DIR / "config.json"
CREDENTIAL_FILE = CONFIG_DIR / "credential.json"
CACHE_FILE = Path(tempfile.gettempdir()) / ".tcloud_advisor_uin_cache"
ROLE_NAME = "advisor"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 6)May include surrounding context.

python
CloudQ 凭证统一管理模块

凭证获取优先级:
    1. OAuth 凭证文件(~/.tencent-cloudq/credential.json,type="oauth")
    2. Connector 凭证文件(~/.tencent-cloudq/credential.json,type="connector")
    3. 环境变量 AK/SK(TENCENTCLOUD_SECRET_ID / TENCENTCLOUD_SECRET_KEY)
    4. 抛出 CredentialNotFoundError

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 7)May include surrounding context.

python
凭证获取优先级:
    1. OAuth 凭证文件(~/.tencent-cloudq/credential.json,type="oauth")
    2. Connector 凭证文件(~/.tencent-cloudq/credential.json,type="connector")
    3. 环境变量 AK/SK(TENCENTCLOUD_SECRET_ID / TENCENTCLOUD_SECRET_KEY)
    4. 抛出 CredentialNotFoundError

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 12)May include surrounding context.

python
4. 抛出 CredentialNotFoundError

支持三种鉴权方式:
    - OAuth 授权码模式          → source="oauth"    (credential.json type="oauth")
    - CloudQ Connector 临时密钥 → source="connector" (credential.json type="connector")
    - AK/SK 环境变量           → source="env"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 13)May include surrounding context.

python
支持三种鉴权方式:
    - OAuth 授权码模式          → source="oauth"    (credential.json type="oauth")
    - CloudQ Connector 临时密钥 → source="connector" (credential.json type="connector")
    - AK/SK 环境变量           → source="env"

Connector 凭证由 Agent/SKILL.md 侧通过 MCP Tool 获取并写入 credential.json,

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 16)May include surrounding context.

python
- CloudQ Connector 临时密钥 → source="connector" (credential.json type="connector")
    - AK/SK 环境变量           → source="env"

Connector 凭证由 Agent/SKILL.md 侧通过 MCP Tool 获取并写入 credential.json,
本模块仅负责读取和校验,不负责获取和刷新 Connector 凭证。

核心功能:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 47)May include surrounding context.

python
# ============== 配置 ==============

CONFIG_DIR = Path.home() / ".tencent-cloudq"
CREDENTIAL_FILE = CONFIG_DIR / "credential.json"

# OAuth 服务端地址
OAUTH_ENDPOINT = os.environ.get(

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 404)May include surrounding context.

python
检查凭证是否快过期,自动刷新。

    OAuth 凭证:accessToken 快过期时用 refreshToken 刷新,再用新 accessToken 换临时密钥。
    Connector 凭证:**不刷新**,凭证由 Agent 侧通过 MCP Tool 获取后重新写入 credential.json。

    Args:
        force: 强制刷新,忽略有效期检查(用户主动刷新时传 True)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 461)May include surrounding context.

python
获取可用凭证,支持 OAuth、Connector 和 AK/SK 三种模式。

    优先级:
    1. credential.json(type="oauth")
    2. credential.json(type="connector")
    3. 环境变量 AK/SK

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 462)May include surrounding context.

python
优先级:
    1. credential.json(type="oauth")
    2. credential.json(type="connector")
    3. 环境变量 AK/SK

    Returns:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/credential_manager.py (reported line 478)May include surrounding context.

python
CredentialNotFoundError: 无任何可用凭证
        CredentialExpiredError: OAuth/Connector 凭证已过期且无法刷新
    """
    # 1. credential.json(优先 OAuth,其次 Connector)
    cred_data = load_credential()
    if cred_data is not None:
        cred_type = cred_data.get("type", "")

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/login.py (reported line 318)May include surrounding context.

python
print()
        print("  ✅ 登录成功!")
        print()
        print("  凭证已保存到 ~/.tencent-cloudq/credential.json")
        print("  临时密钥将在过期前自动刷新,您无需重复登录。")
        print()