Skip to content

Commit 804a2df

Browse files
committed
fix: filter terminal chat events by session key — prevent cross-session bleed
1 parent 0101979 commit 804a2df

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

SECURITY.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ If you discover a security vulnerability in KnotCode, please report it responsib
66

77
**Do not open a public issue.**
88

9-
Instead, email **security@openknot.ai** or use [GitHub's private vulnerability reporting](https://github.com/OpenKnots/code-editor/security/advisories/new).
9+
Instead, DM [**@BunsDev**](https://x.com/BunsDev) or use [GitHub's private vulnerability reporting](https://github.com/OpenKnots/code-editor/security/advisories/new).
10+
11+
<!-- Instead, email **security@openknot.ai** or use [GitHub's private vulnerability reporting](https://github.com/OpenKnots/code-editor/security/advisories/new). -->
1012

1113
We will acknowledge your report within 48 hours and aim to release a fix within 7 days for critical issues.
1214

components/gateway-terminal.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,14 @@ export function GatewayTerminal() {
409409
const p = payload as Record<string, unknown>
410410
const state = p.state as string | undefined
411411

412+
// Only process events for the terminal's session (main)
413+
const eventSessionKey = (p.sessionKey ??
414+
p.session_key ??
415+
(typeof p.session === 'object' && p.session !== null
416+
? (p.session as Record<string, unknown>).key
417+
: undefined)) as string | undefined
418+
if (eventSessionKey && eventSessionKey !== 'main') return
419+
412420
if (state === 'delta') {
413421
const text = extractEventText(p)
414422
if (text) {

0 commit comments

Comments
 (0)