Advisory

PYSEC-2026-3518

Details, part 2 of 2. The advisory

Details

When exploited, the attacker can submit arbitrary prompt text to the configured
PraisonAI agent despite Slack bot allowlists or pairing policy. The downstream
impact depends on the deployed agent and tools. PraisonAI's default bot config
auto-approves safe tools and includes web, memory, scheduling, file, planning,
and skill tools, so unauthorized invocation can affect confidentiality and
integrity in real deployments.

This report does not claim compromise of Slack itself, bypass of Slack request
signature verification, or arbitrary code execution by default.

Suggested fix

Use one shared authorization preflight for every Slack ingress path before
firing message hooks or invoking agents.

Concrete patch direction:

  1. Convert app_mention events through _convert_event_to_message() or a dedicated equivalent that preserves sender, channel, text, timestamp, and thread metadata.
  2. Set bot_message._channel_type = "slack" for app_mention.
  3. Run the same channel check, user allowlist check, and UnknownUserHandler.handle(...) policy used by handle_message.
  4. Only then strip the bot mention and invoke _session.chat(...).
  5. Add regression tests for:
  • blocked user plus blocked channel: message and app_mention both drop;
  • blocked user in allowed channel: both drop;
  • allowed user in blocked channel: both drop;
  • allowed user in allowed channel: both invoke;
  • unknown_user_policy="pair": app_mention starts the same pairing flow instead of invoking the agent.

Sources & licences