T09 · Insecure Skill Coding Practices
- Location
scripts/pve_client.py:55- Finding
TLS Certificate Verification Is Disabled for Authenticated API Requests
- Content
View full analysis
= 400: ``` The Skill documentation also recommends commands that disable certificate validation: ```bash # 1. Get ticket and CSRF token curl -k -d 'username=root@pam' --data-urlencode 'password=secret' \ https://pve.example.com:8006/api2/json/access/ticket # Response: { "data": { "ticket": "...", "CSRFPreventionToken": "..." } } # 2. Use ticket in subsequent requests curl -k -b "PVEAuthCookie=" \ -H "CSRFPreventionToken: " \ https://pve.example.com:8006/api2/json/nodes ``` ### Technical Analysis The client uses HTTPS but explicitly passes `verify=False` to every request. This prevents `requests` from validating whether the server certificate is trusted and whether it belongs to the requested host. Suppression of `InsecureRequestWarning` further conceals this unsafe state from operators. Every request includes the PVE API token in the `Authorization` header: ```python self.headers = { 'Authorization': f'PVEAPIToken={self.user}!{self.token_id}={self.token_secret}' } ``` Consequently, an attacker who can intercept or redirect network traffic can present an arbitrary TLS certificate. The client will accept the certificate and send its authentication token to the attacker-controlled endpoint. The documented `curl -k` ticket-authentication workflow creates the same exposure for usernames, ...[truncated 2028 chars]- Remediation
View remediation
