T09 · Insecure Skill Coding Practices
- Location
scripts/flexus_lifecycle.py:332- Finding
TLS Certificate Verification Disabled for Credentialed Cloud Lifecycle Requests
- Content
View full analysis
Vulnerability Details
File Location:
scripts/flexus_lifecycle.py:23-25,scripts/flexus_lifecycle.py:332-339, andscripts/flexus_lifecycle.py:461-468
Vulnerability Type: Improper certificate validation (CWE-295)
Risk Level: HighVulnerable Code
python # Disable SSL warnings import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)python config = HttpConfig.get_default_config() config.ignore_ssl_verification = True client = BssClient.new_builder() \ .with_credentials(credentials) \ .with_http_config(config) \ .with_region(BssRegion.value_of(region)) \ .build()python resp = requests.request( signed_request.method, full_url, headers=signed_request.header_params, data=signed_request.body, verify=False, timeout=60 )Technical Analysis
The Skill explicitly disables TLS certificate verification for two security-sensitive communication paths:
- The Huawei Cloud BSS SDK client used for resource validation, renewal, and unsubscription sets
ignore_ssl_verificationtoTrue. - The direct HCSS request used to create a Flexus L instance passes
verify=Falsetorequests.request.
The global suppression of
InsecureRequestWarningfurther conceals the insecure connection from users and operators.These requests carry signed authorization headers and may include a temporary
X-Security-Token, resource identifiers, order parameters, and destructive or charge-bearing lifecycle operations. Disabling certificate verification means the client does not establish that the TLS peer is the intended Huawei Cloud endpoint. A network intermediary able to redirect or intercept traffic can therefore present an arbitrary certificate without causing the request to fail.The IAM project lookup and documentation extractor do not show this defect because their respective requests retain default c ...[truncated 1993 chars]
- The Huawei Cloud BSS SDK client used for resource validation, renewal, and unsubscription sets
- Remediation
View remediation
Remediation Suggestions
-
Remove the BSS SDK TLS bypass:
python config = HttpConfig.get_default_config() # Do not set ignore_ssl_verification to True. -
Remove
verify=Falsefrom the HCSS request so thatrequestsuses certificate verification by default:python resp = requests.request( signed_request.method, full_url, headers=signed_request.header_params, data=signed_request.body, timeout=60 ) -
Remove global suppression of
InsecureRequestWarning. TLS failures should remain visible and should fail closed. -
If a private enterprise CA or inspection proxy is legitimately required, accept an explicit CA bundle through a narrowly scoped configuration option and pass its path as
verify="/path/to/ca-bundle.pem". Do not provide a mode that disables validation entirely. -
Add regression tests that connect to an endpoint with an untrusted or hostname-mismatched certificate and verify that HCSS and BSS operations fail before transmitting authenticated requests.
-
Document supported proxy and CA configuration without recommending insecure TLS overrides.
-
