T09 · Insecure Skill Coding Practices
- Location
scripts/tcloud_api.py:44- Finding
TLS Certificate Verification Is Disabled for Credential-Bearing Requests
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real Tencent Cloud Advisor helper, but it asks for high-impact cloud credentials and contains under-scoped credential, IAM, TLS, and dependency behaviors that users should review before installing.
Install only if you are comfortable giving the skill Tencent Cloud credentials and allowing it to create or use a console-login CAM role. Prefer a tightly scoped subaccount or temporary credentials, avoid writing long-lived AK/SK values into shell startup files, review generated passwordless links as sensitive credentials, and consider fixing the TLS and unpinned dependency behavior before use.
scripts/tcloud_api.py:44TLS Certificate Verification Is Disabled for Credential-Bearing Requests
scripts/tcloud_api.py:92Generic API Client Can Transmit Credential Material to an Arbitrary Host
check_env.py:158Automatic Execution of Unpinned Remote Dependencies
scripts/create_role.py:36IAM Role Creation Grants Permissions Beyond the Read-Only Advisor Workflow
scripts/login_url.py:260Passwordless Console Credentials Are Emitted into Agent and Chat Output
check_env.py:394Mandatory Read-Only Environment Check Performs Persistent Writes and Role Assumption
The script creates an SSL context that disables certificate verification and hostname checking when the certifi package is unavailable, then uses that context for the STS AssumeRole request. Because this request carries cloud authentication material and returns temporary credentials, a man-in-the-middle attacker could intercept or tamper with the response, potentially obtaining privileged temporary access or redirecting login generation.
)
ctx = _get_ssl_context()
with urlopen(req, context=ctx) as resp:
result = json.loads(resp.read().decode("utf-8"))
response_body = result.get("Response", {})
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
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:
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
Enumerating roles, creating a new CAM role, attaching policies, writing local configuration, and testing role assumption are privileged account-management tasks absent from the high-level description. This increases the risk of confused-deputy behavior where a user thinks they are invoking a read-only advisor assistant but actually authorize administrative reconfiguration.
The skill instructs users to permanently store long-lived Tencent Cloud SecretId/SecretKey values in shell startup files or user-level environment variables. Persisting cloud credentials in broadly readable or routinely sourced locations significantly increases the chance of credential theft, accidental disclosure, session inheritance, backup leakage, and long-term account compromise.
The YARA match is not evidence of malware in the classic sense, but it correctly flags persistence-like behavior: appending secrets and role settings into shell initialization files to survive across sessions. In this context, the persistence is user-directed rather than covert, yet it still creates a high-severity credential persistence risk because long-lived cloud secrets are being written to durable locations on disk.
��变量配置密钥:
TENCENTCLOUD_SECRET_ID — 腾讯云 SecretId(必填)TENCENTCLOUD_SECRET_KEY — 腾讯云 SecretKey(必填)密钥获取地址:https://console.cloud.tencent.com/cam/capi
环境变量必须永久写入 shell 配置文件,确保新会话中仍然生效:
Linux / macOS(写入 ~/.bashrc 或 ~/.zshrc):
echo 'export TENCENTCLOUD_SECRET_ID="your-secret-id"' >> ~/.bashrc
echo 'export TENCENTCLOUD_SECRET_KEY="your-secret-key"' >> ~/.bashrc
source ~/.bashrc
Windows PowerShell(写入用户级环境变量):
[Environment]::SetEnvironmentVariable("TENCENTCLOUD_SECRET_ID", "your-secret-id", "User")
[Environment]::SetEnvironmentVariable("TENCENTCLOUD_SECRET_KEY", "your-secret-key", "User")
为生成控制台免密登录链接,需要配置 CAM 角色。角色配置分为 检测 和 创建 两个独立步骤,角色创
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
nd("TENCENTCLOUD_SECRET_ID")
if not secret_key:
missing.append("TENCENTCLOUD_SECRET_KEY")
log_fail(f"未配置以下环境变量: {', '.join(missing)}")
log_info("")
log_info(" 请将腾讯云 API 密钥永久写入 shell 配置文件:")
log_info("")
log_info(" Linux / macOS(写入 ~/.bashrc 或 ~/.zshrc):")
log_info(' echo \'export TENCENTCLOUD_SECRET_ID="your-secret-id"\' >> ~/.bashrc')
log_info(' echo \'export TENCENTCLOUD_SECRET_KEY="your-secret-key"\' >> ~/.bashrc')
log_info(" source ~/.bashrc")
log_info("")
log_info(" Windows PowerShell(写入用户级环境变量):")
log_info(' [Environment]::SetEnvironmentVariable("TENCENTCLOUD_SECRET_ID", "your-secret-id", "User")')
log_info(' [Environment]::SetEnvironmentVariable("TENCENTCLOUD_SECRET_KEY", "your-secret-key", "User")')
log_info("")
log_info(" 密钥获取地址: https:
The script performs destructive actions well beyond the stated ChatOps/advisor/query scope of the skill: it recursively deletes local configuration and cache data and can also remove a remote CAM role. In an agent-skill context, hidden or mismatched destructive capabilities increase the risk of misuse, accidental invocation, or privilege abuse because users would not reasonably expect cleanup and cloud-deletion behavior from the manifest description.
The function clean_cloud_role can delete a Tencent CAM role named advisor using available AK/SK credentials, which is an administrative cloud operation not justified by the skill's informational/advisor purpose. If triggered in the wrong environment, it can remove access-control infrastructure and disrupt dependent workflows or security integrations.
The script performs privileged CAM write operations by creating a role, enabling console login, and attaching broad policies, which goes beyond the skill's described advisory/query functionality. In a chat-integrated skill, this is dangerous because it can modify a user's cloud IAM posture and grant high privileges if invoked, especially when the manifest frames the skill as informational rather than administrative.
os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.
if platform.system() == "Windows":
# Windows 10+ 的 cmd/PowerShell 支持 ANSI(需 VT100)
try:
os.system("") # 激活 VT100 模式
return True
except Exception:
return False
This setup flow can create a new CAM role and attach broad policies, changing the user's cloud IAM posture rather than merely providing read-only advisory/chat functionality. In the skill context, this is more dangerous because the manifest describes informational/advisor operations, so hidden or under-justified privilege and identity changes violate least privilege and can expand the attack surface of the Tencent Cloud account.
If certifi is unavailable, the fallback disables both certificate validation and hostname verification, which allows man-in-the-middle interception of supposedly HTTPS-protected traffic. Because this script sends signed cloud API requests and may include temporary tokens, an attacker on the network path could tamper with requests or capture sensitive cloud-management traffic.
The code silently proceeds with CERT_NONE and check_hostname=False when certifi is missing, giving users no indication that transport security has been disabled. In the context of a CloudOps skill that performs authenticated cloud API operations, this materially increases the danger because operators may unknowingly run privileged requests over an unauthenticated TLS channel.
Without declared permissions the skill's intent is opaque and cannot be validated.
The trigger description is overly broad and includes vague language like 'related operations', which can cause the skill to activate in contexts beyond the user's intent. Because this skill includes credentialed cloud access and privileged setup actions, broad triggering materially increases the risk of unintended execution.
L011 明确写明在身份相关问题下“必须”使用指定内容回答,而指定模板以英文“Hi,我是”及固定格式输出。该文件整体以中文为主,却未给出语言可选项或要求基于用户语言偏好响应,构成语言/locale 强制策略问题。
The role-creation documentation is internally inconsistent: one section says only QcloudAdvisorFullAccess is attached, while another adds QcloudTAGFullAccess and describes broader permissions. Documentation contradictions around IAM policy grants are dangerous because users cannot accurately assess the scope of access they are approving.
The plugin trigger terms are broad operational phrases without strong context constraints, which can pull in a plugin that fetches data and generates reports unexpectedly. In a skill with file generation and external tooling, permissive triggers expand the chance of accidental sensitive-data handling.
No suspicious patterns detected.