NocoBase Has SQL Injection via template variable substitution in workflow SQL node
Summary
NocoBase <= 2.0.8 plugin-workflow-sql substitutes template variables directly into raw SQL strings via getParsedValue() without parameterization or escaping. Any user who triggers a workflow containing a SQL node with template variables from user-controlled data can inject arbitrary SQL.
Affected Versions
- Affected: all versions through 2.0.8
Details
The SQLInstruction in packages/plugins/@nocobase/plugin-workflow-sql/src/server/SQLInstruction.ts line 28 processes SQL templates:
// SQLInstruction.ts:28
const sql = processor.getParsedValue(node.config.sql || '', node.id).trim();
Then executes the resulting string directly:
// SQLInstruction.ts:35
const [result] = await collectionManager.db.sequelize.query(sql, {
transaction: this.workflow.useDataSourceTransaction(dataSourceName, processor.transaction),
});
getParsedValue() performs simple string substitution of {{$context.data.fieldName}} placeholders with values from the workflow trigger data. No escaping, quoting, or parameterized binding is applied.
When an admin creates a SQL node with a template like:
SELECT * FROM users WHERE nickname = '{{$context.data.nickname}}'
Any user who triggers the workflow with a crafted value can break out of the string literal and inject arbitrary SQL.
Proof of Concept
- Login as admin
- Create a collection-trigger workflow on the
userstable (mode: after create) - Add a SQL node with:
SELECT id, nickname, email FROM users WHERE nickname = '{{$context.data.nickname}}'
- Enable the workflow
- Create a user with nickname set to:
' UNION SELECT 1,version(),current_user -- - Check execution result:
[
{
"id": 1,
"nickname": "PostgreSQL 16.13 (Debian 16.13-1.pgdg13+1) on x86_64-pc-linux-gnu...",
"email": "nocobase"
}
]
The injected UNION SELECT returned the database version and current database user.
Impact
Full database read/write access through SQL injection. An attacker who can trigger a workflow with a SQL node containing template variables from user-controlled data can extract credentials, modify records, or drop tables. The severity depends on the database user's privileges (full superuser access in the default Docker deployment).
Suggested Fix
Use parameterized queries. Replace direct string substitution with Sequelize bind parameters:
// SQLInstruction.ts
- const sql = processor.getParsedValue(node.config.sql || '', node.id).trim();
+ const { sql, bind } = processor.getParsedValueAsParams(node.config.sql || '', node.id);
const [result] = await collectionManager.db.sequelize.query(sql, {
+ bind,
transaction: ...
});
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | @nocobase/plugin-workflow-sql | < 2.0.30 | 2.0.30 |
References
- https://github.com/nocobase/nocobase/security/advisories/GHSA-vx58-fwwq-5g8j
- https://nvd.nist.gov/vuln/detail/CVE-2026-34825
- https://github.com/nocobase/nocobase/commit/75da3dddc4aba739c398f7072725dcf7f5487f5c
- https://github.com/nocobase/nocobase
- https://github.com/nocobase/nocobase/releases/tag/v2.0.30
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N- Weakness (CWE)
CWE-89- Platform
- npm
- Package
@nocobase/plugin-workflow-sql- Disclosed
- 01.04.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-vx58-fwwq-5g8j - CC BY 4.0
Vulnerability history: @nocobase/plugin-workflow-sql
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.