T09 · Insecure Skill Coding Practices
Warning
- Location
- fritzbox.py:99
- Finding
- Authentication and Session Material Transmitted over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `fritzbox.py:99`, `fritzbox.py:166-167`, `fritzbox.py:207-213`, `fritzbox.py:302-303`, `fritzbox.py:320-321`, `fritzbox.py:370-371` **Vulnerability Type**: Plaintext transmission of authentication and session material **Risk Level**: Medium ### Vulnerable Code ```python self.base_url = f'http://{validated_ip}:49000' ``` ```python login_url = f'http://{self.host}/login_sid.lua?username={quote(self.user)}&response={response}' resp = requests.get(login_url, timeout=10) ``` ```python resp = requests.post( f'{self.base_url}{control_url}', data=soap, headers=headers, auth=self._auth, timeout=10 ) ``` ```python login_url = f'http://{self.host}/login_sid.lua?username={quote(self.user)}&response={response}' resp = requests.get(login_url, timeout=10) ``` ```python url = f'http://{self.host}/webservices/homeautoswitch.lua?switchcmd=getdevicelistinfos&sid={sid}' resp = requests.get(url, timeout=10) ``` ```python url = f'http://{self.host}/webservices/homeautoswitch.lua?switchcmd={cmd}&ain={quote(ain)}&sid={sid}' resp = requests.get(url, timeout=10) ``` ### Technical Analysis The implementation uses unencrypted HTTP for TR-064 authentication and Homeautoswitch API requests. The password is not directly submitted in the Web API login request; instead, a challenge response is generated. However, the resulting session ID is a bearer-like credential and is placed in subsequent request URLs. The private-address validation in `_validate_host()` is a meaningful control against sending credentials directly to a public Internet address. It does not provide confidentiality or server authenticity on the local network. A device with local traffic visibility, a compromised gateway, a malicious access point, or an attacker capable of ARP or DNS manipulation may observe or modify plaintext traffic. Putting the session ID in the query string also increases exposure through HTTP access logs, proxy logs, ne ...[truncated 1147 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Use the FRITZ!Box HTTPS interface where supported and configure certificate validation appropriately. 2. Do not silently fall back from HTTPS to HTTP. 3. Avoid putting session identifiers in URLs where the router API permits another transport mechanism. 4. Explicitly disable use of environment-configured HTTP proxies for local router traffic, or validate proxy settings before transmitting authentication material. 5. Redact URLs, session IDs, challenge responses, usernames, and authentication headers from logs and error telemetry. 6. Use a dedicated FRITZ!Box account with only the permissions required for the selected operations. 7. Document the residual local-network interception risk if compatibility requires plaintext HTTP. 8. Consider binding the configured router to a known IP or validating its identity to reduce local spoofing risk. ]]>
