# SQL Injection via Unparameterized Template-Expression Value in Workflow-Automation SQL Node (CVE-2026-59257)

- **Severity:** High
- **Signature ID:** `0aff5d28-a044-46d7-b898-5f0b09e5369c`
- **CVEs:** CVE-2026-59257
- **MITRE ATLAS:** AML.T0010 (AI Supply Chain Compromise)
- **OWASP:** ASI05 (Cascading Failures in Multi-Agent Systems), LLM06 (Excessive Agency)

## Summary

Workflow-automation tools like n8n let users build SQL queries with template expressions such as {{ ... }}. When a workflow inserts one of these expressions directly into raw SQL text instead of using a safe placeholder, and that workflow is triggered by an external webhook, an attacker can send input that gets executed as SQL against the database.

## How the attack works

A workflow contains a SQL node whose query is assembled by pasting a template expression directly into the SQL string, rather than binding it as a parameter. The workflow is reachable from outside via a webhook trigger, so an attacker can control the value that flows into the expression. That attacker-controlled value lands in the raw SQL text and is executed with the database credentials configured for the node. This lets the attacker run arbitrary SQL, not just the query the workflow author intended.

## Why it matters

An attacker can read, modify, or delete data in whatever database the workflow's credentials can reach, and potentially escalate further depending on what that database account is permitted to do.

## What you can do

- Rewrite affected SQL nodes to use parameterized placeholders (?, :name, $1) instead of concatenating template-expression values into the query text.
- Review all workflows with externally-reachable webhook triggers for SQL nodes and audit how each builds its query string.
- Restrict the database credentials used by automation workflows to the minimum permissions needed, avoiding broad read/write or admin access.
- Add input validation or allow-lists at the webhook trigger for any value that eventually reaches a SQL node.

## Known benign look-alikes

- A query string built entirely from parameterized placeholders (?, :name, $1) with the template expression only supplying the placeholder's bound value, not concatenated into the SQL text itself.
- Template-expression syntax appearing in non-SQL contexts (e.g. an HTML template or a Slack message body) with no adjacent SQL keywords.

## References

- https://agentthreatrule.org/en/rules/ATR-2026-02263
- https://jvndb.jvn.jp/ja/contents/2026/JVNDB-2026-023001.html
- https://nvd.nist.gov/vuln/detail/CVE-2026-59257

---
Source: https://www.netzilo.com/threats/atr-sql-injection-via-unparameterized-template-expression-value
