You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The chat widget stores the full conversation history (up to 100 messages) and the last OpenAI responseId in localStorage as plaintext JSON. This persists sensitive AI conversation data accessible to any JavaScript on the same origin — including third-party scripts, browser extensions, and XSS payloads.
Affected Code
EssentialCSharp.Web/wwwroot/js/chat-module.js:
constdata={messages: messagesToSave,// up to 100 messages, full contentlastResponseId: lastResponseId.value,// OpenAI response ID (enables conversation replay)timestamp: Date.now()};localStorage.setItem('aiChatHistory',JSON.stringify(data));
Risk
OWASP AI Agent Security - §8 Data Protection & Privacy
Summary
The chat widget stores the full conversation history (up to 100 messages) and the last OpenAI
responseIdinlocalStorageas plaintext JSON. This persists sensitive AI conversation data accessible to any JavaScript on the same origin — including third-party scripts, browser extensions, and XSS payloads.Affected Code
EssentialCSharp.Web/wwwroot/js/chat-module.js:Risk
OWASP AI Agent Security - §8 Data Protection & Privacy
lastResponseIdinlocalStorageis security-sensitive — as noted in issue Security: Client-SuppliedpreviousResponseIdNot Bound to Authenticated User — Cross-User Conversation Access #1070, this ID can be used by any authenticated user to continue another user's conversation. Storing it inlocalStorageexposes it to XSS and browser extension theft.timestampfield is stored but never used to expire old data.Recommended Mitigations
lastResponseIdinlocalStorage— store it server-side in the user's session (see Security: Client-SuppliedpreviousResponseIdNot Bound to Authenticated User — Cross-User Conversation Access #1070). Remove it from the persisted payload entirely.sessionStorageinstead oflocalStorage— clears on tab close, reducing persistent exposure.timestampas a TTL:References