T09 · Insecure Skill Coding Practices
- Location
SKILL.md:96- Finding
TLS Certificate and Hostname Verification Disabled
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 96–98 and 244–246
Vulnerability Type: Improper TLS certificate validation
Risk Level: HighVulnerable Code
The recommended upload example disables both hostname and certificate verification:
python ssl_context = ssl.create_default_context() ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONEThe complete example repeats the same configuration:
python self.ssl_context = ssl.create_default_context() self.ssl_context.check_hostname = False self.ssl_context.verify_mode = ssl.CERT_NONEThis context is then passed to the token, file-upload, and message API requests:
python with urllib.request.urlopen(req, context=self.ssl_context) as res: result = json.loads(res.read().decode('utf-8'))Technical Analysis
The Skill's declared purpose requires sending credentials, file contents, and message information to the official Feishu API. That network behavior is functionally necessary. However, disabling TLS certificate and hostname verification is not necessary and violates least-secure-access principles.
ssl.CERT_NONEcauses the client to accept an untrusted or attacker-controlled certificate. Disablingcheck_hostnamealso prevents the client from confirming that the certificate belongs toopen.feishu.cn. Although the URL uses HTTPS, these settings remove the server-authentication guarantee normally provided by TLS.The affected requests include:
- Token acquisition, which transmits the Feishu
app_idandapp_secret. - File upload, which transmits a bearer token and the entire selected local file.
- Message delivery, which transmits a bearer token, recipient identifier, and file key.
The examples use the same insecure context for all these operations. A user following the documentation would therefore deploy code vulnerable to interception.
Attack Path
- A victim ...[truncated 1626 chars]
- Token acquisition, which transmits the Feishu
- Remediation
View remediation
Remediation Suggestions
-
Remove both insecure TLS assignments from every example:
python ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE -
Retain Python's secure default certificate and hostname validation:
python ssl_context = ssl.create_default_context() -
Apply the corrected context consistently to token acquisition, file upload, and message-delivery requests.
-
If a private trust store is genuinely required, accept an explicit CA bundle rather than disabling verification:
python ssl_context = ssl.create_default_context(cafile="/path/to/trusted-ca.pem") -
Do not provide a permissive fallback that retries with
CERT_NONEafter a certificate error. Fail closed and report certificate-validation failures to the user. -
Store application secrets outside source code, preferably in a protected secret manager or environment variable, and avoid printing tokens or secrets in logs.
-
After correcting the examples, rotate any application secrets and invalidate tokens that may previously have traversed networks using the insecure configuration.
-
