Skip to content

gateway: chat.abort has no owner-authorization — any client can abort another client's run #2721

Description

@alexey-pelykh

Summary

The gateway chat.abort method does not verify that the requester owns the run it is aborting. Any authenticated client can abort another client's in-flight chat run.

Impact

HIGH. Cross-client denial of in-flight work: any operator/client with gateway access can cancel runs they do not own, disrupting other sessions. There is currently no owner check on the abort path.

Current behavior

chat.abort accepts an abort request and cancels the targeted run regardless of which client originated the run. Explicit run-id aborts and session-scoped aborts are both unconditionally honored.

Expected behavior

  • An explicit run abort from a client that does not own the run is rejected as unauthorized.
  • A session-scoped abort only affects runs owned by the requester.
  • Admin/owner callers retain full abort capability.

Fix sketch

Restore the owner-authorization control in src/gateway/server-methods/chat.ts:

  • resolveChatAbortRequester (identify the requesting client/owner)
  • canRequesterAbortChatRun (authorize requester against the run's owner)
  • populate run ownership at run-start so the check has data

This is self-contained to chat.ts (no shared-core edits required).

Why this was deferred

Restoring the check flips currently-accepted non-owner aborts to "unauthorized" — a security-semantics tightening (behavior change). It must not ride a make-the-suite-green change. The two covering tests are present but it.skip-ped with a documented TODO in src/gateway/server-methods/chat.abort-authorization.test.ts (~lines 54 and 95).

Acceptance criteria

  • The two skipped tests in chat.abort-authorization.test.ts are un-skipped and pass.
  • A non-owner explicit run abort is rejected.
  • A session-scoped abort only cancels requester-owned runs.

Metadata

Metadata

Assignees

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