Skip to content

Bug: DocuEngine dynamic tools are process-global and can leak the first token's toolset across users #26

@francescobianco

Description

@francescobianco

Summary

When the first authenticated request initializes DocuEngine dynamic tools, the resulting tool list appears to become global for the whole process. In a shared deployment this means the first token to hit the server can effectively decide which dynamic tools are registered for everyone else.

Reproduction

  1. Start one shared server instance.
  2. Send a first authenticated request with token A that has a limited set of services.
  3. Later connect with token B that should expose a different or broader DocuEngine surface.
  4. Observe that the server keeps the already-registered dynamic toolset.

Expected

Dynamic tools should either be tenant-safe, token-scoped, or the server should make the shared-process limitation explicit and deterministic.

Actual

init_dynamic_tools() is guarded by a process-global flag, so the first successful registration wins.

Notes

This becomes visible in cloud or team environments where one MCP instance is reused by multiple users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions