Web/SQL Application Logs: SQL Error Strings Indicative of Injection Probing

Flags SQL error log messages with injection-probing syntax/quoting/UNION mismatch keywords.

FreeReviewedSigma · High · v5
Product
sql
Category
application
Author
Bjoern Kimminich (SigmaHQ), DRL 1.1
Published
2017-11-27
Updated
2026-07-31
title: "Web/SQL Application Logs: SQL Error Strings Indicative of Injection Probing"
id: b08f4092-77ef-4691-a2e0-f29f5b1f199d
status: test
description: This rule matches application SQL error messages that commonly appear when an attacker probes for SQL injection (e.g., unterminated quotes, SQL syntax errors, and UNION-related column count mismatches). Such errors can be triggered by crafted inputs used to test whether database queries are susceptible to injection. It relies on application logs from SQL-producing systems containing the specific error text captured by the rule keywords.
references:
  - http://www.sqlinjection.net/errors
  - https://github.com/SigmaHQ/sigma/blob/master/rules/application/sql/app_sqlinjection_errors.yml
author: Bjoern Kimminich, Huntrule Team
date: 2017-11-27
modified: 2023-02-12
tags:
  - attack.initial-access
  - attack.t1190
logsource:
  category: application
  product: sql
  definition: "Requirements: application error logs must be collected (with LOG_LEVEL ERROR and above)"
detection:
  keywords:
    - quoted string not properly terminated
    - You have an error in your SQL syntax
    - Unclosed quotation mark
    - 'near "*": syntax error'
    - SELECTs to the left and right of UNION do not have the same number of result columns
  condition: keywords
falsepositives:
  - A syntax error in MySQL also occurs in non-dynamic (safe) queries if there is an empty in() clause, that may often be the case.
level: high
license: DRL-1.1
related:
  - id: 8a670c6d-7189-4b1c-8017-a417ca84a086
    type: derived