T09 · Insecure Skill Coding Practices
- Location
scripts/auth.py:88- Finding
TLS Certificate Verification Disabled for Huawei Cloud Config API
- Content
View full analysis
Vulnerability Details
File Location:
scripts/auth.py:88-94
Vulnerability Type: Improper certificate validation
Risk Level: HighVulnerable Code
python def get_config_client(self, region: str = "cn-north-4"): """Get Config client (for resource configuration queries)""" config = HttpConfig.get_default_config() config.ignore_ssl_verification = True return ConfigClient.new_builder() \ .with_http_config(config) \ .with_credentials(self.get_global_credentials()) \ .with_region(ConfigRegion.value_of(region)) \ .build()Technical Analysis
The Config API client explicitly disables TLS certificate verification through:
python config.ignore_ssl_verification = TrueConsequently, the client does not authenticate the identity of the remote HTTPS endpoint. This affects every operation that obtains a client through
get_config_client(), including:- Listing Flexus L resources across regions
- Resolving an ECS ID to a Flexus L instance
- Listing traffic-package resource identifiers
- Querying traffic packages by region
- Performing the documented Flexus-instance validation workflow
These requests are authenticated using
GlobalCredentials. When temporary credentials are configured, the requests also carry the associated security token. A network-positioned attacker capable of intercepting or redirecting the connection can present an untrusted certificate without the client rejecting it.The trust boundary crossed is between the trusted local process, which holds Huawei Cloud credentials, and a remote endpoint whose identity is no longer cryptographically verified.
Attack Path
- A user configures valid Huawei Cloud credentials and invokes an operation that calls
get_config_client(). - An attacker obtains a network interception position, such as through a malicious proxy, compromised gateway, DNS redirection, or hostile local network.
- The attacker redirects or intercept ...[truncated 1143 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove the explicit TLS bypass and use the Huawei Cloud SDK's default certificate verification:
python def get_config_client(self, region: str = "cn-north-4"): return ConfigClient.new_builder() \ .with_credentials(self.get_global_credentials()) \ .with_region(ConfigRegion.value_of(region)) \ .build() -
If a private enterprise CA is required, configure a narrowly scoped trusted CA bundle rather than disabling certificate validation.
-
Do not provide a production option that globally disables TLS verification.
-
Add tests confirming that:
- A valid Huawei Cloud certificate is accepted.
- An untrusted or self-signed certificate is rejected.
- Certificate hostname mismatches are rejected.
-
Rotate temporary or permanent credentials if they were used over an intercepted or otherwise untrusted network while verification was disabled.
-
