Back to skill

Security audit

net-vuln-scan

Security checks for vulnerabilities and agentic risk

Overview

This is a security-scanning skill, but it includes under-scoped cloud metadata probing and a report-generation bug that users should review before installing.

Install only if you intend to run authorized security checks and are comfortable reviewing each command first. Do not run the all-platform scan on cloud-hosted systems unless metadata probing is explicitly authorized, and treat generated HTML reports as unsafe if the input JSON came from someone else. Review firewall, SSH, sudo, and package-management remediation commands before applying them to production systems.

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/platform_check.py:241
Finding
Cloud Instance Metadata Endpoints Are Probed Without Separate Explicit Authorization<![CDATA[ ## Vulnerability Details **File Location**: `scripts/platform_check.py:241-264`; related executable guidance at `references/platform_vulnerabilities_2026.md:412-418` **Vulnerability Type**: Cloud metadata boundary access / excessive capability **Risk Level**: High ### Vulnerable Code ```python def check_aws_metadata(): """检测 AWS 元数据服务""" result = {'service': 'AWS Metadata', 'ip': '169.254.169.254', 'vulnerable': False, 'issues': []} try: import urllib.request req = urllib.request.Request('http://169.254.169.254/latest/meta-data/') urllib.request.urlopen(req, timeout=2) result['status'] = '可访问' result['vulnerable'] = True result['issues'].append('⚠️ AWS 元数据服务可访问,可能存在 SSRF 漏洞') except: result['status'] = '不可访问' return result def check_azure_metadata(): """检测 Azure 元数据服务""" result = {'service': 'Azure Metadata', 'ip': '169.254.169.254', 'vulnerable': False, 'issues': []} try: import urllib.request req = urllib.request.Request('http://169.254.169.254/metadata/instance', headers={'Metadata': 'true'}) urllib.request.urlopen(req, timeout=2) result['status'] = '可访问' result['vulnerable'] = True result['issues'].append('⚠️ Azure 元数据服务可访问') except: result['status'] = '不可访问' return result ``` The reference guide also provides a directly executable metadata request: ```bash echo "=== 云服务元数据检测 ===" curl -s http://169.254.169.254/latest/meta-data/ && echo "⚠️ 元数据可访问" ``` ### Technical Analysis The platform scanner sends HTTP requests to the link-local address `169.254.169.254`, which cloud providers reserve for instance metadata services. This is a sensitive trust boundary because metadata services can expose instance identity information and, through provider-specific identity paths, temporary workload credentials. The current AWS request accesses only the metadata root, while the Azure request accesses i ...[truncated 2085 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove cloud metadata checks from the default `all` scan. 2. Require a dedicated option such as `--cloud-metadata` and display a clear confirmation explaining that the scan will contact a sensitive link-local service. 3. Restrict the check to explicitly authorized cloud instances; do not run it against arbitrary targets or by default. 4. Never enumerate role-name, identity-token, service-account, or credential paths. 5. Do not retain, print, log, or include metadata response bodies in reports. 6. Prefer configuration-based checks: - Verify that AWS IMDSv2 is required. - Verify appropriate metadata hop limits. - Verify that metadata endpoints are disabled where unnecessary. - Verify Azure managed-identity and metadata access controls. 7. Correct the finding language to state that the scanner process can reach metadata. Do not label this as proof of SSRF unless an application-controlled request path is separately tested. 8. Replace the reference guide's direct `curl` command with a guarded procedure that requires authorization and explains the cloud credential risk. 9. Add automated tests confirming that ordinary and `all` scans do not contact `169.254.169.254` unless the explicit metadata option is supplied. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/report_gen.py:138
Finding
Unescaped Scan Data Enables Stored HTML Injection in Generated Reports<![CDATA[ ## Vulnerability Details **File Location**: `scripts/report_gen.py:138-171` **Vulnerability Type**: Stored HTML injection **Risk Level**: Medium ### Vulnerable Code ```python # 生成端口表格 port_rows = "" for port in results.get('ports', []): risk_class = port.get('risk_level', '低') risk_badge_class = 'high' if risk_class in ['极高', '高'] else ('medium' if risk_class == '中' else 'low') port_rows += f""" <tr> <td>{port.get('port')}/tcp</td> <td>{port.get('service')}</td> <td><span class="risk-badge risk-{risk_badge_class}">{risk_class}</span></td> <td>{port.get('recommendation', '-')}</td> </tr> """ # 生成问题列表 issues_html = "" for issue in results.get('issues', []): issue_class = 'high' if issue.get('risk') in ['极高', '高'] else ('medium' if issue.get('risk') == '中' else 'low') issues_html += f""" <div class="issue {issue_class}"> <div class="issue-title">{issue.get('title')}</div> <div class="issue-desc">{issue.get('description')}</div> </div> """ # 填充模板 html = html_template.format( timestamp=datetime.now().strftime('%Y-%m-%d %H:%M:%S'), target=results.get('target', 'localhost'), high_risk=high_risk, medium_risk=medium_risk, low_risk=low_risk, total_ports=total_ports, port_rows=port_rows, issues_html=issues_html if issues_html else '<p style="color: #27ae60;">✅ 未发现严重安全问题</p>' ) ``` ### Technical Analysis The report generator loads values from a user-selected JSON file and interpolates them directly into an HTML document. It does not apply HTML escaping to fields including: - `target` - `port` - `service` - `risk_level` - `recommendation` - `title` - `description` An attacker-controlled value containing HTML event handlers, script-capable elements, or deceptive ...[truncated 1759 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Escape every untrusted value before inserting it into HTML: ```python from html import escape safe_target = escape(str(results.get('target', 'localhost')), quote=True) safe_service = escape(str(port.get('service', '')), quote=True) safe_recommendation = escape(str(port.get('recommendation', '-')), quote=True) safe_title = escape(str(issue.get('title', '')), quote=True) safe_description = escape(str(issue.get('description', '')), quote=True) ``` 2. Prefer a template engine with automatic escaping enabled, such as Jinja2 with HTML autoescape. 3. Validate the input JSON against a strict schema: - Ports must be integers in the range 1–65535. - Risk levels must come from a fixed allowlist. - Text fields must be strings with reasonable length limits. 4. Do not mark scan-derived fields as trusted or use an HTML-safe bypass. 5. Add a restrictive Content Security Policy to the report, for example one that disallows scripts and remote content. This is defense in depth and does not replace escaping. 6. Add regression tests using `<`, `>`, quotes, event handlers, and script-like payloads in every rendered field. 7. Ensure the final HTML contains escaped text such as `&lt;img...&gt;` rather than executable elements. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (63)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The reported implementation only probes a few fixed ports and does not perform the generic SSL/TLS, service-vulnerability, credential, or network-configuration checks described in the skill. In the context of an authorized security-audit tool, this mismatch increases danger because it can mislead users into underestimating exposure while the skill still requests or implies powerful scanning-related capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The reported implementation only probes a few fixed ports and does not perform the generic SSL/TLS, service-vulnerability, credential, or network-configuration checks described in the skill. In the context of an authorized security-audit tool, this mismatch increases danger because it can mislead users into underestimating exposure while the skill still requests or implies powerful scanning-related capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The reported implementation only probes a few fixed ports and does not perform the generic SSL/TLS, service-vulnerability, credential, or network-configuration checks described in the skill. In the context of an authorized security-audit tool, this mismatch increases danger because it can mislead users into underestimating exposure while the skill still requests or implies powerful scanning-related capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The reported implementation only probes a few fixed ports and does not perform the generic SSL/TLS, service-vulnerability, credential, or network-configuration checks described in the skill. In the context of an authorized security-audit tool, this mismatch increases danger because it can mislead users into underestimating exposure while the skill still requests or implies powerful scanning-related capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The reported implementation only probes a few fixed ports and does not perform the generic SSL/TLS, service-vulnerability, credential, or network-configuration checks described in the skill. In the context of an authorized security-audit tool, this mismatch increases danger because it can mislead users into underestimating exposure while the skill still requests or implies powerful scanning-related capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The reported implementation only probes a few fixed ports and does not perform the generic SSL/TLS, service-vulnerability, credential, or network-configuration checks described in the skill. In the context of an authorized security-audit tool, this mismatch increases danger because it can mislead users into underestimating exposure while the skill still requests or implies powerful scanning-related capabilities.

Chaining Abuse

High
Category
Tool Misuse
Content
**修复方案:**
```bash
# Ubuntu/Debian
sudo apt update && sudo apt install mysql-server

# RHEL/CentOS
sudo yum update mysql-server
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Chaining Abuse

High
Category
Tool Misuse
Content
**修复方案:**
```bash
# Ubuntu/Debian
sudo apt update && sudo apt install mysql-server

# RHEL/CentOS
sudo yum update mysql-server
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

YARA rule 'offensive_tool_references': References to well-known offensive security tools [hacktools]

High
Category
YARA Match
Content
})
```

---

## 网络设备漏洞

### 防火墙/VPN

| CVE ID | 设备类型 | 漏洞描述 | 严重程度 |
|--------|----------|----------|----------|
| CVE-2026-21280 | FortiGate | FortiOS 远程代码执行 | CRITICAL |
| CVE-2026-21281 | Palo Alto | PAN-OS 认证绕过 | HIGH |
| CVE-2026-21430 | Cisco ASA | Cisco ASA 拒绝服务 | MEDIUM |

**检测方法:**
```bash
# 检查开放端口
nmap -sV -p 443,8443 <target>

# 检查 SSL VPN
curl -k https://<target>/sslvpn/
```

**修复方案:**
```bash
# FortiGate
execute firmware upgrade

# Cisco ASA
write mem
reload
```

### 路由器/交换机

| CVE ID | 设备类型 | 漏洞描述 | 严重程度 |
|--------|----------|----------|----------|
| CVE-2026-21440 | Cisco IOS XE | 命令注入 | CRITICAL |
| CVE-2026-21441 | Juniper JunOS | 本地提权 | HIGH |
| CVE-2026-21442 | HPE Aruba | 认证绕过 | HIGH |

**检测命令:**
```bash
# Cisco
show version
show inventory

# Juniper
show version
```

### IoT/摄像头

| CVE ID |
Confidence
70% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
nmap -sV -p 443,8443 <target>

# 检查 SSL VPN
curl -k https://<target>/sslvpn/
```

**修复方案:**
Confidence
90% confidence
Finding
curl -k disables TLS certificate validation, which trains users to bypass an important security control and can produce misleading results if a man-in-the-middle or invalid certificate is present. In a security scanning guide, normalizing insecure transport options is particularly risky because users may reuse the pattern elsewhere.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
**检测命令:**
```bash
# Jenkins
curl -k https://<jenkins>/api/json

# Argo CD
argocd version
Confidence
90% confidence
Finding
Using curl -k against Jenkins similarly disables TLS verification and encourages insecure operational habits. Although intended for discovery, it undermines authenticity checks and may conceal certificate misconfiguration that should itself be treated as a finding.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Content
done

echo "=== 云服务元数据检测 ==="
curl -s http://169.254.169.254/latest/meta-data/ && echo "⚠️ 元数据可访问"
```

---
Confidence
98% confidence
Finding
The script directly accesses the cloud instance metadata IP, which is a sensitive endpoint that can expose credentials, identity, and instance configuration in some environments. Embedding this in a general-purpose detection script without safeguards materially increases the chance of accidental secret exposure.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Content
'cloud': {
        'name': '云服务',
        'services': {
            'aws_metadata': {'169.254.169.254': 'check_aws_metadata'},
            'azure_metadata': {'169.254.169.254': 'check_azure_metadata'},
        }
    },
Confidence
92% confidence
Finding
The skill is explicitly configured to target the cloud metadata IP 169.254.169.254. Access to metadata services is highly sensitive because successful requests may expose instance identity data and, depending on platform configuration, temporary credentials or other secrets; in a scanning skill, hardcoding this target increases risk beyond ordinary localhost checks.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Content
'name': '云服务',
        'services': {
            'aws_metadata': {'169.254.169.254': 'check_aws_metadata'},
            'azure_metadata': {'169.254.169.254': 'check_azure_metadata'},
        }
    },
    'container': {
Confidence
92% confidence
Finding
This second metadata service entry also hardcodes 169.254.169.254 as a scan target. The context of a security-scanning skill makes this more dangerous because users may run it broadly without realizing it will probe privileged link-local cloud services rather than only local application ports.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Content
def check_aws_metadata():
    """检测 AWS 元数据服务"""
    result = {'service': 'AWS Metadata', 'ip': '169.254.169.254', 'vulnerable': False, 'issues': []}
    try:
        import urllib.request
        req = urllib.request.Request('http://169.254.169.254/latest/meta-data/')
Confidence
95% confidence
Finding
The AWS metadata check constructs a request to the link-local metadata endpoint. Direct requests to this endpoint can disclose sensitive cloud instance metadata and credentials if IMDS is accessible, making this dangerous in shared, production, or agent-executed environments.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Content
result = {'service': 'AWS Metadata', 'ip': '169.254.169.254', 'vulnerable': False, 'issues': []}
    try:
        import urllib.request
        req = urllib.request.Request('http://169.254.169.254/latest/meta-data/')
        urllib.request.urlopen(req, timeout=2)
        result['status'] = '可访问'
        result['vulnerable'] = True
Confidence
97% confidence
Finding
The code actively performs urlopen() against AWS IMDS. Because this initiates a real request to a sensitive internal service, it crosses from static configuration into live internal-resource access, which can expose secrets and is a classic unsafe internal request pattern in automated tooling.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Content
def check_azure_metadata():
    """检测 Azure 元数据服务"""
    result = {'service': 'Azure Metadata', 'ip': '169.254.169.254', 'vulnerable': False, 'issues': []}
    try:
        import urllib.request
        req = urllib.request.Request('http://169.254.169.254/metadata/instance', headers={'Metadata': 'true'})
Confidence
95% confidence
Finding
The Azure metadata check similarly targets the privileged link-local metadata service. Even with the required Metadata header, this is still an intentional request to an internal cloud control surface and may reveal sensitive environment information when run in Azure-hosted contexts.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Content
result = {'service': 'Azure Metadata', 'ip': '169.254.169.254', 'vulnerable': False, 'issues': []}
    try:
        import urllib.request
        req = urllib.request.Request('http://169.254.169.254/metadata/instance', headers={'Metadata': 'true'})
        urllib.request.urlopen(req, timeout=2)
        result['status'] = '可访问'
        result['vulnerable'] = True
Confidence
97% confidence
Finding
The code performs an actual urlopen() to the Azure metadata endpoint. In an agent skill context, this is more dangerous because the operator may think they are only doing benign local port checks, while the script is making sensitive internal HTTP requests that could leak cloud information or violate environment boundaries.

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill advertises and references capabilities that imply shell, filesystem, and network access, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, missing scope declarations can lead to over-broad execution privileges and make misuse, unintended scanning, or unsafe file access harder to constrain or audit.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This markdown file uses Chinese throughout the description, usage instructions, and warnings, and does not indicate that users may choose another language. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The examples demonstrate network-range discovery and host scanning behavior but do not repeat or embed clear authorization, scope, and rate-limit warnings near the actionable commands. In a security scanning skill, this omission increases the chance that users copy the workflow for unauthorized or overly broad scans, causing legal, operational, or safety issues.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The file provides direct firewall and SSH hardening commands that can immediately change connectivity and access controls, but it does not warn about lockout risk, service interruption, rollback, or testing requirements. Users may apply these commands blindly and accidentally block remote administration or disrupt production services.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
ssh-keygen -t ed25519
   
   # 禁用密码认证
   sudo nano /etc/ssh/sshd_config
   # PasswordAuthentication no
   # PubkeyAuthentication yes
   sudo systemctl restart sshd
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
ssh-keygen -t ed25519
   
   # 禁用密码认证
   sudo nano /etc/ssh/sshd_config
   # PasswordAuthentication no
   # PubkeyAuthentication yes
   sudo systemctl restart sshd
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The document includes active scanning commands against arbitrary targets/domains without pairing them at the point of use with an authorization/impact warning. In a network vulnerability scanning skill, this materially increases misuse risk because users can directly copy commands to probe systems they do not own, potentially causing unauthorized scanning or operational impact.

Static analysis

No suspicious patterns detected.