Skip to content

openai/session breaks the MCP gateway topic, denying every request from OpenAI clients #8564

Description

@cstns

Since #8561 shipped, MCP requests from OpenAI clients are denied at the broker and time out after 30 seconds.

_meta["openai/session"] is shaped v1/<token> and contains a slash. The session id is interpolated directly into the gateway topic (forge/comms/mcpGateway.js:40), so the value adds an extra topic level:

ff/v1/mcp/<platformId>/<userId>/v1/<token>/request

The ACL pattern at aclManager.js:771 matches the session segment with ([^/]+), so the reshaped topic matches no pattern at all. The publish is denied without raising a ValidationError, which is why nothing shows in the logs beyond the ACL result itself. Observed on production:

topic: ff/v1/mcp/61d2e295-…/48gLbjwmkj/v1/3bjqKQlG…/request
action: publish   result: deny   responseTime: 0.226 ms

The request never reaches the broker or the gateway, so forge waits out its 30s DEFAULT_TIMEOUT and returns 504. Neighbouring requests from the same user carrying UUID session ids are allowed and complete in ~150 ms.

The ACL's session validation checks length only (mcpSessionId.length < 8) and never the character set, so a value carrying a topic separator or an MQTT wildcard passes it.

Isolated to OpenAI clients, as they are the only ones sending openai/session.

Might be worth sanitising the third-party value before it reaches the topic, and replacing the ACL length check with a format check.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions