T09 · Insecure Skill Coding Practices
- Location
huawei_cloud_rds_detail.py:70- Finding
TLS Certificate Verification Is Disabled for All Cloud API Clients
- Content
View full analysis
Vulnerability Details
File Location:
huawei_cloud_rds_detail.py:67-75,huawei_cloud_rds_detail.py:103-111, andhuawei_cloud_rds_detail.py:121-129
Vulnerability Type: Improper certificate validation
Risk Level: HighVulnerable Code
python credentials = BasicCredentials(ak=self.ak, sk=self.sk) config = HttpConfig.get_default_config() config.timeout = self.timeout config.ignore_ssl_verification = True client = IamClient.new_builder() \ .with_http_config(config) \ .with_credentials(credentials) \ .with_endpoint(f'https://iam.{self.region}.myhuaweicloud.com') \ .build()python credentials = BasicCredentials(ak=self.ak, sk=self.sk, project_id=project_id) config = HttpConfig.get_default_config() config.timeout = self.timeout config.ignore_ssl_verification = True return RdsClient.new_builder() \ .with_http_config(config) \ .with_credentials(credentials) \ .with_endpoint(f'https://rds.{self.region}.myhuaweicloud.com') \ .build()python credentials = BasicCredentials(ak=self.ak, sk=self.sk, project_id=project_id) config = HttpConfig.get_default_config() config.timeout = self.timeout config.ignore_ssl_verification = True return CesClient.new_builder() \ .with_http_config(config) \ .with_credentials(credentials) \ .with_endpoint(f'https://ces.{self.region}.myhuaweicloud.com') \ .build()Technical Analysis
The implementation explicitly disables TLS certificate verification for IAM, RDS, and CES connections. HTTPS encryption without certificate verification does not authenticate the remote server. A server presenting an arbitrary or self-signed certificate can therefore be accepted as if it were the intended Huawei Cloud service.
Requests are authenticated using Huawei Cloud credentials. Although the secret key itself is not normally transmitted, a man-in-the-middle server can observe signed ...[truncated 1679 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove every
config.ignore_ssl_verification = Trueassignment and retain the SDK's default certificate verification. - If a private trust infrastructure is required, configure an explicit trusted CA bundle rather than disabling verification globally.
- Do not expose a general-purpose insecure TLS option in production.
- Add tests that verify connections fail for expired, self-signed, hostname-mismatched, and otherwise untrusted certificates.
- Combine this correction with strict region validation so requests cannot be redirected to attacker-controlled hosts.
- Remove every
