Skip to content

fix(security): validate Telegram send_message media paths#34389

Open
zapabob wants to merge 1 commit into
NousResearch:mainfrom
zapabob:codex/send-message-media-validation
Open

fix(security): validate Telegram send_message media paths#34389
zapabob wants to merge 1 commit into
NousResearch:mainfrom
zapabob:codex/send-message-media-validation

Conversation

@zapabob

@zapabob zapabob commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • re-validate standalone Telegram send_message media paths immediately before opening/uploading them
  • normalize accepted media paths through validate_media_delivery_path() so the standalone path matches the gateway delivery guard
  • add a regression test that runs without the optional python-telegram-bot package by mocking the Telegram module locally

Closes #34270.

Tests

  • python -m ruff check .
  • python -m ruff check tools/send_message_tool.py tests/tools/test_send_message_telegram_media_validation.py
  • python scripts/run_tests_parallel.py tests/tools/test_send_message_telegram_media_validation.py -- --tb=short --timeout-method=thread

@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter P2 Medium — degraded but workaround exists labels May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: send_message tool bypasses validate_media_delivery_path security check

2 participants