T09 · Insecure Skill Coding Practices
- 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: Highpython ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONETechnical 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
- A user or CI system invokes the scanner against an HTTPS endpoint.
- An attacker gains an on-path position, such as through a compromised proxy, malicious network gateway, DNS manipulation, or hostile Wi-Fi network.
- The attacker presents an arbitrary certificate and impersonates the target endpoint.
- Because certificate and hostname validation are disabled, the scanner accepts the attacker's TLS connection.
- The attacker returns crafted CORS headers, such as a restrictive policy to conceal a real vulnerability or a permissive policy to fabricate one.
- 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 = Falseandctx.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-fileoption 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.
-
