Injection is a flaw where untrusted input changes the meaning of a query or command. Instead of being treated as data, the input is interpreted as part of SQL, a shell command, a template, a search filter, or another executable structure. That can let an attacker read data, modify records, trigger hidden behavior, or run unauthorized actions.
In modern AI applications, injection can appear outside classic databases. A conversation ID, metadata filter, document name, or retrieval parameter may be concatenated into a query or passed into a tool without proper validation. In frameworks like Spring AI, that matters because memory scope, vector-store lookups, and file ingestion can all become trust boundaries. Defenses include parameterized queries, strict input validation, escaping, allowlists, least privilege, and separating user-controlled data from executable logic.


