Back to skill

Security audit

CORS Scanner

Security checks for vulnerabilities and agentic risk

Overview

This CORS scanner is mostly purpose-aligned, but it disables HTTPS certificate checks by default and lacks clear target-scope guardrails, so users should review it before use.

Install only if you are comfortable reviewing or fixing the TLS behavior first. Use it only on endpoints you own or are authorized to test, avoid putting secrets in URLs, and be cautious on untrusted networks because HTTPS verification is disabled by default.

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

Error
Location
scripts/cors_scan.py:48
Finding

TLS Certificate and Hostname Verification Disabled

Content
View full analysis

Vulnerability Details

File Location: scripts/cors_scan.py, lines 48–50
Vulnerability Type: CWE-295 — Improper Certificate Validation
Risk Level: High

python
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

Technical Analysis

The scanner creates a TLS context but explicitly disables hostname verification and certificate-chain validation for every HTTPS request. Consequently, it accepts expired, self-signed, untrusted, or host-mismatched certificates without warning.

Network access is necessary for the declared CORS-scanning functionality, and the audit found no unrelated data exfiltration. However, disabling TLS verification is not necessary for normal scanning and exceeds the minimum relaxation of security controls required by the Skill. It prevents the scanner from authenticating the selected endpoint and allows an active network attacker to supply forged HTTP status codes and CORS headers.

Attack Path

  1. A user or CI system invokes the scanner against an HTTPS endpoint.
  2. An attacker gains an on-path position, such as through a compromised proxy, malicious network gateway, DNS manipulation, or hostile Wi-Fi network.
  3. The attacker presents an arbitrary certificate and impersonates the target endpoint.
  4. Because certificate and hostname validation are disabled, the scanner accepts the attacker's TLS connection.
  5. The attacker returns crafted CORS headers, such as a restrictive policy to conceal a real vulnerability or a permissive policy to fabricate one.
  6. The scanner generates a false security grade, potentially influencing remediation or CI/CD decisions.

Impact Assessment

An attacker with a network interception position can compromise the integrity and confidentiality of HTTPS scans. The attacker can falsify CORS findings, cause false-positive or false-negative reports, manipulate CI pass/fail outcomes, and observe request pat ...[truncated 394 chars]

Remediation
View remediation

Remediation Suggestions

  • Retain Python's secure default certificate and hostname validation:

    python
    ctx = ssl.create_default_context()
    
  • Remove both ctx.check_hostname = False and ctx.verify_mode = ssl.CERT_NONE.

  • If scanning endpoints with intentionally self-signed certificates is a required use case, add an explicit opt-in option such as --insecure. Keep verification enabled by default and display a prominent warning when insecure mode is selected.

  • Prefer a --ca-file option for private certificate authorities so users can preserve server authentication.

  • Add automated tests confirming that untrusted, expired, and host-mismatched certificates fail under the default configuration.

  • Document that users should avoid placing credentials or sensitive tokens in scan URLs.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs users to run a Python scanner against arbitrary URLs, which implies outbound network access, but it does not declare any tool scope such as permissions or allowed-tools. Undeclared network capability weakens sandboxing and review controls because an agent may be able to make external requests without explicit authorization, increasing the risk of unintended scanning, data exfiltration, or misuse against internal endpoints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The scanner explicitly disables TLS certificate validation and hostname verification for every HTTPS request. This makes the tool trust forged or intercepted HTTPS connections, so a man-in-the-middle can alter response headers and bodies, causing false scan results and exposing any scanned traffic to interception.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/cors_scan.py (reported line 337)May include surrounding context.

python
formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog="""Examples:
  python3 cors_scan.py https://api.example.com
  python3 cors_scan.py https://api.example.com/v1/users --format json
  python3 cors_scan.py https://a.com https://b.com --format markdown
  python3 cors_scan.py https://api.example.com --min-grade C""")

Static analysis

Detected: suspicious.insecure_tls_verification

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
scripts/cors_scan.py:53