Find LLM chat memory shared between users (OWASP LLM02)
ProprietaryFind chat memory that every user of an LLM service shares, so one user's messages (and whatever personal data they contain) become part of the next user's prompt and can be repeated back to them. Flags LangChain4j AiServices.chatMemory(..) and @AiService(chatMemory = ..), which hold a single memory rather than one per @MemoryId; a Spring AI chat memory advisor param whose conversation id is a constant; and, on Spring AI 1.0.0 through 1.0.6, chat memory advisors built without a per-user conversation id when no request in the repository supplies one, which share the default conversation. Applications with a single user, such as a command line tool, can ignore the finding.
org. openrewrite. ai. security. FindSharedChatMemorymod run . --recipe= org. openrewrite. ai. security. FindSharedChatMemoryInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.