Skip to content

fix(asap): isolate inbound task.request sessions by sender URN - #64

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-32b5
Draft

fix(asap): isolate inbound task.request sessions by sender URN#64
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-32b5

Conversation

@cursor

@cursor cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bug and impact

Every inbound POST /asap task.request used the hardcoded session id asap:inbound, so unrelated ASAP clients shared one SQLite conversation history. A second client could read prior prompts and assistant replies from another sender — cross-client context bleed and privacy violation.

Trigger: Client A sends task.request with secret context; Client B (different sender URN) sends a follow-up and receives answers informed by A's history.

Root cause

handle_asap never set asap_server_ctx_t.session_id, and handle_task_request defaulted to "asap:inbound" when unset.

Fix

  • Add asap_resolve_task_session_id() to derive asap:<sender> from the envelope sender URN when no explicit session is provided.
  • Unit tests cover override, sender derivation, and fallback.

Validation

  • server.c syntax-checked with -Wall -Wextra -Werror
  • Added test_resolve_task_session_id in tests/test_asap_server.c
Open in Web View Automation 

All POST /asap task.request calls shared the hardcoded session
"asap:inbound", leaking conversation history across unrelated clients.
Derive per-sender session ids from the envelope sender field.

Co-authored-by: esadrianno <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant