Back to skill

Security audit

Domain Monitor

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward domain monitoring skill with expected network checks and local state, though users should note its privacy and SSL-result accuracy limitations.

Install only if you are comfortable with a Chinese-language domain-monitoring helper that stores its domain list in your home directory and performs live WHOIS/TLS lookups. Do not rely on its SSL status as authoritative until the certificate verification logic is fixed.

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/domain.py:44
Finding
Invalid TLS Certificates Are Incorrectly Reported as Valid<![CDATA[ ## Vulnerability Details **File Location**: `scripts/domain.py`, lines 44–48 **Vulnerability Type**: Incorrect TLS certificate verification **Risk Level**: Medium ```python # 提取证书信息 output = result.stdout if "Verify return code" in output: return {"status": "valid", "info": "证书有效"} ``` ### Technical Analysis The implementation considers a certificate valid whenever the OpenSSL output contains the text `Verify return code`. OpenSSL emits this line for both successful and failed certificate verification. A nonzero result, such as an expired, self-signed, or untrusted certificate, can therefore be returned as `valid`. The command also does not use `-verify_return_error` or explicitly verify the requested hostname. The subprocess return code and the exact numeric OpenSSL verification result are ignored. As a result, the status does not reliably establish certificate trust, hostname identity, or expiration validity. ### Attack Path 1. A monitored domain presents an expired, self-signed, untrusted, or otherwise invalid certificate. This could result from server misconfiguration or from an attacker controlling the endpoint or relevant network resolution. 2. The Skill invokes `openssl s_client` against the domain. 3. OpenSSL produces a `Verify return code` line containing a nonzero error code. 4. The code checks only whether that line exists, not whether its value is `0 (ok)`. 5. The Skill returns and displays the certificate status as `valid`. 6. The user may rely on the false result and fail to investigate or remediate the invalid certificate. ### Impact Assessment The vulnerability compromises the integrity and reliability of the certificate-monitoring feature. It can conceal certificate expiration, an untrusted certificate chain, or other verification failures and may cause users to treat an insecure or misconfigured TLS endpoint as healthy. The issue does not directly grant local privileges, execute attacker- ...[truncated 183 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Require the exact successful verification result, accepting only verification code `0`. - Run `openssl s_client` with `-verify_return_error` so certificate-chain failures produce an explicit failure. - Add hostname verification, such as `-verify_hostname <domain>`, rather than relying only on SNI through `-servername`. - Check the subprocess return code and treat timeouts, malformed output, and nonzero exits as errors rather than valid certificates. - Parse certificate expiration dates independently when expiration monitoring is required. - Prefer Python's `ssl` module with a default trust context and hostname checking enabled, which avoids fragile parsing of human-readable command output. - Add automated tests covering valid, expired, self-signed, hostname-mismatched, and untrusted-chain certificates. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill exposes shell, file, and network-capable workflows via documented commands, but the manifest does not declare any tool scope or permissions boundaries. This creates a least-privilege and reviewability problem: an agent or runtime may grant broader capabilities than users expect, increasing the chance of unintended file access, network use, or command execution.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The natural-language content in the description and instructions is entirely in Chinese, and the file does not indicate that this language restriction is optional or region-specific. This can violate language-choice expectations if users are not explicitly opting into a Chinese-only skill.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The trigger phrase "WHOIS" is very broad and can activate on ordinary discussion rather than a clear request to run the skill. Over-broad invocation can cause the agent to enter a networked, shell-capable workflow unexpectedly, which is risky given the skill's operational commands.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The skill performs WHOIS and TLS lookups over the network without clearly informing the user that queried domains will be transmitted to external servers and local resolvers. In monitoring workflows, this can expose sensitive domains, internal assets, or investigative targets to third parties, creating a real privacy and operational-security risk.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def get_whois(domain):
    """获取 WHOIS 信息(简化版)"""
    try:
        result = subprocess.run(
            ["whois", domain],
            capture_output=True,
            text=True,
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The manifest describes a domain monitoring tool for expiry, WHOIS changes, and SSL status, which makes network lookups expected. However, the implementation performs those checks by spawning local executables (`whois` and later `openssl`) rather than using standard library or direct protocol/network logic. Executing subprocesses is a broader host capability that is not implied by the stated purpose and can introduce operational risk beyond simple monitoring.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def check_ssl(domain):
    """检查 SSL 证书"""
    try:
        result = subprocess.run(
            ["openssl", "s_client", "-connect", f"{domain}:443", "-servername", domain],
            input="",
            capture_output=True,
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
Checking SSL certificate status is consistent with the manifest, but doing so by launching the `openssl` binary gives the skill local command-execution capability. That capability is not itself part of the declared purpose and is broader than necessary for a monitoring utility.

Vague Triggers

Low
Confidence
82% confidence
Finding
The trigger list lacks activation constraints and exclusion conditions, so the skill may be invoked too easily from generic domain-related conversation. Because the skill is intended to monitor domains and uses scripts with network/shell behavior, accidental activation expands operational risk and can surprise users.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
User-facing strings such as the title, help text, and runtime output are written in Chinese only, which imposes a specific language on users without opt-in. The file does not indicate that the tool is intentionally region-specific or provide any mechanism to select another language.

Static analysis

No suspicious patterns detected.