SQL Injection and Code Injection Attack Payload Detection
This rule flags text sent to an AI agent that looks like classic SQL injection or code injection attack strings, rather than normal user requests. It catches an attacker trying to smuggle database attack payloads through a chat or tool interface into a backend system.
How the attack works
An attacker sends the agent input crafted to look like a database query fragment or injection payload: UNION SELECT statements to pull extra data, SLEEP or WAITFOR calls to test blind injection timing, OR 1=1 style conditions to bypass authentication checks, @@version calls to fingerprint the database, or DROP/INSERT statements to alter or destroy data. Some payloads instead carry Python lambda-based reverse shell code. If the agent passes this input through to a database or code execution layer without proper handling, the payload runs as if it were legitimate logic. The rule matches on the presence of these known attack patterns in the text the agent receives.
Netzilo detection
Netzilo reports this behaviour when it is observed.
- Signature ID
- e547c6e3-821a-4725-9267-c640eb601a7e
- Severity
- Critical
Why it matters
If the agent forwards or executes this input unfiltered, an organisation can suffer data exfiltration, unauthorized data modification or deletion, authentication bypass, or remote code execution via the underlying database or system.
What you can do
- →Never build SQL queries by concatenating raw user or agent-provided text; use parameterised queries or an ORM.
- →Apply least-privilege database accounts for any agent-driven queries so injected commands have minimal reach.
- →Review agent logs for the listed patterns (UNION SELECT, SLEEP/WAITFOR, OR 1=1, @@version, DROP/INSERT) appearing in user input, keeping in mind legitimate security or CTF discussions can trigger false positives.
- →Sandbox or disable any code execution path (e.g. eval/lambda execution) that agent output could reach.
Known benign look-alikes
- Security education content discussing SQL injection as examples with sanitised context
- CTF write-ups or penetration testing reports containing example payloads
- Database query debugging that happens to contain UNION or SELECT without injection markers