Skip to content

fix(ai_agents): enforce TLS certificate verification - #2239

Open
yaodong-shen wants to merge 1 commit into
TEN-framework:mainfrom
yaodong-shen:fix/cloud-tls-verification
Open

fix(ai_agents): enforce TLS certificate verification#2239
yaodong-shen wants to merge 1 commit into
TEN-framework:mainfrom
yaodong-shen:fix/cloud-tls-verification

Conversation

@yaodong-shen

Copy link
Copy Markdown

Summary

  • keep default certificate and hostname verification in six cloud WebSocket clients
  • add an AST regression test that scans production extensions for disabled TLS verification
  • run the security invariant from the top-level ai_agents test task and document the TLS policy

Fixes #2230

Scope

The issue identified three affected clients. A repository-wide scan found the same insecure pattern in stepfun_tts_python, xfyun_asr_python, and xfyun_asr_dialect_python, so this PR fixes all six production occurrences.

Validation

  • uvx --python 3.12 --from pytest pytest -q ai_agents/tests/test_tls_verification.py
  • Python 3.12 compileall for all changed Python files
  • Black check for the new test and changed files without pre-existing formatting drift
  • Go Task dry run of ai_agents test, confirming test-security runs before extension and server tests
  • local self-signed TLS handshake test, confirming the default context rejects an untrusted certificate
  • git diff --check

The full containerized extension suite could not be run locally because Docker is unavailable; repository CI will exercise that environment.

Keep certificate and hostname verification enabled for affected cloud WebSocket clients.

Add a repository-wide regression test and document the TLS policy.

Fixes TEN-framework#2230
@yaodong-shen

Copy link
Copy Markdown
Author

The claude-review check failed before reviewing the diff because the workflow requires the PR actor to have repository write permission:

Actor has insufficient permissions: read
Action failed with error: Actor does not have write permissions to the repository

This is an external fork PR, so I cannot resolve or rerun that repository-side workflow. The branch is currently mergeable with no conflicts. Could a maintainer rerun or exempt this check for external contributors?

@yaodong-shen

Copy link
Copy Markdown
Author

In addition to the claude-review permission failure noted above, the Lint PR Name, Lint Commit Messages, Build Docker Image for AI Agents, CodeQL Analysis, and AI Agents (Build & Test) workflows are all waiting for maintainer approval and created no jobs for this external-fork PR. The focused TLS regression, compile, formatting, and handshake validations pass locally. Could a maintainer approve those workflow runs as well when convenient?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Disabled TLS certificate verification in 3 cloud extensions enables MITM interception of API keys and user data

1 participant