| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Commit d1b1d92 added an ownership check to getSession and deleteSession (compare the backend-reported session owner to the caller's userId, deny as not-found on mismatch), but the same check was not applied to listEvents. listEvents returns a session's full event stream (conversation content, tool calls, state deltas) addressed solely by sessionId. The Vertex backend session-events sub-resource does not enforce per-caller ownership on its own (per the existing comments on the getSession/ deleteSession checks), so without a client-side check any authenticated caller who knows or guesses another user's sessionId can read that user's full conversation history via listEvents, the same disclosure class d1b1d92 fixed for getSession/deleteSession, left open here. Fixes listEvents to fetch the session and apply the same ownership check getSession/deleteSession already use before returning events, denying as empty (not an error) on mismatch, consistent with getSession's not-found-style denial. Adds a regression test (listEvents_wrongUser_returnsEmpty) mirroring the existing getSession_wrongUser_returnsEmpty test.
|
Hi @prasanna8585, thank you for your contribution! We appreciate you taking the time to submit this pull request. our team is currently reviewing your changes, and we will keep you posted if any additional information is required. Thank you! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Commit d1b1d92 (#1323) added an ownership check to getSession and deleteSession - fetch the session, compare the backend-reported owner to the caller's userId, deny as not-found on mismatch. The same check was not applied to listEvents.
Impact
listEvents returns a session's full event stream (conversation content, tool calls, state deltas) addressed solely by sessionId, with no ownership check. The Vertex backend session-events sub-resource does not enforce per-caller ownership on its own (per the existing comments on the getSession/deleteSession checks in this same file), so any authenticated caller who knows or guesses another user's sessionId can read that user's full conversation history via listEvents - the same disclosure class d1b1d92 fixed for getSession/deleteSession, left open here. listEvents is public API (BaseSessionService interface), not an internal helper.
Fix
listEvents now fetches the session and applies the same ownership check getSession/deleteSession already use before returning events, denying as an empty response (not an error) on mismatch - consistent with getSession's not-found-style denial rather than deleteSession's exception-based one, since listEvents' existing contract already returns an empty response for a nonexistent/eventless session.
Testing
Added listEvents_wrongUser_returnsEmpty, mirroring the existing getSession_wrongUser_returnsEmpty test in the same file. Verified locally: the new test fails against the unfixed code (confirming it genuinely exercises the gap) and passes with the fix; full VertexAiSessionServiceTest suite passes with no regressions.